|
@@ -1,4 +1,26 @@
|
|
|
-<div class="container pt-3 my-4">
|
|
|
|
|
|
|
+<?php
|
|
|
|
|
+$tabs = [
|
|
|
|
|
+ ["details", "Details"],
|
|
|
|
|
+ ["photos", "Photos"],
|
|
|
|
|
+ ["tests", "Tests"],
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+$details = [
|
|
|
|
|
+ "Name" => htmlspecialchars($location->name),
|
|
|
|
|
+ "Address" => htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "county", "postal_code"])),
|
|
|
|
|
+];
|
|
|
|
|
+
|
|
|
|
|
+if($location->shop_left) $details["Shop Name (Left)"] = $location->shop_left;
|
|
|
|
|
+if($location->shop_right) $details["Shop Name (Right)"] = $location->shop_right;
|
|
|
|
|
+if($location->legal_entity_name) $details["Legal Entity Name"] = $location->legal_entity_name;
|
|
|
|
|
+if($location->region) $details["Region"] = $location->region;
|
|
|
|
|
+if($location->internal_id) $details["Internal ID"] = $location->internal_id;
|
|
|
|
|
+if($location->area_manager) $details["Area Manager"] = $location->area_manager;
|
|
|
|
|
+
|
|
|
|
|
+$photos = $location->getPhotos();
|
|
|
|
|
+
|
|
|
|
|
+?>
|
|
|
|
|
+<div class="container mt-3 py-4">
|
|
|
<div class="row">
|
|
<div class="row">
|
|
|
<div class="col">
|
|
<div class="col">
|
|
|
<h2>
|
|
<h2>
|
|
@@ -10,71 +32,134 @@
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <p><?=htmlspecialchars($location->getDisplayAddress())?></p>
|
|
|
|
|
-
|
|
|
|
|
- <h3>Tests</h3>
|
|
|
|
|
|
|
|
|
|
|
|
+ <ul class="nav nav-tabs mb-3" id="location-tabs" role="tablist">
|
|
|
<?php
|
|
<?php
|
|
|
- if(empty($tests)) {
|
|
|
|
|
|
|
+ foreach($tabs as $index => $tab_options) {
|
|
|
|
|
+ list($id, $display) = $tab_options;
|
|
|
|
|
+ $active = ($index == 0) ? "active" : "";
|
|
|
?>
|
|
?>
|
|
|
- <div class="alert alert-info">
|
|
|
|
|
- This location has no tests.
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link <?=$active?>" id="<?=$id?>-tab" data-toggle="tab" href="#<?=$id?>" role="tab"><?=htmlspecialchars($display)?></a>
|
|
|
|
|
+ </li>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
- else {
|
|
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </ul>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="tab-content mb-3" id="tab-content">
|
|
|
|
|
+ <div class="tab-pane fade show active" id="details" role="tabpanel" aria-labelledby="details-tab">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-lg-8 mb-3 mb-lg-0">
|
|
|
|
|
+ <div class="list-group">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($details as $field => $value) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="list-group-item">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-sm-4 text-muted"><?=$field?></div>
|
|
|
|
|
+ <div class="col-sm"><?=$value?></div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-lg mb-3 mb-lg-0">
|
|
|
|
|
+ <div class="mb-3" id="map" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="17" data-marker="true" style="height: 320px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="tab-pane fade" id="photos" role="tabpanel" aria-labelledby="photos-tab">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($photos)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">
|
|
|
|
|
+ <i class="fal fa-fw fa-info-circle"></i> No photos are available for this location.
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($photos as $photo) {
|
|
|
|
|
+ $uri = "/account/locations/$location->id/photos/$photo->id";
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="col-md-4">
|
|
|
|
|
+ <a href="<?=$uri?>">
|
|
|
|
|
+ <img class="border img-fluid img-contain" src="/img/blank_4_3.png" style="background-image: url(<?=$uri?>)" />
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
?>
|
|
?>
|
|
|
- <table class="table table-hover">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th>ID</th>
|
|
|
|
|
- <th>Project</th>
|
|
|
|
|
- <th>Status</th>
|
|
|
|
|
- <th></th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="tab-pane fade" id="tests" role="tabpanel" aria-labelledby="tests-tab">
|
|
|
<?php
|
|
<?php
|
|
|
- foreach($tests as $test) {
|
|
|
|
|
- $project = $test->getProject();
|
|
|
|
|
|
|
+ if(empty($tests)) {
|
|
|
?>
|
|
?>
|
|
|
- <tr>
|
|
|
|
|
- <td class="text-right align-middle">
|
|
|
|
|
- <?=$test->id?>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <a href=""><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <span class="badge badge-lg badge-<?=$test->getStatusClass()?>"><?=htmlspecialchars($test->getStatusText())?></span>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="text-right">
|
|
|
|
|
|
|
+ <div class="alert alert-info">
|
|
|
|
|
+ This location has no tests.
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <table class="table table-hover">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>ID</th>
|
|
|
|
|
+ <th>Project</th>
|
|
|
|
|
+ <th>Status</th>
|
|
|
|
|
+ <th></th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
<?php
|
|
<?php
|
|
|
- if($test->status >= Test::STATUS_PENDING_VERIFICATION) {
|
|
|
|
|
|
|
+ foreach($tests as $test) {
|
|
|
|
|
+ $project = $test->getProject();
|
|
|
?>
|
|
?>
|
|
|
- <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View Results</a>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ?>
|
|
|
|
|
- <a class="btn btn-outline-primary" href="/account/projects/<?=$test->project_id?>">View Project</a>
|
|
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td class="text-right align-middle">
|
|
|
|
|
+ <?=$test->id?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <a href=""><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <span class="badge badge-lg badge-<?=$test->getStatusClass()?>"><?=htmlspecialchars($test->getStatusText())?></span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-right">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if($test->status >= Test::STATUS_PENDING_VERIFICATION) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View Results</a>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <a class="btn btn-outline-primary" href="/account/projects/<?=$test->project_id?>">View Project</a>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
?>
|
|
?>
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
?>
|
|
?>
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
-
|
|
|
|
|
- <h3>Map</h3>
|
|
|
|
|
-
|
|
|
|
|
- <div class="mb-3" id="map" data-maps data-lat="<?=$location->latitude?>" data-lng="<?=$location->longitude?>" data-zoom="17" data-marker="true" style="height: 320px;">
|
|
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|