map_overview.php 4.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  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. <section class="mb-4">
  54. <h3>Testers</h3>
  55. <div class="list-group mb-2">
  56. <a class="list-group-item list-group-item-action d-flex justify-content-between" data-all-addresses data-selected="false">
  57. <div>
  58. All Tester Addresses
  59. </div>
  60. <span class="badge badge-pill badge-lg align-self-center"></span>
  61. </a>
  62. </div>
  63. <div class="custom-control custom-switch">
  64. <input class="custom-control-input" id="hide-inactive-testers" type="checkbox" value="1" />
  65. <label class="custom-control-label" for="hide-inactive-testers"><?=htmlspecialchars(__("Hide red markers"))?></label>
  66. </div>
  67. </section>
  68. <h3>Customers</h3>
  69. <div class="list-group d-block">
  70. <?php
  71. foreach($customers as $customer) {
  72. ?>
  73. <a class="list-group-item list-group-item-action d-flex justify-content-between" data-customer-id="<?=$customer->id?>" data-selected="false">
  74. <div>
  75. <?=htmlspecialchars($customer->name)?><br />
  76. <small></small>
  77. </div>
  78. <span class="badge badge-pill badge-lg align-self-center"></span>
  79. </a>
  80. <?php
  81. }
  82. ?>
  83. </div>
  84. </div>
  85. <div class="col-md mb-3">
  86. <h3>Current/Future Projects</h3>
  87. <div class="form-group">
  88. <input class="form-control" type="search" value="" placeholder="<?=htmlspecialchars(__("Type filter"))?>" data-filter-target="#project-list" />
  89. </div>
  90. <div id="project-list" class="list-group d-block limit-height-2">
  91. <?php
  92. foreach($projects as $project) {
  93. $customer = $project->getCustomer();
  94. $unix_deadline = strtotime($project->dts_deadline . " UTC");
  95. $deadline = date("d/m/Y", $unix_deadline);
  96. $icon = null;
  97. if(!$project->isAnytime()) {
  98. $icon = $project->getTimeOfDayIcon();
  99. }
  100. $filter_value = mb_strtolower($customer->name . $project->name);
  101. ?>
  102. <a class="list-group-item list-group-item-action" data-project-id="<?=$project->id?>" data-selected="false" data-filter-value="<?=htmlspecialchars($filter_value)?>">
  103. <div class="w-100">
  104. <div class="d-flex justify-content-between">
  105. <small><strong><?=strtoupper(htmlspecialchars($customer->name))?></strong></small>
  106. <small><strong>DEADLINE: <?=$deadline?></strong></small>
  107. </div>
  108. <?=htmlspecialchars($project->name)?>
  109. <?php
  110. if($icon) {
  111. ?>
  112. <i class="fal fa-<?=$icon?>"></i>
  113. <?php
  114. }
  115. ?>
  116. </div>
  117. <span class="badge badge-pill badge-lg align-self-center"></span>
  118. </a>
  119. <?php
  120. }
  121. ?>
  122. </div>
  123. </div>
  124. </div>
  125. </div>