map_overview.php 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136
  1. <?php /** @noinspection PhpUnhandledExceptionInspection */
  2. /**
  3. * @var Customer[] $customers
  4. * @var Project[] $projects
  5. */
  6. ?>
  7. <div class="container mt-3 py-4">
  8. <input type="hidden" id="submit" value="<?=$_SESSION["csrf_token"]?>" />
  9. <h2>Map Overview</h2>
  10. <div class="row">
  11. <div class="col-lg-6">
  12. <div class="form-group">
  13. <label for="location">Location</label>
  14. <input type="text" class="form-control" id="location" placeholder="Type location" data-autocomplete="map" />
  15. <div class="help-text text-muted">
  16. <small>Type location and select to jump to location.</small>
  17. </div>
  18. </div>
  19. </div>
  20. <div class="col-6 col-lg-3">
  21. <div class="form-group">
  22. <label for="min-date">Min Test Date</label>
  23. <input type="date" class="form-control" id="min-date" placeholder="Type date" />
  24. </div>
  25. </div>
  26. <div class="col-6 col-lg-3">
  27. <div class="form-group">
  28. <label for="max-date">Max Test Date</label>
  29. <input type="date" class="form-control" id="max-date" placeholder="Type date" />
  30. </div>
  31. </div>
  32. </div>
  33. <div class="form-row mb-4">
  34. <div class="col-md">
  35. <div class="mb-4" id="map" data-maps data-lat="51.3555177" data-lng="-1.1743197" data-zoom="7" style="height: 512px;"></div>
  36. </div>
  37. <div class="col-md-auto text-nowrap small">
  38. <h5>Legend</h5>
  39. <?php
  40. View::include("legend_locations");
  41. ?>
  42. <div class="mb-3">
  43. <strong>Testers (Last Test)</strong>
  44. <div><i class="fa fa-fw fa-square text-success"></i> &lt; 30 days ago</div>
  45. <div><i class="fa fa-fw fa-square text-warning"></i> &lt; 60 days ago</div>
  46. <div><i class="fa fa-fw fa-square text-secondary"></i> &lt; 90 days ago</div>
  47. <div><i class="fa fa-fw fa-square text-danger"></i> &gt; 90 days ago or never</div>
  48. </div>
  49. </div>
  50. </div>
  51. <div class="row">
  52. <div class="col-md mb-3">
  53. <h3>Testers</h3>
  54. <div class="list-group mb-3">
  55. <a class="list-group-item list-group-item-action d-flex justify-content-between" data-all-addresses data-selected="false">
  56. <div>
  57. All Tester Addresses
  58. </div>
  59. <span class="badge badge-pill badge-lg align-self-center"></span>
  60. </a>
  61. </div>
  62. <h3>Customers</h3>
  63. <div class="list-group d-block">
  64. <?php
  65. foreach($customers as $customer) {
  66. ?>
  67. <a class="list-group-item list-group-item-action d-flex justify-content-between" data-customer-id="<?=$customer->id?>" data-selected="false">
  68. <div>
  69. <?=htmlspecialchars($customer->name)?><br />
  70. <small></small>
  71. </div>
  72. <span class="badge badge-pill badge-lg align-self-center"></span>
  73. </a>
  74. <?php
  75. }
  76. ?>
  77. </div>
  78. </div>
  79. <div class="col-md mb-3">
  80. <h3>Current/Future Projects</h3>
  81. <div class="form-group">
  82. <input class="form-control" type="search" value="" placeholder="<?=htmlspecialchars(__("Type filter"))?>" data-filter-target="#project-list" />
  83. </div>
  84. <div id="project-list" class="list-group d-block limit-height-2">
  85. <?php
  86. foreach($projects as $project) {
  87. $customer = $project->getCustomer();
  88. $unix_deadline = strtotime($project->dts_deadline . " UTC");
  89. $deadline = date("d/m/Y", $unix_deadline);
  90. $icon = null;
  91. if(!$project->isAnytime()) {
  92. $icon = $project->getTimeOfDayIcon();
  93. }
  94. $filter_value = mb_strtolower($customer->name . $project->name);
  95. ?>
  96. <a class="list-group-item list-group-item-action" data-project-id="<?=$project->id?>" data-selected="false" data-filter-value="<?=htmlspecialchars($filter_value)?>">
  97. <div class="w-100">
  98. <div class="d-flex justify-content-between">
  99. <small><strong><?=strtoupper(htmlspecialchars($customer->name))?></strong></small>
  100. <small><strong>DEADLINE: <?=$deadline?></strong></small>
  101. </div>
  102. <?=htmlspecialchars($project->name)?>
  103. <?php
  104. if($icon) {
  105. ?>
  106. <i class="fal fa-<?=$icon?>"></i>
  107. <?php
  108. }
  109. ?>
  110. </div>
  111. <span class="badge badge-pill badge-lg align-self-center"></span>
  112. </a>
  113. <?php
  114. }
  115. ?>
  116. </div>
  117. </div>
  118. </div>
  119. </div>