locations_table.php 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. /**
  4. * @var Location[] $locations
  5. */
  6. ?>
  7. <table class="table table-bordered table-hover mb-3">
  8. <colgroup>
  9. <col style="width: 20%"/>
  10. <col style="width: 30%"/>
  11. <col style="width: 30%"/>
  12. <col style="width: 20%"/>
  13. </colgroup>
  14. <thead>
  15. <tr>
  16. <th><?=htmlspecialchars(__("ID"))?></th>
  17. <th><?=htmlspecialchars(__("Customer"))?></th>
  18. <th><?=htmlspecialchars(__("Name"))?></th>
  19. <th><?=htmlspecialchars(__("Actions"))?></th>
  20. </tr>
  21. </thead>
  22. <tbody>
  23. <?php
  24. foreach($locations as $location) {
  25. $customer = $location->getCustomer();
  26. ?>
  27. <tr>
  28. <td class="text-end"><?=$location->id?></td>
  29. <td>
  30. <a href="<?=htmlspecialchars($customer->getUrl())?>">
  31. <?=htmlspecialchars($customer->name)?>
  32. </a>
  33. </td>
  34. <td>
  35. <?=htmlspecialchars($location->name)?>
  36. </td>
  37. <td class="p-1">
  38. <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($location->getUrl())?>/update">
  39. <?=htmlspecialchars(__("Update"))?>
  40. </a>
  41. </td>
  42. </tr>
  43. <?php
  44. }
  45. ?>
  46. </tbody>
  47. </table>