sales_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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. <colgroup>
  9. <col style="width: 1%"/>
  10. <col style="width: 50%"/>
  11. <col style="width: 50%"/>
  12. <col style="width: 1%"/>
  13. </colgroup>
  14. <thead>
  15. <tr>
  16. <th><?=htmlspecialchars(__("No."))?></th>
  17. <th><?=htmlspecialchars(__("Location"))?></th>
  18. <th><?=htmlspecialchars(__("Status"))?></th>
  19. <th><?=htmlspecialchars(__("Actions"))?></th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <?php
  24. foreach($sales as $sale) {
  25. $location = $sale->getLocation();
  26. ?>
  27. <tr>
  28. <td class="text-end">
  29. <a href="<?=htmlspecialchars($sale->getUrl())?>"><?=htmlspecialchars($sale->getNumber())?></a>
  30. </td>
  31. <td>
  32. <a href="<?=htmlspecialchars($location->getUrl())?>">
  33. <?=htmlspecialchars($location->getDisplayName())?>
  34. </a>
  35. </td>
  36. <td>
  37. <?=htmlspecialchars($sale->getDisplayStatus())?>
  38. </td>
  39. <td class="p-1">
  40. <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($sale->getUrl())?>">
  41. <?=htmlspecialchars(__("View"))?>
  42. </a>
  43. </td>
  44. </tr>
  45. <?php
  46. }
  47. ?>
  48. </tbody>
  49. </table>