post.phtml 2.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <?php
  2. /**
  3. * @version 7.3
  4. */
  5. ?>
  6. <table class="table table-striped">
  7. <caption>
  8. <?php echo $this->_('Please post your feedback for the below selected transactions.'); ?>
  9. </caption>
  10. <thead>
  11. <tr>
  12. <th class="size-mini"><?php echo $this->_('Picture'); ?></th>
  13. <th><?php echo $this->_('Listing Details'); ?></th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php
  18. /** @var \Ppb\Db\Table\Row\Reputation $reputation */
  19. foreach ($this->rowset as $reputation) {
  20. $listingLink = null;
  21. $listingName = null;
  22. if ($reputation['sale_listing_id'] != null) {
  23. /** @var \Ppb\Db\Table\Row\SaleListing $saleListing */
  24. $saleListing = $reputation->findParentRow('\Ppb\Db\Table\SalesListings');
  25. /** @var \Ppb\Db\Table\Row\Listing $listing */
  26. $listing = null;
  27. if ($saleListing) {
  28. $listing = $saleListing->findParentRow('\Ppb\Db\Table\Listings');
  29. }
  30. if ($listing) {
  31. $listingLink = $listing->link();
  32. $listingName = $listing['name'];
  33. }
  34. }
  35. $user = $reputation->findParentRow('\Ppb\Db\Table\Users', 'User');
  36. $userType = null;
  37. switch ($reputation['reputation_type']) {
  38. case \Ppb\Service\Reputation::SALE:
  39. $userType = 'Seller';
  40. break;
  41. case \Ppb\Service\Reputation::PURCHASE:
  42. $userType = 'Buyer';
  43. break;
  44. }
  45. if (empty($listingName)) {
  46. $listingName = ($reputation['listing_name']) ? $reputation['listing_name'] : $this->_('Listing Deleted');
  47. }
  48. ?>
  49. <tr>
  50. <td>
  51. <?php if ($listingLink) { ?>
  52. <a href="<?php echo $this->url($listingLink); ?>">
  53. <?php echo $this->thumbnail($listing->getMainImage(), 68, true,
  54. array('alt' => $listingName)); ?>
  55. </a>
  56. <?php
  57. }
  58. else {
  59. ?>
  60. <?php echo $this->thumbnail(null, 68, true,
  61. array('alt' => $listingName)); ?>
  62. <?php } ?>
  63. </td>
  64. <td>
  65. <?php if ($listingLink) { ?>
  66. <a href="<?php echo $this->url($listingLink); ?>">
  67. <?php echo $listingName; ?>
  68. </a>
  69. <?php
  70. }
  71. else {
  72. ?>
  73. <em><?php echo $listingName; ?></em>
  74. <?php } ?>
  75. <div>
  76. <?php echo $this->_($userType); ?>: <?php echo $this->userDetails()->setUser($user)->display(); ?>
  77. </div>
  78. </td>
  79. </tr>
  80. <?php } ?>
  81. </tbody>
  82. </table>
  83. <?php echo $this->form; ?>