| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150 |
- <div class="container mt-3 py-4">
- <h2><?=htmlspecialchars(_("Completed Tests"))?></h2>
- <?php
- if(empty($tests)) {
- ?>
- <div class="alert alert-info">
- <?=htmlspecialchars(_("You have not completed any tests yet."))?>
- </div>
- <?php
- }
- else {
- ?>
- <div class="mb-3">
- <?php
- View::include("pagination", compact("pagination_object"));
- ?>
- </div>
- <?php
- if(!Core::$user->getInvoiceAddress()) {
- ?>
- <div class="alert alert-warning">
- <i class="fal fa-fw fa-exclamation-triangle"></i>
- <?=sprintf(htmlspecialchars(_("You have multiple addresses. %sClick here%s to manage your addresses and set one as the invoice address to enable the invoice link.")), '<a href="/account/addresses">', '</a>')?>
- </div>
- <?php
- }
- if(!Core::$user->hasValidPaymentMethod()) {
- ?>
- <div class="alert alert-warning">
- <i class="fal fa-fw fa-exclamation-triangle"></i>
- <?=sprintf(htmlspecialchars(_("You have no valid payment method. %sClick here%s and verify your payment method settings are correct to enable the invoice link.")), '<a href="/account/settings">', '</a>')?>
- </div>
- <?php
- }
- ?>
- <div class="list-group">
- <?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("jS 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(_("%i min. %S sec."));
- $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 = "";
- }
- ?>
- <div class="list-group-item list-group-item-action">
- <div class="row">
- <div class="col-xl">
- <div class="row">
- <div class="col order-1 order-sm-1">
- <strong><?=htmlspecialchars(_("ID:"))?> <?=$test->id?></strong><br />
- <?php
- if($test->status == Test::STATUS_COMPLETED && $can_invoice) {
- ?>
- <a href="#" data-toggle="modal" data-target="#modal-test-invoice" data-invoice data-id="<?=$test->id?>">
- <i class="fal fa-fw fa-external-link"></i> <?=htmlspecialchars(_("Invoice"))?>
- </a>
- <?php
- }
- ?>
- </div>
- <div class="col-sm order-3 order-sm-2">
- <hr class="d-block d-sm-none" />
- <?=htmlspecialchars($location->name)?><br />
- <small><?=htmlspecialchars($location->getDisplayAddress(["city", "postal_code"]))?></small>
- </div>
- <div class="col order-2 order-sm-3 text-right text-xl-center align-self-xl-center">
- <span class="badge badge-lg badge-<?=$status_class?>"><?=htmlspecialchars($status_text)?></span>
- </div>
- </div>
- <hr class="d-none d-sm-block d-xl-none" />
- </div>
- <div class="col-xl align-self-xl-center">
- <div class="row">
- <div class="col-sm <?=$date_start_class?> align-self-xl-center">
- <hr class="d-block d-sm-none" />
- <strong><?=htmlspecialchars($date_start)?></strong><br />
- <small><?=htmlspecialchars($time_start)?> / <?=htmlspecialchars($duration)?></small>
- </div>
- <div class="col-sm <?=$fee_class?> align-self-xl-center">
- <hr class="d-block d-sm-none" />
- <?=htmlspecialchars(_("Fee:"))?> <?=$fee?>
- </div>
- <div class="col-sm <?=$attire_class?> align-self-xl-center">
- <hr class="d-block d-sm-none" />
- <?=htmlspecialchars($attire)?><br />
- <a href="/account/tests/<?=$test->id?>/selfie"><?=htmlspecialchars(_("View selfie."))?></a>
- </div>
- </div>
- </div>
- </div>
- </div>
- <?php
- }
- ?>
- </div>
- <div class="mt-3">
- <?php
- View::include("pagination", compact("pagination_object"));
- ?>
- </div>
- <?php
- }
- ?>
- </div>
|