address-book.phtml 4.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <?php
  2. /**
  3. * @version 7.10 [rev.7.10.01]
  4. */
  5. /** @var \Ppb\Db\Table\Row\User $user */
  6. $this->userDetails($user); ?>
  7. <nav class="navbar navbar-filter">
  8. <div class="navbar-left">
  9. <a class="btn btn-default pull-left spacing-right"
  10. href="<?php echo $this->url(array('action' => 'add-address')); ?>">
  11. <?php echo $this->_('Add Address'); ?>
  12. </a>
  13. </div>
  14. </nav>
  15. <div class="table-responsive">
  16. <table class="table">
  17. <caption>
  18. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong>
  19. <?php echo $this->_('addresses found in your address book.'); ?>
  20. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  21. <?php echo $this->_('Showing results'); ?>
  22. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  23. <?php echo $this->_('to'); ?>
  24. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  25. <?php } ?>
  26. </caption>
  27. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  28. <thead>
  29. <tr>
  30. <th><?php echo $this->_('Address'); ?></th>
  31. <th class="size-mini"></th>
  32. <th class="size-small"><?php echo $this->_('Options'); ?></th>
  33. </tr>
  34. </thead>
  35. <?php } ?>
  36. <tbody>
  37. <?php
  38. /** @var \Ppb\Db\Table\Row\UserAddressBook $address */
  39. foreach ($this->paginator as $address) {
  40. ?>
  41. <tr <?php echo ($address->isPrimary()) ? 'class="success"' : ''; ?>>
  42. <td>
  43. <?php echo $this->userDetails()->setAddress($address['id'])->displayFullAddress(); ?>
  44. </td>
  45. <td>
  46. <?php if ($address->isPrimary()) { ?>
  47. <span class="label label-primary"><?php echo $this->_('Primary'); ?></span>
  48. <?php
  49. }
  50. else {
  51. ?>
  52. <a class="btn btn-sm btn-default confirm-box"
  53. href="<?php echo $this->url(array('action' => 'primary-address', 'id' => $address['id'])); ?>"
  54. title="<?php echo $this->_('Set as Primary'); ?>"
  55. data-message="<?php echo $this->_('Are you sure you want to set this address as your primary address?'); ?>">
  56. <i class="fa fa-key"></i>
  57. </a>
  58. <?php } ?>
  59. </td>
  60. <td>
  61. <div class="btn-group">
  62. <?php if ($address->canEdit()) { ?>
  63. <a class="btn btn-sm btn-default"
  64. href="<?php echo $this->url(array('action' => 'edit-address', 'id' => $address['id']), null, true); ?>"
  65. title="<?php echo $this->_('Edit Address'); ?>">
  66. <i class="fa fa-folder-open"></i>
  67. </a>
  68. <?php } ?>
  69. <?php if ($address->canDelete()) { ?>
  70. <a class="btn btn-sm btn-danger confirm-box"
  71. href="<?php echo $this->url(array('action' => 'delete-address', 'id' => $address['id']), null, true); ?>"
  72. title="<?php echo $this->_('Delete Address'); ?>"
  73. data-message="<?php echo $this->_('Are you sure you want to delete this address from the address book?'); ?>">
  74. <i class="fa fa-times"></i>
  75. </a>
  76. <?php } ?>
  77. </div>
  78. </td>
  79. </tr>
  80. <?php } ?>
  81. </tbody>
  82. </table>
  83. </div>
  84. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>