1
0

map_overview.php 5.7 KB

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