browse.phtml 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. /**
  3. * @version 7.8
  4. */
  5. /** @var bool $inAdmin */
  6. /** @var string $type */
  7. ?>
  8. <nav class="navbar navbar-filter">
  9. <?php if (!$inAdmin) { ?>
  10. <div class="navbar-left">
  11. <?php
  12. /** @var \Cube\Navigation $container */
  13. $container = $this->navigation()->getContainer();
  14. echo $this->navigation()
  15. ->setContainer($container->findOneBy('label', $this->_('Sale Invoices Filter')))
  16. ->setPartial('navigation/browse-filter.phtml')
  17. ->menu();
  18. // reset navigation container (workaround for the navigation on the layout page)
  19. $this->navigation()->setContainer($container);
  20. ?>
  21. </div>
  22. <?php } ?>
  23. <form class="navbar-form navbar-right" action="<?php echo $this->url(null, null, true,
  24. array('sale_id', 'listing_id', 'keywords', 'option', 'page', 'submit')); ?>" method="get">
  25. <div class="form-group">
  26. <?php echo
  27. $this->formElement('text', 'sale_id', $this->saleId)
  28. ->setAttributes(array('placeholder' => $this->_('Invoice ID'), 'class' => 'form-control input-default'))
  29. ->render();
  30. ?>
  31. </div>
  32. <?php echo
  33. $this->formElement('submit', 'submit', $this->_('Search'))
  34. ->setAttributes(array('class' => 'btn btn-default'))
  35. ->render();
  36. ?>
  37. </form>
  38. </nav>
  39. <div class="table-responsive">
  40. <table class="table">
  41. <caption>
  42. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('invoices found.'); ?>
  43. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  44. <?php echo $this->_('Showing results'); ?>
  45. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  46. <?php echo $this->_('to'); ?>
  47. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  48. <?php } ?>
  49. </caption>
  50. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  51. <thead>
  52. <tr>
  53. <th><?php echo $this->_('Sale Details'); ?></th>
  54. <th class="size-tiny"></th>
  55. </tr>
  56. </thead>
  57. <?php } ?>
  58. <tbody>
  59. <?php
  60. /** @var \Ppb\Db\Table\Row\Sale $sale */
  61. foreach ($this->paginator as $sale) {
  62. ?>
  63. <tr>
  64. <td>
  65. <?php echo $this->partial('partials/sale.phtml', array(
  66. 'sale' => $sale,
  67. 'postageDesc' => true,
  68. 'caption' => true,
  69. 'directPaymentButton' => true,
  70. 'type' => $type,
  71. 'displayDownloads' => true,
  72. 'inAdmin' => $inAdmin)); ?>
  73. </td>
  74. <td>
  75. <?php if ($sale->isActive(false) && !$inAdmin) { ?>
  76. <div class="btn-group-vertical">
  77. <?php if ($sale->canEdit()) { ?>
  78. <a class="btn btn-sm btn-default"
  79. href="<?php echo $this->url(array('action' => 'edit', 'sale_id' => $sale['id'])); ?>"
  80. title="<?php echo $this->_('Edit Invoice'); ?>">
  81. <i class="fa fa-folder-open"></i>
  82. </a>
  83. <?php if ($sale->canCombinePurchases()) { ?>
  84. <a class="btn btn-sm btn-default"
  85. href="<?php echo $this->url(array('action' => 'edit', 'option' => 'combine', 'sale_id' => $sale['id'])); ?>"
  86. title="<?php echo $this->_('Combine Invoices'); ?>">
  87. <i class="fa fa-chain"></i>
  88. </a>
  89. <?php } ?>
  90. <?php } ?>
  91. <?php if ($sale->isSeller()) { ?>
  92. <a class="btn btn-sm btn-default jq-popup-form"
  93. href="<?php echo $this->url(array('action' => 'update-status', 'sale_id' => $sale['id'])); ?>"
  94. data-close-redirect="<?php echo $this->url(array('action' => 'browse', 'type' => 'sold')); ?>"
  95. title="<?php echo $this->_('Update Shipping & Payment Details'); ?>">
  96. <i class="fa fa-truck"></i>
  97. </a>
  98. <?php } ?>
  99. <?php if ($sale->canDelete()) { ?>
  100. <a class="btn btn-sm btn-danger confirm-box"
  101. href="<?php echo $this->url(array('action' => 'delete', 'sale_id' => $sale['id']),
  102. null,
  103. true); ?>"
  104. title="<?php echo $this->_('Delete Invoice'); ?>"
  105. data-message="<?php echo $this->_('Are you sure you want to delete this invoice?'); ?>">
  106. <i class="fa fa-times"></i>
  107. </a>
  108. <?php } ?>
  109. </div>
  110. <?php } ?>
  111. <?php if ($inAdmin) { ?>
  112. <a class="btn btn-danger confirm-box"
  113. href="<?php echo $this->url(array('option' => 'delete', 'sale_id' => $sale['id']), null,
  114. true); ?>"
  115. title="<?php echo $this->_('Delete Invoice'); ?>"
  116. data-message="<?php echo $this->_('Are you sure you want to delete this invoice?'); ?>">
  117. <i class="fa fa-times"></i>
  118. </a>
  119. <?php } ?>
  120. </td>
  121. </tr>
  122. <?php } ?>
  123. </tbody>
  124. </table>
  125. </div>
  126. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>