|
|
@@ -107,6 +107,59 @@ $completed_tests = $user->getCompletedTests();
|
|
|
<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);
|
|
|
+ }
|
|
|
+
|
|
|
+ $date = date("d/m/Y", $unix_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">
|
|
|
+ </td>
|
|
|
+ </tr>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
+ ?>
|
|
|
+ </table>
|
|
|
+ <?php
|
|
|
+ }
|
|
|
?>
|
|
|
|
|
|
<h3>Completed Tests</h3>
|
|
|
@@ -117,6 +170,49 @@ $completed_tests = $user->getCompletedTests();
|
|
|
<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) {
|
|
|
+ $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
|
|
|
+ }
|
|
|
?>
|
|
|
|
|
|
|