store-information.phtml 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. /**
  3. * @version 7.4
  4. */
  5. /** @var \Ppb\Db\Table\Row\User $user */
  6. /** @var \Ppb\Db\Table\Row\StoreSubscription $subscription */
  7. $subscription = null;
  8. if ($user['store_subscription_id']) {
  9. $subscription = $user->findParentRow('\Ppb\Db\Table\StoresSubscriptions');
  10. }
  11. $this->storeSubscription($subscription);
  12. ?>
  13. <div class="user-box">
  14. <div>
  15. <dl>
  16. <dd>
  17. <div class="lead">
  18. <?php echo $this->_('Status:'); ?>
  19. <?php echo ($user['store_active']) ?
  20. '<span class="text-success">' . $this->_('Enabled') . '</span>' :
  21. '<span class="text-danger">' . $this->_('Disabled') . '</span>'; ?>
  22. <div class="pull-right">
  23. <?php if ($user['store_active']) { ?>
  24. <?php if ($user['store_subscription_id']) { ?>
  25. <a href="<?php echo $this->url(array('module' => 'app', 'controller' => 'payment', 'action' => 'store-subscription')); ?>"
  26. class="btn btn-small btn-primary"><?php echo $this->_('Renew'); ?></a>
  27. <?php } ?>
  28. <a href="<?php echo $this->url(array('module' => 'members', 'controller' => 'store', 'action' => 'disable')); ?>"
  29. class="btn btn-small btn-danger"><?php echo $this->_('Disable'); ?></a>
  30. <?php
  31. }
  32. else if ($user['store_subscription_id']) {
  33. ?>
  34. <a href="<?php echo $this->url(array('module' => 'app', 'controller' => 'payment', 'action' => 'store-subscription')); ?>"
  35. class="btn btn-small btn-success"><?php echo $this->_('Enable'); ?></a>
  36. <?php } ?>
  37. </div>
  38. </div>
  39. </dd>
  40. <dt><?php echo $this->_('Subscription'); ?></dt>
  41. <dd>
  42. <?php if ($user['store_subscription_id']) { ?>
  43. <?php echo $this->_($subscription['name']); ?>
  44. <?php if ($user['store_next_payment']) { ?>
  45. - <?php echo $this->_('expires on'); ?> <?php echo $this->date($user['store_next_payment'], true); ?>
  46. <?php } ?>
  47. <?php
  48. }
  49. else {
  50. ?>
  51. <?php echo ($user['store_active']) ? $this->_('Default Account') : $this->_('none'); ?>
  52. <?php } ?>
  53. </dd>
  54. <?php if ($user['store_subscription_id']) { ?>
  55. <dd>
  56. <?php echo $this->storeSubscription()->description(); ?>
  57. </dd>
  58. <dt><?php echo $this->_('Listings'); ?></dt>
  59. <dd>
  60. <?php echo sprintf(
  61. $this->_('%s listed, %s remaining'),
  62. ($count = $user->countStoreListings()),
  63. ((($remaining = ($subscription['listings'] - $count)) > 0) ? $remaining : 0)); ?>
  64. </dd>
  65. <?php } ?>
  66. <?php if ($user['store_active']) { ?>
  67. <dt><?php echo $this->_('Store URL'); ?></dt>
  68. <dd>
  69. <?php $storeLink = $this->url($user->storeLink()); ?>
  70. <a href="<?php echo $storeLink; ?>" target="_blank"><?php echo $storeLink; ?></a>
  71. </dd>
  72. <?php } ?>
  73. </dl>
  74. </div>
  75. </div>
  76. <div class="clearfix"></div>