|
@@ -1,38 +1,132 @@
|
|
|
<div class="container mt-3 py-4">
|
|
<div class="container mt-3 py-4">
|
|
|
|
|
|
|
|
- <h2>Tests</h2>
|
|
|
|
|
|
|
+ <h2>Completed Tests</h2>
|
|
|
|
|
|
|
|
<?php
|
|
<?php
|
|
|
|
|
|
|
|
if(empty($tests)) {
|
|
if(empty($tests)) {
|
|
|
?>
|
|
?>
|
|
|
<div class="alert alert-info">
|
|
<div class="alert alert-info">
|
|
|
- No tests have been completed for your location yet.
|
|
|
|
|
|
|
+ You have not completed any tests yet.
|
|
|
</div>
|
|
</div>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
else {
|
|
else {
|
|
|
?>
|
|
?>
|
|
|
- <div class="list-group">
|
|
|
|
|
- <?php
|
|
|
|
|
- foreach($tests as $test) {
|
|
|
|
|
- $location = $test->getLocation();
|
|
|
|
|
- ?>
|
|
|
|
|
- <div class="list-group-item">
|
|
|
|
|
- <div class="row">
|
|
|
|
|
- <div class="col-md">
|
|
|
|
|
- <?=htmlspecialchars($location->name)?><br />
|
|
|
|
|
- <?=htmlspecialchars($location->getDisplayAddress())?>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="col-auto align-self-center">
|
|
|
|
|
- <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>" title="View Results" data-toggle="tooltip"><i class="fal fa-search"></i></a>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+
|
|
|
|
|
+ <div class="row">
|
|
|
|
|
+ <div class="col-sm text-center text-sm-left align-self-center mb-3">
|
|
|
|
|
+ <?=htmlspecialchars($pagination_object->rangeText)?>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <div class="col-sm-auto mb-3">
|
|
|
<?php
|
|
<?php
|
|
|
- }
|
|
|
|
|
- ?>
|
|
|
|
|
|
|
+ View::include("pagination");
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+
|
|
|
|
|
+ <table class="table table-sm table-hover">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th class="text-right">ID</th>
|
|
|
|
|
+ <th>Location</th>
|
|
|
|
|
+ <th>Attire</th>
|
|
|
|
|
+ <th>Selfie</th>
|
|
|
|
|
+ <th>Date</th>
|
|
|
|
|
+ <th>Time</th>
|
|
|
|
|
+ <th>Duration</th>
|
|
|
|
|
+ <th>Status</th>
|
|
|
|
|
+ <th>Fee</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody>
|
|
|
|
|
+ <?php
|
|
|
|
|
+
|
|
|
|
|
+ $original_timezone = date_default_timezone_get();
|
|
|
|
|
+
|
|
|
|
|
+ foreach($tests as $test) {
|
|
|
|
|
+ $location = $test->getLocation();
|
|
|
|
|
+ $project = $test->getProject();
|
|
|
|
|
+
|
|
|
|
|
+ $attire = $date_start = $time_start = $duration = "N/A";
|
|
|
|
|
+ $attire_class = $date_start_class = $time_start_class = $duration_class = $fee_class = "text-muted";
|
|
|
|
|
+
|
|
|
|
|
+ date_default_timezone_set("UTC");
|
|
|
|
|
+ if($test->dts_start) {
|
|
|
|
|
+ $start_dt = new DateTime($test->dts_start);
|
|
|
|
|
+ $date_start = $start_dt->format("d/m/Y");
|
|
|
|
|
+ $time_start = $start_dt->format("H:i:s");
|
|
|
|
|
+ $attire = $test->attire;
|
|
|
|
|
+
|
|
|
|
|
+ $attire_class = $date_start_class = $time_start_class = "";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($test->dts_start && $test->dts_end) {
|
|
|
|
|
+ $end_dt = new DateTime($test->dts_end);
|
|
|
|
|
+ $diff = $start_dt->diff($end_dt, true);
|
|
|
|
|
+ $duration = $diff->format("%H:%I:%S");
|
|
|
|
|
+ $duration_class = "";
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ date_default_timezone_set($original_timezone);
|
|
|
|
|
+
|
|
|
|
|
+ $status_class = $test->getStatusClass();
|
|
|
|
|
+ $status_text = $test->getStatusText();
|
|
|
|
|
+
|
|
|
|
|
+ $status_class = "secondary";
|
|
|
|
|
+ $status_text = "Pending";
|
|
|
|
|
+
|
|
|
|
|
+ if($test->status == Test::STATUS_CANCELLED) {
|
|
|
|
|
+ $status_class = "danger";
|
|
|
|
|
+ $status_text = "Rejected";
|
|
|
|
|
+ $fee = "N/A";
|
|
|
|
|
+ }
|
|
|
|
|
+ if($test->status == Test::STATUS_COMPLETED) {
|
|
|
|
|
+ $status_class = "success";
|
|
|
|
|
+ $status_text = "Accepted";
|
|
|
|
|
+ $fee = $test->fee ? $test->fee : $project->default_tester_fee;
|
|
|
|
|
+ $fee = "£" . $fee;
|
|
|
|
|
+ $fee_class = "";
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ ?>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <td class="text-right">
|
|
|
|
|
+ <?=$test->id?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <?=htmlspecialchars($location->name)?><br />
|
|
|
|
|
+ <small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city", "postal_code"]))?></small>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="<?=$attire_class?>">
|
|
|
|
|
+ <?=htmlspecialchars($attire)?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="align-middle">
|
|
|
|
|
+ <a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>/selfie">View</a>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle <?=$date_start_class?>">
|
|
|
|
|
+ <?=htmlspecialchars($date_start)?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle <?=$time_start_class?>">
|
|
|
|
|
+ <?=htmlspecialchars($time_start)?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle <?=$duration_class?>">
|
|
|
|
|
+ <?=htmlspecialchars($duration)?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle">
|
|
|
|
|
+ <span class="badge badge-lg badge-<?=$status_class?>"><?=htmlspecialchars($status_text)?></span>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ <td class="text-center align-middle <?=$fee_class?>">
|
|
|
|
|
+ <?=$fee?>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ <?php
|
|
|
|
|
+ }
|
|
|
|
|
+ ?>
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
<?php
|
|
<?php
|
|
|
}
|
|
}
|
|
|
|
|
|