offers.phtml 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. <?php
  2. /**
  3. * @version 7.7
  4. */
  5. if ($listing->countDependentRowset('\Ppb\Db\Table\Offers') > 0) {
  6. $offers = $listing->getOffers();
  7. ?>
  8. <table class="table table-striped">
  9. <thead>
  10. <tr>
  11. <th><?php echo $this->_('User'); ?></th>
  12. <th><?php echo $this->_('Amount'); ?></th>
  13. <th><?php echo $this->_('Status'); ?></th>
  14. <th><?php echo $this->_('Quantity'); ?></th>
  15. <th><?php echo $this->_('Date'); ?></th>
  16. </tr>
  17. </thead>
  18. <tbody>
  19. <?php foreach ($offers as $offer) {
  20. $class = null;
  21. $class = ($offer['status'] == 'accepted') ? 'success' : $class;
  22. $class = ($offer['status'] == 'declined') ? 'error' : $class;
  23. ?>
  24. <tr<?php echo ($class !== null) ? ' class="' . $class . '"' : ''; ?>>
  25. <td><?php echo $this->userDetails()->setUser($offer->findParentRow('\Ppb\Db\Table\Users'))->display($listing['private_auction']); ?></td>
  26. <td><?php echo $this->amount($offer['amount'], $listing['currency']); ?></td>
  27. <td><?php echo $this->offerStatus($offer); ?></td>
  28. <td><?php echo $offer['quantity']; ?></td>
  29. <td><?php echo $this->date($offer['created_at']); ?></td>
  30. </tr>
  31. <?php } ?>
  32. </tbody>
  33. </table>
  34. <?php }
  35. else { ?>
  36. <div>
  37. <?php echo $this->_('There are no offers posted on this listing.'); ?>
  38. </div>
  39. <?php } ?>