|
@@ -54,198 +54,276 @@ var userId = <?=$user->id?>;
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md-8 col-lg-8 col-xl-9 mb-4">
|
|
|
|
|
- <h3>General Details</h3>
|
|
|
|
|
|
|
+ <ul class="nav nav-tabs mb-3" id="user-tab" role="tablist">
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link active" id="general-details-tab" data-toggle="tab" href="#general-details" role="tab" aria-controls="general-details" aria-selected="true">General Details</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="addresses-tab" data-toggle="tab" href="#addresses" role="tab" aria-controls="addresses" aria-selected="true">Addresses</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="tests-tab" data-toggle="tab" href="#tests" role="tab" aria-controls="tests" aria-selected="true">Tests</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ <li class="nav-item">
|
|
|
|
|
+ <a class="nav-link" id="nearby-locations-tab" data-toggle="tab" href="#nearby-locations" role="tab" aria-controls="nearby-locations" aria-selected="true">Nearby Locations</a>
|
|
|
|
|
+ </li>
|
|
|
|
|
+ </ul>
|
|
|
|
|
|
|
|
- <div class="list-group">
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach($details as $title => $html) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="list-group-item">
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-sm">
|
|
|
|
|
- <?=htmlspecialchars($title)?>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-sm-auto">
|
|
|
|
|
- <?=$html?>
|
|
|
|
|
|
|
+ <div class="tab-content" id="user-tab-content">
|
|
|
|
|
+ <div class="tab-pane fade show active" id="general-details" role="tabpanel" aria-labelledby="general-details-tab">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-md-8 col-lg-8 col-xl-9 mb-4">
|
|
|
|
|
+ <h3>General Details</h3>
|
|
|
|
|
+
|
|
|
|
|
+ <div class="list-group">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($details as $title => $html) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="list-group-item">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-sm">
|
|
|
|
|
+ <?=htmlspecialchars($title)?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-sm-auto">
|
|
|
|
|
+ <?=$html?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md mb-4">
|
|
|
|
|
+ <h3>Photo / ID</h3>
|
|
|
|
|
+ <div class="card mb-3">
|
|
|
|
|
+ <div class="card-body text-center">
|
|
|
|
|
+ <a href="/account/users/<?=$user->id?>/photo">
|
|
|
|
|
+ <img class="img-fluid" src="/account/users/<?=$user->id?>/photo" alt="Photo" />
|
|
|
|
|
+ </a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="card">
|
|
|
|
|
+ <div class="card-body text-center">
|
|
|
|
|
+ <a href="/account/users/<?=$user->id?>/id-document">
|
|
|
|
|
+ <img class="img-fluid" src="/account/users/<?=$user->id?>/id-document" alt="ID Document" />
|
|
|
|
|
+ </a>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-md mb-4">
|
|
|
|
|
- <h3>Photo / ID</h3>
|
|
|
|
|
- <div class="card mb-3">
|
|
|
|
|
- <div class="card-body text-center">
|
|
|
|
|
- <a href="/account/users/<?=$user->id?>/photo">
|
|
|
|
|
- <img class="img-fluid" src="/account/users/<?=$user->id?>/photo" alt="Photo" />
|
|
|
|
|
- </a>
|
|
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
- <div class="card">
|
|
|
|
|
- <div class="card-body text-center">
|
|
|
|
|
- <a href="/account/users/<?=$user->id?>/id-document">
|
|
|
|
|
- <img class="img-fluid" src="/account/users/<?=$user->id?>/id-document" alt="ID Document" />
|
|
|
|
|
- </a>
|
|
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="tab-pane fade" id="addresses" role="tabpanel" aria-labelledby="addresses-tab">
|
|
|
|
|
+ <h3>Addresses</h3>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($addresses)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">This user has no addresses.</div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-lg-6 mb-4">
|
|
|
|
|
+ <div class="list-group">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($addresses as $address) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="list-group-item">
|
|
|
|
|
+ <strong><?=htmlspecialchars($address->name)?></strong><br />
|
|
|
|
|
+ <small><?=htmlspecialchars($address->getDisplayAddress())?></small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-lg-6 mb-4">
|
|
|
|
|
+ <div id="map" style="height: 248px;" data-maps data-lat="0" data-lng="0" data-zoom="10"></div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
</div>
|
|
</div>
|
|
|
- </div>
|
|
|
|
|
|
|
+ <div class="tab-pane fade" id="tests" role="tabpanel" aria-labelledby="tests-tab">
|
|
|
|
|
+ <h3>Assigned Tests</h3>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($pending_tests)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">This user has no assigned tests.</div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <table class="table table-sm table-hover">
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <col style="width: 40%;" />
|
|
|
|
|
+ <col style="width: 20%;" />
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <th>ID</th>
|
|
|
|
|
+ <th>Location</th>
|
|
|
|
|
+ <th>Project</th>
|
|
|
|
|
+ <th>Date Due</th>
|
|
|
|
|
+ <th></th>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($pending_tests as $test) {
|
|
|
|
|
+ $project = $test->getProject();
|
|
|
|
|
+ $location = $test->getLocation();
|
|
|
|
|
|
|
|
|
|
+ if(!is_null($test->dts_due)) {
|
|
|
|
|
+ $date = explode(" ", $test->dts_due)[0];
|
|
|
|
|
+ $unix_date = strtotime($date);
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ $date = explode(" ", $project->dts_deadline)[0];
|
|
|
|
|
+ $unix_date = strtotime($date);
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
- <h3>Addresses</h3>
|
|
|
|
|
|
|
+ $date = date("d/m/Y", $unix_date);
|
|
|
|
|
|
|
|
- <?php
|
|
|
|
|
- if(empty($addresses)) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="alert alert-info">This user has no addresses.</div>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-lg-6 mb-4">
|
|
|
|
|
- <div class="list-group">
|
|
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td><?=$test->id?></td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
|
|
|
|
|
+ <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postcode"]))?></small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <?=$date?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle text-right">
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </table>
|
|
|
<?php
|
|
<?php
|
|
|
- foreach($addresses as $address) {
|
|
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+
|
|
|
|
|
+ <h3>Completed Tests</h3>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($completed_tests)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">This user has no completed tests.</div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ else {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <table class="table table-sm table-hover">
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <col style="width: 40%;" />
|
|
|
|
|
+ <col style="width: 20%;" />
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <col style="width: 10%;" />
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <th>ID</th>
|
|
|
|
|
+ <th>Location</th>
|
|
|
|
|
+ <th>Project</th>
|
|
|
|
|
+ <th>Date</th>
|
|
|
|
|
+ <th></th>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($completed_tests as $test) {
|
|
|
|
|
+ $project = $test->getProject();
|
|
|
|
|
+ $location = $test->getLocation();
|
|
|
|
|
+ $date = explode(" ", $test->dts_start)[0];
|
|
|
|
|
+ $date = date("d/m/Y", strtotime($date));
|
|
|
?>
|
|
?>
|
|
|
- <div class="list-group-item">
|
|
|
|
|
- <strong><?=htmlspecialchars($address->name)?></strong><br />
|
|
|
|
|
- <small><?=htmlspecialchars($address->getDisplayAddress())?></small>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td><?=$test->id?></td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
|
|
|
|
|
+ <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postcode"]))?></small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <?=$date?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle text-right">
|
|
|
|
|
+ <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View</a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
?>
|
|
?>
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-lg-6 mb-4">
|
|
|
|
|
- <div id="map" style="height: 248px;" data-maps data-lat="0" data-lng="0" data-zoom="5" data-callback="initialiseAddresses"></div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ </table>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
</div>
|
|
</div>
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
-
|
|
|
|
|
- <h3>Assigned Tests</h3>
|
|
|
|
|
-
|
|
|
|
|
- <?php
|
|
|
|
|
- if(empty($pending_tests)) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="alert alert-info">This user has no assigned tests.</div>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ?>
|
|
|
|
|
- <table class="table table-sm table-hover">
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <col style="width: 40%;" />
|
|
|
|
|
- <col style="width: 20%;" />
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <thead>
|
|
|
|
|
- <th>ID</th>
|
|
|
|
|
- <th>Location</th>
|
|
|
|
|
- <th>Project</th>
|
|
|
|
|
- <th>Date Due</th>
|
|
|
|
|
- <th></th>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach($pending_tests as $test) {
|
|
|
|
|
- $project = $test->getProject();
|
|
|
|
|
- $location = $test->getLocation();
|
|
|
|
|
-
|
|
|
|
|
- if(!is_null($test->dts_due)) {
|
|
|
|
|
- $date = explode(" ", $test->dts_due)[0];
|
|
|
|
|
- $unix_date = strtotime($date);
|
|
|
|
|
|
|
+ <div class="tab-pane fade" id="nearby-locations" role="tabpanel" aria-labelledby="nearby-locations-tab">
|
|
|
|
|
+ <h3>Nearby Locations</h3>
|
|
|
|
|
+
|
|
|
|
|
+ <?php
|
|
|
|
|
+ if(empty($addresses)) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="alert alert-info">This user has no addresses so nearby locations cannot be displayed.</div>
|
|
|
|
|
+ <?php
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
- $date = explode(" ", $project->dts_deadline)[0];
|
|
|
|
|
- $unix_date = strtotime($date);
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ $address = $addresses[0];
|
|
|
|
|
+
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-lg-6 mb-4">
|
|
|
|
|
+ <select class="form-control mb-3" id="address-id">
|
|
|
|
|
+ <?php
|
|
|
|
|
+ foreach($addresses as $address) {
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <option value="<?=$address->id?>"><?=htmlspecialchars($address->name)?> - <?=htmlspecialchars($address->getDisplayAddress())?></option>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </select>
|
|
|
|
|
|
|
|
- $date = date("d/m/Y", $unix_date);
|
|
|
|
|
|
|
+ <div class="list-group" id="nearby-locations-list-group">
|
|
|
|
|
+ </div>
|
|
|
|
|
|
|
|
|
|
+ <div data-nearby-location-list-group-item-template class="list-group-item" style="display: none;" aria-hidden="true">
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-md">
|
|
|
|
|
+ <a href="#" data-location-name>Location Name</a>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-md-auto">
|
|
|
|
|
+ Distance: <span data-location-distance></span>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <span class="badge badge-primary">ID: <span data-location-id>123</span></span>
|
|
|
|
|
+ <span class="badge badge-info">Internal ID: <span data-location-internal-id>123</span></span><br />
|
|
|
|
|
+ <small data-location-address>Address</small>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="col-lg-6 mb-4">
|
|
|
|
|
+ <div id="nearby-locations-map" style="height: 480px;" data-maps data-lat="<?=$address->latitude?>" data-lng="<?=$address->longitude?>" data-zoom="10">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
?>
|
|
?>
|
|
|
- <tr>
|
|
|
|
|
- <td><?=$test->id?></td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
|
|
|
|
|
- <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postcode"]))?></small>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <?=$date?>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle text-right">
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
- </table>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
-
|
|
|
|
|
- <h3>Completed Tests</h3>
|
|
|
|
|
-
|
|
|
|
|
- <?php
|
|
|
|
|
- if(empty($completed_tests)) {
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="alert alert-info">This user has no completed tests.</div>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- else {
|
|
|
|
|
- ?>
|
|
|
|
|
- <table class="table table-sm table-hover">
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <col style="width: 40%;" />
|
|
|
|
|
- <col style="width: 20%;" />
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <col style="width: 10%;" />
|
|
|
|
|
- <thead>
|
|
|
|
|
- <th>ID</th>
|
|
|
|
|
- <th>Location</th>
|
|
|
|
|
- <th>Project</th>
|
|
|
|
|
- <th>Date</th>
|
|
|
|
|
- <th></th>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach($completed_tests as $test) {
|
|
|
|
|
- $project = $test->getProject();
|
|
|
|
|
- $location = $test->getLocation();
|
|
|
|
|
- $date = explode(" ", $test->dts_start)[0];
|
|
|
|
|
- $date = date("d/m/Y", strtotime($date));
|
|
|
|
|
- ?>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <td><?=$test->id?></td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <a href="/account/locations/<?=$location->id?>"><?=htmlspecialchars($location->name)?></a><br />
|
|
|
|
|
- <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postcode"]))?></small>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle">
|
|
|
|
|
- <?=$date?>
|
|
|
|
|
- </td>
|
|
|
|
|
- <td class="align-middle text-right">
|
|
|
|
|
- <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View</a>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
- </table>
|
|
|
|
|
- <?php
|
|
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
|
|
|
|
|
|
|
|
</div>
|
|
</div>
|