1
0

locations.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace App;
  3. use App\Helpers\HtmlHelper;
  4. /**
  5. * @var Location[] $locations
  6. * @var Pagination $pagination
  7. * @var int $customer_id
  8. * @var int $location_id
  9. * @var string $name
  10. */
  11. ?>
  12. <div class="mb-3">
  13. <h3><?=htmlspecialchars(__("Locations"))?></h3>
  14. </div>
  15. <div class="card mb-3">
  16. <div class="card-header">
  17. <?=htmlspecialchars(__("Filters"))?>
  18. </div>
  19. <div class="card-body">
  20. <form action="/locations" method="get">
  21. <div class="row">
  22. <div class="col-sm-4">
  23. <div class="mb-3">
  24. <label class="form-label" for="customer-id"><?= htmlspecialchars(__("Customer")) ?></label>
  25. <select class="form-select" name="customer_id" id="customer-id">
  26. <option value=""><?= htmlspecialchars(__("Any Customer")) ?></option>
  27. <?php
  28. HtmlHelper::renderOptions(Customer::getOptions(), $customer_id);
  29. ?>
  30. </select>
  31. </div>
  32. </div>
  33. <div class="col-sm-4">
  34. <?php
  35. View::include("components/location_id_field", compact("location_id"));
  36. ?>
  37. </div>
  38. <div class="col-sm-4">
  39. <div class="mb-3">
  40. <label class="form-label" for="name"><?= htmlspecialchars(__("Name")) ?></label>
  41. <input class="form-control" type="text" name="name" id="name"
  42. placeholder="<?= htmlspecialchars(__("Type name")) ?>" value="<?=htmlspecialchars($name)?>" />
  43. </div>
  44. </div>
  45. </div>
  46. <button class="btn btn-primary" type="submit">
  47. <?=htmlspecialchars(__("Submit"))?>
  48. </button>
  49. </form>
  50. </div>
  51. </div>
  52. <?php
  53. if(empty($locations)) {
  54. ?>
  55. <div class="alert alert-info">
  56. <i class="fa fa-fw fa-info-circle"></i>
  57. <?=htmlspecialchars(__("No locations to display."))?>
  58. </div>
  59. <?php
  60. }
  61. else {
  62. ?>
  63. <div class="mb-3" id="map" style="height: 480px;" data-locations-page="true">
  64. </div>
  65. <?php
  66. View::include("locations_table", compact("locations", "pagination"));
  67. $pagination->render();
  68. }