browse.phtml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. <?php
  2. /**
  3. * @version 7.10 [rev.7.10.01]
  4. */
  5. ?>
  6. <nav class="navbar navbar-filter">
  7. <div class="navbar-left">
  8. <?php
  9. $container = $this->navigation()->getContainer();
  10. echo $this->navigation()
  11. ->setContainer($container->findOneBy('label', $this->_('Offers Filter')))
  12. ->setPartial('navigation/browse-filter.phtml')
  13. ->menu();
  14. $this->navigation()->setContainer($container);
  15. ?>
  16. </div>
  17. <form class="navbar-form navbar-right" action="<?php echo $this->url(null, null, true,
  18. array('listing_id', 'keywords', 'option', 'page', 'submit')); ?>" method="get">
  19. <div class="form-group">
  20. <?php echo $this->formElement('text', 'keywords', $this->keywords)
  21. ->setAttributes(array('placeholder' => $this->_('Listing Title'), 'class' => 'form-control input-default'))
  22. ->render();
  23. ?>
  24. <?php echo $this->formElement('text', 'listing_id', $this->listingId)
  25. ->setAttributes(array('placeholder' => $this->_('Listing ID'), 'class' => 'form-control input-default'))
  26. ->render();
  27. ?>
  28. </div>
  29. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  30. ->setAttributes(array('class' => 'btn btn-default'))
  31. ->render();
  32. ?>
  33. </form>
  34. </nav>
  35. <div class="table-responsive">
  36. <table class="table table-striped table-hover">
  37. <caption>
  38. <strong><?php echo $this->paginator->getPages()->totalItemCount; ?></strong> <?php echo $this->_('offers found.'); ?>
  39. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  40. <?php echo $this->_('Showing results'); ?>
  41. <strong><?php echo $this->paginator->getPages()->firstItemNumber; ?></strong>
  42. <?php echo $this->_('to'); ?>
  43. <strong><?php echo $this->paginator->getPages()->lastItemNumber; ?></strong>
  44. <?php } ?>
  45. </caption>
  46. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  47. <thead>
  48. <tr>
  49. <th><?php echo $this->_('Listing'); ?></th>
  50. <th class="size-large"><?php echo $this->_('Last Offer'); ?></th>
  51. <th></th>
  52. </tr>
  53. </thead>
  54. <?php } ?>
  55. <tbody>
  56. <?php
  57. /** @var array $row */
  58. foreach ($this->paginator as $row) {
  59. /** @var \Ppb\Db\Table\Row\Offer $offer */
  60. $offer = $offersService->findBy('id', $row['id']);
  61. /** @var \Ppb\Db\Table\Row\Listing $listing */
  62. $listing = $offer->findParentRow('\Ppb\Db\Table\Listings');
  63. ?>
  64. <tr>
  65. <td>
  66. <?php echo $this->partial('partials/listing-box.phtml', array(
  67. 'listing' => $listing, 'enhanced' => true));
  68. ?>
  69. </td>
  70. <td>
  71. <?php if ($offer['type'] == 'offer') { ?>
  72. <div class="price-offer">
  73. <?php echo $this->amount($offer['amount'], $listing['currency']); ?>
  74. <small>/ <?php echo $this->_('item'); ?></small>
  75. </div>
  76. <?php } ?>
  77. <div>
  78. <strong><?php echo $this->_('Quantity'); ?></strong>:
  79. <?php echo $offer['quantity']; ?>
  80. </div>
  81. <?php if (!empty($offer['product_attributes'])) { ?>
  82. <div>
  83. <small><?php echo $this->productAttributes($offer->getData('product_attributes'))->display(); ?></small>
  84. </div>
  85. <?php } ?>
  86. <p>
  87. <strong><?php echo $this->_('From:'); ?></strong>
  88. <?php echo $this->userDetails($offer['user_id'])->display(); ?>
  89. </p>
  90. <p>
  91. <?php echo $this->offerStatus($offer, true); ?><br>
  92. <small><?php echo $this->date($offer['created_at']); ?></small>
  93. </p>
  94. <a class="btn btn-default btn-sm"
  95. href="<?php echo $this->url(array('type' => $this->type, 'id' => $offer['topic_id']), 'members-offers-details'); ?>"><?php echo $this->_('View Offers Page'); ?></a>
  96. </td>
  97. <td>
  98. <div class="btn-group-vertical">
  99. <?php if ($offer->canAccept($listing)) { ?>
  100. <a class="btn btn-sm btn-success confirm-box"
  101. href="<?php echo $this->url(array('action' => 'accept', 'id' => $offer['id']),
  102. null,
  103. true); ?>"
  104. title="<?php echo $this->_('Accept Offer'); ?>"
  105. data-message="<?php echo $this->_('Are you sure you want to accept this offer?'); ?>">
  106. <i class="fa fa-check"></i>
  107. </a>
  108. <?php } ?>
  109. <?php if ($offer->canCounter($listing)) { ?>
  110. <a class="btn btn-sm btn-counter confirm-box"
  111. href="<?php echo $this->url(array('action' => 'counter', 'type' => $this->type, 'id' => $offer['id']),
  112. 'members-offers-counter'); ?>"
  113. title="<?php echo $this->_('Counteroffer'); ?>"
  114. data-message="<?php echo $this->_('Are you sure you want to make a counteroffer?'); ?>">
  115. <i class="fa fa-arrows-h"></i>
  116. </a>
  117. <?php } ?>
  118. <?php if ($offer->canDecline()) { ?>
  119. <a class="btn btn-sm btn-danger confirm-box"
  120. href="<?php echo $this->url(array('action' => 'decline', 'id' => $offer['id']), null,
  121. true); ?>"
  122. title="<?php echo $this->_('Decline Offer'); ?>"
  123. data-message="<?php echo $this->_('Are you sure you want to decline this offer?'); ?>">
  124. <i class="fa fa-ban"></i>
  125. </a>
  126. <?php } ?>
  127. <?php if ($offer->canWithdraw()) { ?>
  128. <a class="btn btn-sm btn-warning confirm-box"
  129. href="<?php echo $this->url(array('action' => 'withdraw', 'id' => $offer['id']), null,
  130. true); ?>"
  131. title="<?php echo $this->_('Withdraw Offer'); ?>"
  132. data-message="<?php echo $this->_('Are you sure you want to withdraw this offer?'); ?>">
  133. <i class="fa fa-times"></i>
  134. </a>
  135. <?php } ?>
  136. </div>
  137. </td>
  138. </tr>
  139. <?php } ?>
  140. </tbody>
  141. </table>
  142. </div>
  143. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>