browse.phtml 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. <?php
  2. /**
  3. * @version 7.9 [rev.7.9.01]
  4. */
  5. /** @var boolean $inAdmin */
  6. /** @var string $filter */
  7. /** @var string $listingId */
  8. /** @var string $username */
  9. $formPost = ($inAdmin) ? '' : $this->url(array('action' => 'post'));
  10. ?>
  11. <?php if ($inAdmin) { ?>
  12. <nav class="navbar navbar-filter">
  13. <form class="navbar-form navbar-right"
  14. action="<?php echo $this->url(null, null, true, array('username', 'listingId', 'page', 'submit')); ?>"
  15. method="get">
  16. <div class="form-group">
  17. <?php echo $this->formElement('text', 'listingId', $listingId)
  18. ->setAttributes(array('placeholder' => $this->_('Listing ID'), 'class' => 'form-control input-default'))
  19. ->render();
  20. ?>
  21. <?php echo $this->formElement('text', 'username', $username)
  22. ->setAttributes(array('placeholder' => $this->_('Username'), 'class' => 'form-control input-default'))
  23. ->render();
  24. ?>
  25. </div>
  26. <?php echo $this->formElement('submit', 'submit', $this->_('Search'))
  27. ->setAttributes(array('class' => 'btn btn-default'))
  28. ->render();
  29. ?>
  30. </form>
  31. </nav>
  32. <?php } ?>
  33. <form action="<?php echo $formPost; ?>" method="post">
  34. <?php echo $this->formElement('hidden', 'option', '')->render(); ?>
  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->_('entries 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. <?php if ($filter == 'pending' || $inAdmin === true) { ?>
  50. <th class="size-tiny">
  51. <?php echo $this->formElement('checkbox', 'selectAll')
  52. ->setMultiOptions(array(1 => null))
  53. ->render();
  54. ?>
  55. </th>
  56. <?php } ?>
  57. <th><?php echo $this->_('Feedback'); ?></th>
  58. <th class="size-medium">
  59. <?php echo (in_array($filter, array('pending', 'left'))) ? $this->_('To') : $this->_('From'); ?>
  60. </th>
  61. <?php if ($inAdmin) { ?>
  62. <th class="size-medium">
  63. <?php echo $this->_('To'); ?>
  64. </th>
  65. <?php } ?>
  66. </tr>
  67. </thead>
  68. <?php } ?>
  69. <tbody>
  70. <?php
  71. /** @var \Ppb\Db\Table\Row\Reputation $reputation */
  72. foreach ($this->paginator as $reputation) {
  73. $listingLink = null;
  74. $listingName = null;
  75. $listingImage = null;
  76. if ($reputation['sale_listing_id'] != null) {
  77. /** @var \Ppb\Db\Table\Row\Listing $listing */
  78. $saleListing = $reputation->findParentRow('\Ppb\Db\Table\SalesListings');
  79. $listing = null;
  80. if ($saleListing) {
  81. $listing = $saleListing->findParentRow('\Ppb\Db\Table\Listings');
  82. }
  83. if ($listing) {
  84. $listingLink = $listing->link();
  85. $listingName = $listing['name'];
  86. $listingImage = $listing->getMainImage();
  87. }
  88. }
  89. if (empty($listingName)) {
  90. $listingName = ($reputation['listing_name']) ? $reputation['listing_name'] : $this->_('Listing Deleted');
  91. }
  92. $this->reputation()->setReputation($reputation);
  93. ?>
  94. <tr>
  95. <?php if ($filter == 'pending' || $inAdmin === true) { ?>
  96. <td>
  97. <?php echo $this->formElement('checkbox', 'id')
  98. ->setMultiOptions(array($reputation['id'] => null))
  99. ->setAttributes(array('class' => 'select-all'))
  100. ->setMultiple()
  101. ->render();
  102. ?>
  103. </td>
  104. <?php } ?>
  105. <td>
  106. <div class="row">
  107. <div class="col-xs-2">
  108. <?php echo $this->thumbnail($listingImage, 50, true,
  109. array('alt' => $listingName)); ?>
  110. </div>
  111. <div class="col-xs-10">
  112. <div>
  113. <?php if ($listingLink) { ?>
  114. <a href="<?php echo $this->url($listingLink); ?>">
  115. <?php echo $listingName; ?>
  116. </a>
  117. <?php
  118. }
  119. else {
  120. ?>
  121. <em><?php echo $listingName; ?></em>
  122. <?php } ?>
  123. </div>
  124. <?php if ($reputation['posted']) { ?>
  125. <div>
  126. <?php echo $this->reputation()->score(); ?>
  127. <?php echo $this->reputation()->comments($inAdmin); ?>
  128. </div>
  129. <div>
  130. <small
  131. class="muted"><?php echo $this->date($reputation['updated_at']); ?></small>
  132. </div>
  133. <?php } ?>
  134. </div>
  135. </div>
  136. </td>
  137. <td>
  138. <?php
  139. if ((in_array($filter, array('pending', 'left')))) {
  140. $userKey = 'User';
  141. $userLabel = ($reputation['reputation_type'] == 'sale') ? 'Seller' : 'Buyer';
  142. }
  143. else {
  144. $userKey = 'Poster';
  145. $userLabel = ($reputation['reputation_type'] == 'sale') ? 'Buyer' : 'Seller';
  146. }
  147. /** @var \Ppb\Db\Table\Row\User $user */
  148. $user = $reputation->findParentRow('\Ppb\Db\Table\Users', $userKey);
  149. echo $this->_($userLabel) . ': ' . $this->userDetails()->setUser($user)->display();
  150. ?>
  151. </td>
  152. <?php if ($inAdmin) { ?>
  153. <td>
  154. <?php
  155. if ((in_array($filter, array('pending', 'left')))) {
  156. $userKey = 'Poster';
  157. $userLabel = ($reputation['reputation_type'] == 'sale') ? 'Buyer' : 'Seller';
  158. }
  159. else {
  160. $userKey = 'User';
  161. $userLabel = ($reputation['reputation_type'] == 'sale') ? 'Seller' : 'Buyer';
  162. }
  163. $user = $reputation->findParentRow('\Ppb\Db\Table\Users', $userKey);
  164. echo $userLabel . ': ' . $this->userDetails()->setUser($user)->display();
  165. ?>
  166. </td>
  167. <?php } ?>
  168. </tr>
  169. <?php } ?>
  170. <?php if ($this->paginator->getPages()->totalItemCount) { ?>
  171. <tr>
  172. <td colspan="6">
  173. <div class="btn-group">
  174. <?php if (in_array($filter, array('pending'))) { ?>
  175. <button class="btn btn-default"
  176. value="close"><?php echo $this->_('Leave Feedback'); ?></button>
  177. <?php } ?>
  178. <?php if ($inAdmin) { ?>
  179. <button class="btn btn-default confirm-form" value="delete"
  180. data-message="<?php echo $this->_('Are you sure you want to delete the reputation comments you have selected?'); ?>">
  181. <?php echo $this->_('Delete'); ?>
  182. </button>
  183. <?php } ?>
  184. </div>
  185. </td>
  186. </tr>
  187. <?php } ?>
  188. </tbody>
  189. </table>
  190. </div>
  191. </form>
  192. <?php echo $this->pagination($this->paginator, 'sliding', 'partials/pagination.phtml'); ?>