sales_table.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. /**
  4. * @var Sale[] $sales
  5. */
  6. ?>
  7. <table class="table table-bordered table-hover mb-3">
  8. <thead>
  9. <tr>
  10. <th><?=htmlspecialchars(__("Number"))?></th>
  11. <th><?=htmlspecialchars(__("Location"))?></th>
  12. <th><?=htmlspecialchars(__("Status"))?></th>
  13. <th><?=htmlspecialchars(__("Actions"))?></th>
  14. </tr>
  15. </thead>
  16. <tbody>
  17. <?php
  18. foreach($sales as $sale) {
  19. $location = $sale->getLocation();
  20. ?>
  21. <tr>
  22. <td class="text-end">
  23. <a href="<?=htmlspecialchars($sale->getUrl())?>"><?=htmlspecialchars($sale->getNumber())?></a>
  24. </td>
  25. <td>
  26. <a href="<?=htmlspecialchars($location->getUrl())?>">
  27. <?=htmlspecialchars($location->getDisplayName())?>
  28. </a>
  29. </td>
  30. <td>
  31. <?=htmlspecialchars($sale->getDisplayStatus())?>
  32. </td>
  33. <td class="p-1">
  34. <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($sale->getUrl())?>">
  35. <?=htmlspecialchars(__("View"))?>
  36. </a>
  37. </td>
  38. </tr>
  39. <?php
  40. }
  41. ?>
  42. </tbody>
  43. </table>