sales_table.php 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. namespace App;
  3. /**
  4. * @var Sale[] $sales
  5. */
  6. $core = Core::getInstance();
  7. $user = $core->getUser();
  8. ?>
  9. <table class="table table-bordered table-hover mb-3">
  10. <colgroup>
  11. <col style="width: 1%"/>
  12. <col style="width: 55%"/>
  13. <col style="width: 15%"/>
  14. <col style="width: 15%"/>
  15. <col style="width: 15%"/>
  16. <col style="width: 1%"/>
  17. </colgroup>
  18. <thead>
  19. <tr>
  20. <th><?=htmlspecialchars(__("No."))?></th>
  21. <th><?=htmlspecialchars(__("Location"))?></th>
  22. <th><?=htmlspecialchars(__("Date"))?></th>
  23. <th><?=htmlspecialchars(__("Status"))?></th>
  24. <th><?=htmlspecialchars(__("Predicted Sold Date"))?></th>
  25. <th><?=htmlspecialchars(__("Actions"))?></th>
  26. </tr>
  27. </thead>
  28. <tbody>
  29. <?php
  30. foreach($sales as $sale) {
  31. $location = $sale->getLocation();
  32. ?>
  33. <tr>
  34. <td class="text-end">
  35. <a href="<?=htmlspecialchars($sale->getUrl())?>"><?=htmlspecialchars($sale->getNumber())?></a>
  36. </td>
  37. <td>
  38. <a href="<?=htmlspecialchars($location->getUrl())?>">
  39. <?=htmlspecialchars($location->getDisplayName())?>
  40. </a>
  41. </td>
  42. <td>
  43. <?=htmlspecialchars($user->formatDate($sale->getDateTimeCreated()))?>
  44. </td>
  45. <td>
  46. <?=htmlspecialchars($sale->getDisplayStatus())?>
  47. </td>
  48. <td>
  49. <?=htmlspecialchars($sale->getDisplayPredictedSoldDate())?>
  50. </td>
  51. <td class="p-1">
  52. <a class="btn btn-sm btn-primary" href="<?=htmlspecialchars($sale->getUrl())?>">
  53. <?=htmlspecialchars(__("View"))?>
  54. </a>
  55. </td>
  56. </tr>
  57. <?php
  58. }
  59. ?>
  60. </tbody>
  61. </table>