Kaynağa Gözat

Merge branch 'develop'

Alan Lam 8 yıl önce
ebeveyn
işleme
14f455d1dc
43 değiştirilmiş dosya ile 589 ekleme ve 243 silme
  1. 46 1
      controllers/map_overview_ajax.php
  2. 24 3
      controllers/reports.php
  3. 35 10
      controllers/reports_presentation.php
  4. 2 0
      controllers/test.php
  5. 0 2
      controllers/test_pdf.php
  6. 40 1
      controllers/tests_admin_list.php
  7. 2 0
      controllers/tests_available.php
  8. 12 0
      engine/project.php
  9. 41 1
      engine/test.php
  10. 4 0
      engine/user.php
  11. 23 2
      json/mystery_shop.json
  12. BIN
      psd/bacta.psd
  13. BIN
      psd/g_t_promotions.psd
  14. BIN
      psd/jnc.psd
  15. BIN
      psd/playland.psd
  16. BIN
      psd/praesepe.psd
  17. BIN
      public/img/customer_logos/bacta_logo.png
  18. BIN
      public/img/customer_logos/praesepe_logo.png
  19. BIN
      public/img/markers/bacta_past_due.png
  20. BIN
      public/img/markers/g_t_promotions.png
  21. BIN
      public/img/markers/g_t_promotions_fail.png
  22. BIN
      public/img/markers/g_t_promotions_pass.png
  23. BIN
      public/img/markers/g_t_promotions_past_due.png
  24. BIN
      public/img/markers/g_t_promotions_pending.png
  25. BIN
      public/img/markers/jnc.png
  26. BIN
      public/img/markers/jnc_fail.png
  27. BIN
      public/img/markers/jnc_pass.png
  28. BIN
      public/img/markers/jnc_past_due.png
  29. BIN
      public/img/markers/jnc_pending.png
  30. BIN
      public/img/markers/playland.png
  31. BIN
      public/img/markers/playland_fail.png
  32. BIN
      public/img/markers/playland_pass.png
  33. BIN
      public/img/markers/playland_past_due.png
  34. BIN
      public/img/markers/playland_pending.png
  35. BIN
      public/img/markers/praesepe_past_due.png
  36. 29 2
      public/js/app-map-overview.js
  37. 34 0
      template_processing/age_verification/test_pdf.php
  38. 25 50
      views/account.php
  39. 12 3
      views/reports.php
  40. 106 80
      views/settings.php
  41. 111 82
      views/test_list.php
  42. 23 3
      views/test_verify_form.php
  43. 20 3
      views/tests_available.php

+ 46 - 1
controllers/map_overview_ajax.php

@@ -43,6 +43,9 @@ if($submit) {
 					}
 					}
 				}
 				}
 
 
+				$tester_ids = array_column($location_test_array, "tester_id");
+				User::load($tester_ids);
+
 				$output = [];
 				$output = [];
 
 
 				foreach($locations as $location) {
 				foreach($locations as $location) {
@@ -51,12 +54,36 @@ if($submit) {
 
 
 					$customer_slug = str_replace("-", "_", Util::slug($customer->name));
 					$customer_slug = str_replace("-", "_", Util::slug($customer->name));
 
 
+					$tester = null;
+					$formatted_start_dts = null;
+					$formatted_due_dts = null;
+
 					$icon = null;
 					$icon = null;
 					$icon_file = "{$customer_slug}_none.png";
 					$icon_file = "{$customer_slug}_none.png";
 
 
+					$past_due = false;
+
 					if($test) {
 					if($test) {
+
+						$tester = $test->getTester();
+
+						if(!is_null($test->dts_start)) {
+							$unix_start = strtotime($test->dts_start);
+							$formatted_start_dts = date("d/m/Y H:i", $unix_start);
+						}
+
 						if(is_null($test->pass)) {
 						if(is_null($test->pass)) {
 							$icon_file = "{$customer_slug}_pending.png";
 							$icon_file = "{$customer_slug}_pending.png";
+
+							if(!is_null($test->dts_due)) {
+								$unix_due = strtotime($test->dts_due);
+								$formatted_due_dts = date("d/m/Y H:i", $unix_due);
+							}
+
+							if($tester && $test->dts_due && time() > $unix_due) {
+								$icon_file = "{$customer_slug}_past_due.png";
+								$past_due = true;
+							}
 						}
 						}
 						else if($test->pass) {
 						else if($test->pass) {
 							$icon_file = "{$customer_slug}_pass.png";
 							$icon_file = "{$customer_slug}_pass.png";
@@ -77,9 +104,27 @@ if($submit) {
 						"name" => $location->name,
 						"name" => $location->name,
 						"latitude" => (float) $location->latitude,
 						"latitude" => (float) $location->latitude,
 						"longitude" => (float) $location->longitude,
 						"longitude" => (float) $location->longitude,
-						"icon" => $icon
+						"icon" => $icon,
+						"test" => null,
 					];
 					];
 
 
+					if($test) {
+						$data["test"] = [
+							"id" => $test->id,
+							"formattedStartDts" => $formatted_start_dts,
+							"formattedDueDts" => $formatted_due_dts,
+							"tester" => null,
+							"pastDue" => $past_due,
+						];
+
+						if($tester) {
+							$data["test"]["tester"] = [
+								"id" => $tester->id,
+								"name" => $tester->getDisplayName(),
+							];
+						}
+					}
+
 					$output[] = $data;
 					$output[] = $data;
 				}
 				}
 
 

+ 24 - 3
controllers/reports.php

@@ -10,6 +10,10 @@ Core::addBreadcrumb("/account/reports", "Reports");
 $customer = Customer::getForAdmin();
 $customer = Customer::getForAdmin();
 if(!$customer) throw new Exception("You do not have permission to access this page.");
 if(!$customer) throw new Exception("You do not have permission to access this page.");
 
 
+$customer_slug = Util::slug($customer->name);
+$logo_file_path = ROOT_DIR . "/public/img/customer_logos/{$customer_slug}_logo.png";
+$has_logo = file_exists($logo_file_path);
+
 $page_title = "$customer->name Reports";
 $page_title = "$customer->name Reports";
 
 
 Core::addBreadcrumb("/account/reports?customer_id=$customer->id", $page_title);
 Core::addBreadcrumb("/account/reports?customer_id=$customer->id", $page_title);
@@ -25,6 +29,17 @@ $to_quarter = http::value("to_quarter");
 $project_ids = http::value("project_ids", "int");
 $project_ids = http::value("project_ids", "int");
 if(!is_array($project_ids)) $project_ids = [];
 if(!is_array($project_ids)) $project_ids = [];
 
 
+$location_ids = http::value("location_ids");
+if(!empty($location_ids)) {
+	$location_ids = explode(" ", $location_ids);
+	$location_ids = array_map("intval", $location_ids);
+	$location_ids = array_filter($location_ids);
+}
+
+if(!is_array($location_ids)) {
+	$location_ids = [];
+}
+
 $all_projects = Project::query([
 $all_projects = Project::query([
 	"customer_id" => $customer->id
 	"customer_id" => $customer->id
 ]);
 ]);
@@ -93,10 +108,16 @@ if($submit) {
 		if($form_exception->hasErrors()) throw $form_exception;
 		if($form_exception->hasErrors()) throw $form_exception;
 
 
 		// Get all completed tests
 		// Get all completed tests
-		$tests = Test::query([
+		$test_nvp = [
 			"project_id" => $project_ids,
 			"project_id" => $project_ids,
 			"status" => Test::STATUS_COMPLETED
 			"status" => Test::STATUS_COMPLETED
-		]);
+		];
+
+		if($location_ids) {
+			$test_nvp["location_id"] = $location_ids;
+		}
+
+		$tests = Test::query($test_nvp);
 		$test_count = count($tests);
 		$test_count = count($tests);
 
 
 		// Get test values
 		// Get test values
@@ -389,7 +410,7 @@ if($submit) {
 }
 }
 
 
 View::includeOnce("header", compact("page_title"));
 View::includeOnce("header", compact("page_title"));
-View::include("reports", compact("customer", "date_range", "from_quarter", "to_quarter", "date_resolution", "all_projects", "project_ids", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "region_data", "area_manager_data", "key_labels", "has_pass_fail"));
+View::include("reports", compact("customer", "date_range", "from_quarter", "to_quarter", "date_resolution", "all_projects", "project_ids", "location_ids", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "region_data", "area_manager_data", "key_labels", "has_pass_fail"));
 View::includeOnce("footer");
 View::includeOnce("footer");
 
 
 ?>
 ?>

+ 35 - 10
controllers/reports_presentation.php

@@ -22,16 +22,41 @@ $presentation = new PhpPresentation(); // 960x720
 		  ->setOffsetX(380)
 		  ->setOffsetX(380)
 		  ->setOffsetY(10);
 		  ->setOffsetY(10);
 
 
-	// Title
-	$shape = $slide->createRichTextShape()
-		  ->setHeight(120)
-		  ->setWidth(940)
-		  ->setOffsetX(10)
-		  ->setOffsetY(315);
-	$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );
-	$run = $shape->createTextRun($customer->name . " " . date("F Y") . " Tests");
-	$run->getFont()->setBold(true)
-					   ->setSize(45);
+	$title = $customer->name . " " . $template->name . " " . date("F Y") . " Tests";
+
+	if($has_logo) {
+
+		$shape = $slide->createDrawingShape();
+		$shape->setName("$customer->name logo")
+			->setDescription("$customer->name logo")
+			->setPath($logo_file_path)
+			->setWidth(720)
+			->setOffsetX(120)
+			->setOffsetY(180);
+
+		$shape = $slide->createRichTextShape()
+			->setHeight(60)
+			->setWidth(940)
+			->setOffsetX(120)
+			->setOffsetY(120);
+		$run = $shape->createTextRun($title);
+		$run->getFont()->setBold(true)->setSize(16);
+
+
+	}
+	else {
+		// Title
+		$shape = $slide->createRichTextShape()
+			  ->setHeight(120)
+			  ->setWidth(940)
+			  ->setOffsetX(10)
+			  ->setOffsetY(315);
+		$shape->getActiveParagraph()->getAlignment()->setHorizontal( Alignment::HORIZONTAL_CENTER );
+		$run = $shape->createTextRun($title);
+		$run->getFont()->setBold(true)
+						   ->setSize(24);
+	}
+
 }
 }
 
 
 $names = [];
 $names = [];

+ 2 - 0
controllers/test.php

@@ -328,6 +328,8 @@ else if(Core::$user->level >= User::LEVEL_ADMIN) {
 
 
 			if($form_exception->hasErrors()) throw $form_exception;
 			if($form_exception->hasErrors()) throw $form_exception;
 
 
+			$test->retest |= http::value("retest", "int");
+
 			$test->dts_updated = Util::getDateTime();
 			$test->dts_updated = Util::getDateTime();
 			$success = $test->commit();
 			$success = $test->commit();
 			if(!$success) throw new Exception("Failed to update the test. Please try again later.");
 			if(!$success) throw new Exception("Failed to update the test. Please try again later.");

+ 0 - 2
controllers/test_pdf.php

@@ -72,8 +72,6 @@ $pdf->SetAutoPageBreak(false);
 $pdf->Image("public/img/logo.png", 11, 10, 60);
 $pdf->Image("public/img/logo.png", 11, 10, 60);
 
 
 // Right contact info
 // Right contact info
-$y = 10;
-
 $pdf->SetFont("Arial", "B", $tiny_font_size);
 $pdf->SetFont("Arial", "B", $tiny_font_size);
 $pdf->SetTextColor(255, 0, 0);
 $pdf->SetTextColor(255, 0, 0);
 
 

+ 40 - 1
controllers/tests_admin_list.php

@@ -1,5 +1,44 @@
 <?php
 <?php
 
 
+// Batch Action
+$submit = http::value("submit");
+if($submit) {
+	try {
+		Core::validateCSRFToken($submit);
+
+		$test_ids = http::value("test_ids", "int");
+		$batch_action = http::value("batch_action");
+
+		$tests = Test::load($test_ids);
+		$test_count = count($tests);
+
+		switch($batch_action) {
+			case "unassign":
+
+				$test_unassigned_count = 0;
+
+				foreach($tests as $test) {
+					$success = $test->unassignTester();
+					$test_unassigned_count += $success;
+				}
+
+				Core::addAlert("success", "$test_unassigned_count of $test_count test(s) unassigned successfully.");
+
+				break;
+			default:
+				throw new Exception("Invalid action.");
+		}
+
+		HTTP::redirect($_SERVER["REQUEST_URI"]);
+
+
+	}
+	catch(Exception $e) {
+		Core::addAlert("danger", $e->getMessage());
+	}
+}
+// Batch Action End
+
 $status = http::value("status", "int");
 $status = http::value("status", "int");
 $customer_id = http::value("customer_id", "int");
 $customer_id = http::value("customer_id", "int");
 $project_id = http::value("project_id", "int");
 $project_id = http::value("project_id", "int");
@@ -40,7 +79,7 @@ switch($sort) {
 		$query_options = ["sort" => "dts_updated", "order" => "desc"];
 		$query_options = ["sort" => "dts_updated", "order" => "desc"];
 		break;
 		break;
 	case "due":
 	case "due":
-		$query_options = ["sort" => "dts_due", "order" => "desc"];
+		$query_options = ["sort" => "dts_due", "order" => "asc"];
 		break;
 		break;
 	default:
 	default:
 		$sort = "status";
 		$sort = "status";

+ 2 - 0
controllers/tests_available.php

@@ -28,6 +28,8 @@ $tests = Test::query([
 ]);
 ]);
 
 
 $locations = Location::load(array_column($tests, "location_id"));
 $locations = Location::load(array_column($tests, "location_id"));
+$projects = Project::load($project_ids);
+$templates = Template::load(array_column($projects, "template_id"));
 
 
 $addresses = $user->getAddresses();
 $addresses = $user->getAddresses();
 if(!$addresses) {
 if(!$addresses) {

+ 12 - 0
engine/project.php

@@ -78,6 +78,18 @@ class Project extends Model {
 		}
 		}
 	}
 	}
 
 
+	public function isAnytime() {
+		return $this->time_of_day == "A";
+	}
+
+	public function isDaytime() {
+		return $this->time_of_day == "D";
+	}
+
+	public function isNighttime() {
+		return $this->time_of_day == "N";
+	}
+
 	public function isPastDeadline() {
 	public function isPastDeadline() {
 		$deadline_unix = Util::getUnixTimeFromUTC($this->dts_deadline);
 		$deadline_unix = Util::getUnixTimeFromUTC($this->dts_deadline);
 		return time() > $deadline_unix;
 		return time() > $deadline_unix;

+ 41 - 1
engine/test.php

@@ -4,7 +4,7 @@ class Test extends Model {
 
 
 	protected static $table = "test";
 	protected static $table = "test";
 	protected static $id_field = "id";
 	protected static $id_field = "id";
-	protected static $fillable_fields = ["project_id", "location_id", "tester_id", "status", "test_fee", "test_time", "test_travel_cost", "shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes", "dts_due", "dts_start", "dts_end", "verifier_id", "verifier_notes", "pass", "dts_created", "dts_updated", "dts_assigned", "dts_verified"];
+	protected static $fillable_fields = ["project_id", "location_id", "tester_id", "status", "test_fee", "test_time", "test_travel_cost", "shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes", "dts_due", "dts_start", "dts_end", "verifier_id", "verifier_notes", "pass", "retest", "dts_created", "dts_updated", "dts_assigned", "dts_verified"];
 
 
 	const TEST_FIELDS = ["shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes"];
 	const TEST_FIELDS = ["shop_left", "shop_right", "attire", "challenge_stage", "challenge_description", "challenger_name", "challenger_description", "challenger_gender", "challenger_eye_contact", "additional_notes"];
 
 
@@ -46,6 +46,7 @@ class Test extends Model {
 
 
 		$tester = $this->getTester();
 		$tester = $this->getTester();
 		$location = $this->getLocation();
 		$location = $this->getLocation();
+		$project = $this->getProject();
 
 
 		// Content
 		// Content
 		$name = htmlspecialchars($tester->first_name);
 		$name = htmlspecialchars($tester->first_name);
@@ -60,9 +61,15 @@ class Test extends Model {
 		$builder = new EmailBuilder;
 		$builder = new EmailBuilder;
 		$builder->addParagraph("<b>Hi $name,</b>");
 		$builder->addParagraph("<b>Hi $name,</b>");
 		$builder->addLeadParagraph("Congrats, you have been allocated a test!");
 		$builder->addLeadParagraph("Congrats, you have been allocated a test!");
+
+		if($project->isNighttime()) {
+			$builder->addParagraph("<b><font color=\"red\">Evening Test to be done between 7PM and midnight.</font></b>");
+		}
+
 		if($message) {
 		if($message) {
 			$builder->addParagraph($message);
 			$builder->addParagraph($message);
 		}
 		}
+
 		$builder->addParagraph("We need you to confirm if you are able to do the test. Please check the details below and then confirm by pressing the <b>Accept</b> or <b>Decline</b> buttons and once you tap <b>Accept</b>, the test will be allocated to you.");
 		$builder->addParagraph("We need you to confirm if you are able to do the test. Please check the details below and then confirm by pressing the <b>Accept</b> or <b>Decline</b> buttons and once you tap <b>Accept</b>, the test will be allocated to you.");
 		$builder->addAcceptDeclineButtons($base_url);
 		$builder->addAcceptDeclineButtons($base_url);
 		$builder->addParagraph("The site address is: <b>$address</b>");
 		$builder->addParagraph("The site address is: <b>$address</b>");
@@ -86,6 +93,7 @@ class Test extends Model {
 
 
 		$tester = $this->getTester();
 		$tester = $this->getTester();
 		$location = $this->getLocation();
 		$location = $this->getLocation();
+		$project = $this->getProject();
 
 
 		// Content
 		// Content
 		$name = htmlspecialchars($tester->first_name);
 		$name = htmlspecialchars($tester->first_name);
@@ -96,6 +104,11 @@ class Test extends Model {
 		$builder = new EmailBuilder;
 		$builder = new EmailBuilder;
 		$builder->addParagraph("<b>Hi $name,</b>");
 		$builder->addParagraph("<b>Hi $name,</b>");
 		$builder->addLeadParagraph("Congrats, you have claimed a test!");
 		$builder->addLeadParagraph("Congrats, you have claimed a test!");
+
+		if($project->isNighttime()) {
+			$builder->addParagraph("<b><font color=\"red\">Evening Test to be done between 7PM and midnight.</font></b>");
+		}
+
 		$builder->addParagraph("The site address is: <b>$address</b>");
 		$builder->addParagraph("The site address is: <b>$address</b>");
 		$builder->addParagraph("The date that need to complete and submit the results by is: <font color=\"red\"><b>$date_due</b></font>");
 		$builder->addParagraph("The date that need to complete and submit the results by is: <font color=\"red\"><b>$date_due</b></font>");
 		$builder->addParagraph("For methodology and further notes please check the <b>Useful Documents</b> section on the <b>Account</b> page.");
 		$builder->addParagraph("For methodology and further notes please check the <b>Useful Documents</b> section on the <b>Account</b> page.");
@@ -326,6 +339,33 @@ class Test extends Model {
 
 
 	}
 	}
 
 
+	public function getPreviousTest() {
+
+		$nvp = [
+			"dts_start" => (new Constraint("LESS_THAN"))->setValues($this->dts_start),
+			"location_id" => $this->location_id,
+			"status" => Test::STATUS_COMPLETED,
+		];
+
+		$tests = Test::query($nvp, [
+			"sort" => "dts_start",
+			"order" => "desc",
+		]);
+
+		return $tests ? $tests[0] : false;
+
+	}
+
+	public function unassignTester() {
+		$this->status = Test::STATUS_UNASSIGNED;
+		$this->tester_id = null;
+		$this->dts_due = null;
+		$this->dts_assigned = null;
+		$success = $this->commit();
+
+		return $success;
+	}
+
 }
 }
 
 
 ?>
 ?>

+ 4 - 0
engine/user.php

@@ -270,6 +270,10 @@ class User extends Model {
 		return $this->level == User::LEVEL_TESTER;
 		return $this->level == User::LEVEL_TESTER;
 	}
 	}
 
 
+	public function isDeactivated() {
+		return $this->level == User::LEVEL_DEACTIVATED;
+	}
+
 	public function getGenderText() {
 	public function getGenderText() {
 
 
 		if($this->gender == "M") return "Male";
 		if($this->gender == "M") return "Male";

+ 23 - 2
json/mystery_shop.json

@@ -84,7 +84,7 @@
 			"type": "text",
 			"type": "text",
 			"name": "staff_offered_drink_name",
 			"name": "staff_offered_drink_name",
 			"label": "Drink Name",
 			"label": "Drink Name",
-			"maxLength": 32,
+			"maxLength": 200,
 			"helpText": "Leave blank if no drink offered."
 			"helpText": "Leave blank if no drink offered."
 		},
 		},
 
 
@@ -136,7 +136,28 @@
 			"helpText": "For example: \"They were in uniform but they were wearing trainers.\""
 			"helpText": "For example: \"They were in uniform but they were wearing trainers.\""
 		},
 		},
 
 
-
+		{
+			"type": "header",
+			"content": "Play Details"
+		},
+		{
+			"type": "textarea",
+			"name": "play_machines",
+			"label": "Machine(s) Played",
+			"maxLength": 600,
+			"customerExport": false
+		},
+		{
+			"type": "number",
+			"name": "play_spent",
+			"label": "Total Spent",
+			"maxLength": 10,
+			"min": 0,
+			"max": 20,
+			"step": 0.01,
+			"prependText": "£",
+			"helpText": "For example: Enter 1.50 if you have spent £1.50."
+		},
 
 
 		{
 		{
 			"type": "header",
 			"type": "header",

BIN
psd/bacta.psd


BIN
psd/g_t_promotions.psd


BIN
psd/jnc.psd


BIN
psd/playland.psd


BIN
psd/praesepe.psd


BIN
public/img/customer_logos/bacta_logo.png


BIN
public/img/customer_logos/praesepe_logo.png


BIN
public/img/markers/bacta_past_due.png


BIN
public/img/markers/g_t_promotions.png


BIN
public/img/markers/g_t_promotions_fail.png


BIN
public/img/markers/g_t_promotions_pass.png


BIN
public/img/markers/g_t_promotions_past_due.png


BIN
public/img/markers/g_t_promotions_pending.png


BIN
public/img/markers/jnc.png


BIN
public/img/markers/jnc_fail.png


BIN
public/img/markers/jnc_pass.png


BIN
public/img/markers/jnc_past_due.png


BIN
public/img/markers/jnc_pending.png


BIN
public/img/markers/playland.png


BIN
public/img/markers/playland_fail.png


BIN
public/img/markers/playland_pass.png


BIN
public/img/markers/playland_past_due.png


BIN
public/img/markers/playland_pending.png


BIN
public/img/markers/praesepe_past_due.png


+ 29 - 2
public/js/app-map-overview.js

@@ -217,9 +217,36 @@ function addMarkerClickListenerForLocation(m, l) {
 	m.addListener("click", function() {
 	m.addListener("click", function() {
 		let content = "<strong><a href=\"/account/locations/" + l.id + "\" target=\"_blank\">" + l.name + "</a></strong><br />";
 		let content = "<strong><a href=\"/account/locations/" + l.id + "\" target=\"_blank\">" + l.name + "</a></strong><br />";
 		if(l.internalId) {
 		if(l.internalId) {
-			content += "Internal ID: " + l.internalId + "<br />";
+			content += "<div class=\"small\"><strong>Internal ID:</strong> " + l.internalId + "</div>";
 		}
 		}
-		content += "ID: " + l.id + "<br />";
+		content += "<div class=\"small\"><strong>Location ID:</strong> " + l.id + "</div>";
+
+		if(l.test) {
+
+			content += '<hr />';
+
+			content += '<div class="small"><strong>Test ID:</strong> <a href="/account/tests/' + l.test.id + '" target="_blank">' + l.test.id + '</a></div>';
+
+			if(l.test.formattedStartDts) {
+				content += '<div class="small"><strong>Date/Time:</strong> ' + l.test.formattedStartDts + '</div>';
+			}
+
+			if(l.test.tester) {
+				content += '<div class="small"><strong>Tester ID:</strong> ' + l.test.tester.id + '</div>';
+				content += '<div class="small"><strong>Tester Name:</strong> <a href="/account/users/' + l.test.tester.id + '" target="_blank">' + l.test.tester.name + '</a></div>';
+			}
+
+			let pastDueBadge = '';
+			if(l.test.pastDue) {
+				pastDueBadge = '<span class="badge badge-lg badge-primary">Past Due</span>';
+			}
+
+			if(l.test.formattedDueDts) {
+				content += '<div class="small"><strong>Due:</strong> ' + l.test.formattedDueDts + ' ' + pastDueBadge + '</div>';
+			}
+
+		}
+
 
 
 		infoWindow.setContent(content);
 		infoWindow.setContent(content);
 		infoWindow.open(map, m);
 		infoWindow.open(map, m);

+ 34 - 0
template_processing/age_verification/test_pdf.php

@@ -1,5 +1,39 @@
 <?php
 <?php
 
 
+$main_y = $pdf->GetY();
+
+// Retest info
+if($test->retest) {
+	$pdf->SetLeftMargin(83);
+	$pdf->SetY(10);
+
+	$pdf->SetFont("Arial", "B", $header_font_size);
+	$pdf->SetTextColor(0, 0, 255);
+	$pdf->Cell(43, 4, "RETEST", 0, 1);
+
+	$pdf->SetY($pdf->GetY() + 2);
+
+	// Find previous test
+	$previous_test = $test->getPreviousTest();
+	if($previous_test) {
+
+		$previous_test_pass_text = $previous_test->pass ? "PASS" : "FAIL";
+		$previous_test_unix_start = Util::getUnixTimeFromUTC($previous_test->dts_start);
+
+		$previous_test_date = date("d/m/Y", $previous_test_unix_start);
+
+		$pdf->SetFont("Arial", "", $normal_font_size);
+		$pdf->SetTextColor(0, 0, 0);
+		$pdf->Cell(43, 4, "Prev. Test Date: $previous_test_date", 0, 1);
+		$pdf->Cell(43, 4, "Prev. Test Result: $previous_test_pass_text", 0, 1);
+
+	}
+
+}
+
+$pdf->SetLeftMargin(10);
+$pdf->SetY($main_y);
+
 // Header
 // Header
 $pdf->SetTextColor(56, 87, 35);
 $pdf->SetTextColor(56, 87, 35);
 $pdf->SetFont("Arial", "B", $header_font_size);
 $pdf->SetFont("Arial", "B", $header_font_size);

+ 25 - 50
views/account.php

@@ -60,37 +60,6 @@
 			}
 			}
 			?>
 			?>
 			</div>
 			</div>
-			<h3>Actions</h3>
-			<div class="row">
-			<?php
-			foreach($actions as $icon) {
-				$button_class = preg_match("/delete/i", $icon->name) ? "btn-danger" : "btn-light";
-				?>
-				<div class="col-6 col-sm-4 text-center">
-					<a class="btn <?=$button_class?> btn-block mb-3 p-2" href="<?=htmlspecialchars($icon->url)?>">
-						<?php
-						if($icon->counter) {
-							?>
-							<span class="fa-layers fa-fw fa-3x mb-2">
-								<i class="fal fa-<?=htmlspecialchars($icon->icon)?>"></i>
-								<span class="fa-layers-counter fa-layers-bottom-right"><?=number_format($icon->counter)?></span>
-							</span>
-							<?php
-						}
-						else {
-							?>
-							<i class="fal fa-3x fa-<?=htmlspecialchars($icon->icon)?> mb-2"></i>
-							<?php
-						}
-						?>
-						<br />
-						<?=htmlspecialchars($icon->name)?>
-					</a>
-				</div>
-				<?php
-			}
-			?>
-			</div>
 		</div>
 		</div>
 		<div class="col-xl mb-3 mb-lg-0">
 		<div class="col-xl mb-3 mb-lg-0">
 
 
@@ -158,26 +127,32 @@
 
 
 			?>
 			?>
 
 
-			<h3>Useful Documents</h3>
+			<?php
+			if(Core::$user->isCustomer() == false) {
+				?>
+				<h3>Useful Documents</h3>
 
 
-			<div class="list-group mb-3">
-				<a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
-					<i class="fal fa-fw fa-file-pdf"></i>
-					ID Response for Testers
-				</a>
-				<a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
-					<i class="fal fa-fw fa-file-pdf"></i>
-					Age Verification Testing Methodology
-				</a>
-				<a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
-					<i class="fal fa-fw fa-file-pdf"></i>
-					Machine Categories
-				</a>
-				<a class="list-group-item list-group-item-action" href="/files/testing_procedure.pdf">
-					<i class="fal fa-fw fa-file-pdf"></i>
-					Testing Procedure
-				</a>
-			</div>
+				<div class="list-group mb-3">
+					<a class="list-group-item list-group-item-action" href="/files/id_response.pdf">
+						<i class="fal fa-fw fa-file-pdf"></i>
+						ID Response for Testers
+					</a>
+					<a class="list-group-item list-group-item-action" href="/files/testing_methodology.pdf">
+						<i class="fal fa-fw fa-file-pdf"></i>
+						Age Verification Testing Methodology
+					</a>
+					<a class="list-group-item list-group-item-action" href="/files/machine_categories.pdf">
+						<i class="fal fa-fw fa-file-pdf"></i>
+						Machine Categories
+					</a>
+					<a class="list-group-item list-group-item-action" href="/files/testing_procedure.pdf">
+						<i class="fal fa-fw fa-file-pdf"></i>
+						Testing Procedure
+					</a>
+				</div>
+				<?php
+			}
+			?>
 
 
 			<h3>Referrals</h3>
 			<h3>Referrals</h3>
 
 

+ 12 - 3
views/reports.php

@@ -46,7 +46,7 @@ $date_range_custom_style = ($date_range == "custom") ? "" : "display: none";
 		<div class="row">
 		<div class="row">
 			<div class="col-md">
 			<div class="col-md">
 				<div class="row mb-1">
 				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label text-sm-right">
+					<label class="col-sm-4 text-sm-right">
 						Date Range
 						Date Range
 					</label>
 					</label>
 					<div class="col-sm">
 					<div class="col-sm">
@@ -127,7 +127,7 @@ $date_range_custom_style = ($date_range == "custom") ? "" : "display: none";
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label text-sm-right" for="date-resolution">
+					<label class="col-sm-4 text-sm-right" for="date-resolution">
 						Date Resolution
 						Date Resolution
 					</label>
 					</label>
 					<div class="col-sm">
 					<div class="col-sm">
@@ -144,7 +144,7 @@ $date_range_custom_style = ($date_range == "custom") ? "" : "display: none";
 					</div>
 					</div>
 				</div>
 				</div>
 				<div class="row mb-1">
 				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label text-sm-right" for="project-ids">
+					<label class="col-sm-4 text-sm-right" for="project-ids">
 						Projects
 						Projects
 					</label>
 					</label>
 					<div class="col-sm">
 					<div class="col-sm">
@@ -161,6 +161,15 @@ $date_range_custom_style = ($date_range == "custom") ? "" : "display: none";
 						<small class="form-text text-muted">Hint: Ctrl+Click / Cmd+Click to select multiple projects.</small>
 						<small class="form-text text-muted">Hint: Ctrl+Click / Cmd+Click to select multiple projects.</small>
 					</div>
 					</div>
 				</div>
 				</div>
+				<div class="row mb-1">
+					<label class="col-sm-4 text-sm-right" for="location-ids">
+						Location IDs
+					</label>
+					<div class="col-sm">
+						<input class="form-control" name="location_ids" type="text" id="location-ids" value="<?=htmlspecialchars(implode(" ", $location_ids))?>" placeholder="Enter location IDs" />
+						<small class="form-text text-muted">Separate each location ID with a space. Leave blank to generate a report for all locations.</small>
+					</div>
+				</div>
 				<div class="row">
 				<div class="row">
 					<div class="col-sm offset-sm-4">
 					<div class="col-sm offset-sm-4">
 						<button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">
 						<button class="btn btn-primary" type="submit" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">

+ 106 - 80
views/settings.php

@@ -5,110 +5,136 @@
 		<div class="row">
 		<div class="row">
 			<div class="col-lg-8 offset-lg-2">
 			<div class="col-lg-8 offset-lg-2">
 
 
-				<h3>Personal Details</h3>
+				<div class="card card-body mb-3">
+					<h3>Personal</h3>
 
 
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label" for="title">Title</label>
-					<div class="col-sm">
-						<select class="form-control" name="title" id="title" required>
-							<option value="">Select title</option>
-							<?php
-							foreach(User::TITLES as $title) {
-								$selected = ($user->title == $title) ? "selected" : "";
-								?>
-								<option value="<?=htmlspecialchars($title)?>" <?=$selected?>><?=htmlspecialchars($title)?></option>
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label" for="title">Title</label>
+						<div class="col-sm">
+							<select class="form-control" name="title" id="title" required>
+								<option value="">Select title</option>
 								<?php
 								<?php
-							}
-							?>
-						</select>
+								foreach(User::TITLES as $title) {
+									$selected = ($user->title == $title) ? "selected" : "";
+									?>
+									<option value="<?=htmlspecialchars($title)?>" <?=$selected?>><?=htmlspecialchars($title)?></option>
+									<?php
+								}
+								?>
+							</select>
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="first-name">First Name</label>
-					<div class="col-sm">
-						<input class="form-control" type="text" name="first_name" id="first-name" placeholder="Enter first name" value="<?=htmlspecialchars($user->first_name)?>" required />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="first-name">First Name</label>
+						<div class="col-sm">
+							<input class="form-control" type="text" name="first_name" id="first-name" placeholder="Enter first name" value="<?=htmlspecialchars($user->first_name)?>" required />
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="last-name">Last Name</label>
-					<div class="col-sm">
-						<input class="form-control" type="text" name="last_name" id="last-name" placeholder="Enter last name" value="<?=htmlspecialchars($user->last_name)?>" required />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="last-name">Last Name</label>
+						<div class="col-sm">
+							<input class="form-control" type="text" name="last_name" id="last-name" placeholder="Enter last name" value="<?=htmlspecialchars($user->last_name)?>" required />
+						</div>
 					</div>
 					</div>
 				</div>
 				</div>
 
 
-				<h3 class="mt-3">Contact Details</h3>
+				<div class="card card-body mb-3">
+					<h3>Contact</h3>
 
 
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="email">Email Address</label>
-					<div class="col-sm">
-						<input class="form-control" type="email" name="email" id="email" placeholder="Enter email address" value="<?=htmlspecialchars($user->email)?>" required />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="email">Email Address</label>
+						<div class="col-sm">
+							<input class="form-control" type="email" name="email" id="email" placeholder="Enter email address" value="<?=htmlspecialchars($user->email)?>" required />
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="phone">Mobile Number</label>
-					<div class="col-sm">
-						<input class="form-control" type="phone" name="phone" id="phone" placeholder="Enter mobile number" value="<?=htmlspecialchars($user->phone)?>" required />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="phone">Mobile Number</label>
+						<div class="col-sm">
+							<input class="form-control" type="phone" name="phone" id="phone" placeholder="Enter mobile number" value="<?=htmlspecialchars($user->phone)?>" required />
+						</div>
 					</div>
 					</div>
 				</div>
 				</div>
 
 
-				<h3 class="mt-3">Security Details</h3>
+				<div class="card card-body mb-3">
+					<h3>Security</h3>
 
 
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="password">Password (if changing)</label>
-					<div class="col-sm">
-						<input class="form-control" type="password" name="password" id="password" placeholder="Enter password" />
-						<small class="text-muted form-text">At least <span data-length-requirement>6 characters</span>. Must contain at least one <span data-lowercase-requirement>lowercase</span>, <span data-uppercase-requirement>uppercase</span>, <span data-number-requirement>number</span> and <span data-special-requirement>special</span> character.</small>
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="password">Password (if changing)</label>
+						<div class="col-sm">
+							<input class="form-control" type="password" name="password" id="password" placeholder="Enter password" />
+							<small class="text-muted form-text">At least <span data-length-requirement>6 characters</span>. Must contain at least one <span data-lowercase-requirement>lowercase</span>, <span data-uppercase-requirement>uppercase</span>, <span data-number-requirement>number</span> and <span data-special-requirement>special</span> character.</small>
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="password-confirm">Confirm Password</label>
-					<div class="col-sm">
-						<input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="Confirm password" />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="password-confirm">Confirm Password</label>
+						<div class="col-sm">
+							<input class="form-control" type="password" name="password_confirm" id="password-confirm" placeholder="Confirm password" />
+						</div>
 					</div>
 					</div>
 				</div>
 				</div>
-
-				<h3 class="mt-3">Payment Details</h3>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label" for="preferred-payment-method">Preferred Payment Method</label>
-					<div class="col-sm">
-						<select class="form-control" name="preferred_payment_method" id="preferred-payment-method">
-							<?php
-							foreach(User::PAYMENT_METHODS as $value => $display) {
-								$selected = ($user->preferred_payment_method == $value) ? "selected" : "";
-								?>
-								<option value="<?=htmlspecialchars($value)?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
+				<div class="card card-body mb-3">
+					<h3>Payment</h3>
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label" for="preferred-payment-method">Preferred Payment Method</label>
+						<div class="col-sm">
+							<select class="form-control" name="preferred_payment_method" id="preferred-payment-method">
 								<?php
 								<?php
-							}
-							?>
-						</select>
+								foreach(User::PAYMENT_METHODS as $value => $display) {
+									$selected = ($user->preferred_payment_method == $value) ? "selected" : "";
+									?>
+									<option value="<?=htmlspecialchars($value)?>" <?=$selected?>><?=htmlspecialchars($display)?></option>
+									<?php
+								}
+								?>
+							</select>
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="bank-name">Bank Name</label>
-					<div class="col-sm">
-						<input class="form-control" type="text" name="bank_name" id="bank-name" placeholder="Enter bank name" value="<?=htmlspecialchars($user->bank_name)?>" />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="bank-name">Bank Name</label>
+						<div class="col-sm">
+							<input class="form-control" type="text" name="bank_name" id="bank-name" placeholder="Enter bank name" value="<?=htmlspecialchars($user->bank_name)?>" />
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="bank-sort-code">Bank Sort Code</label>
-					<div class="col-sm">
-						<input class="form-control" type="text" name="bank_sort_code" id="bank-sort-code" placeholder="Enter bank sort code" value="<?=htmlspecialchars($user->bank_sort_code)?>" />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="bank-sort-code">Bank Sort Code</label>
+						<div class="col-sm">
+							<input class="form-control" type="text" name="bank_sort_code" id="bank-sort-code" placeholder="Enter bank sort code" value="<?=htmlspecialchars($user->bank_sort_code)?>" />
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label"  for="bank-account-number">Bank Account Number</label>
-					<div class="col-sm">
-						<input class="form-control" type="text" name="bank_account_number" id="bank-account-number" placeholder="Enter bank account number" value="<?=htmlspecialchars($user->bank_account_number)?>" />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label"  for="bank-account-number">Bank Account Number</label>
+						<div class="col-sm">
+							<input class="form-control" type="text" name="bank_account_number" id="bank-account-number" placeholder="Enter bank account number" value="<?=htmlspecialchars($user->bank_account_number)?>" />
+						</div>
 					</div>
 					</div>
-				</div>
-				<div class="row mb-1">
-					<label class="col-sm-4 col-form-label" for="paypal-email">PayPal Email Address</label>
-					<div class="col-sm">
-						<input class="form-control" type="email" name="paypal_email" id="paypal-email" placeholder="Enter PayPal email address" value="<?=htmlspecialchars($user->paypal_email)?>" />
+					<div class="row mb-1">
+						<label class="col-sm-4 col-form-label" for="paypal-email">PayPal Email Address</label>
+						<div class="col-sm">
+							<input class="form-control" type="email" name="paypal_email" id="paypal-email" placeholder="Enter PayPal email address" value="<?=htmlspecialchars($user->paypal_email)?>" />
+						</div>
 					</div>
 					</div>
 				</div>
 				</div>
 
 
-				<button class="btn btn-primary mt-3" type="submit" name="submit" value="<?=$_SESSION["csrf_token"]?>">Save</button>
+				<div class="row">
+					<div class="col">
+						<?php
+						if(Core::$user->isTester()) {
+							?>
+							<a href="/account/deactivate">Deactivate Account...</a><br />
+							<?php
+						}
+						if(Core::$user->isDeactivated()) {
+							?>
+							<a href="/account/reactivate">Reactivate Account</a><br />
+							<?php
+						}
+						?>
+						<a class="text-danger" href="/account/delete">Delete Account...</a><br />
+					</div>
+					<div class="col text-right">
+						<button class="btn btn-primary" type="submit" name="submit" value="<?=$_SESSION["csrf_token"]?>">Save</button>
+					</div>
+				</div>
 			</div>
 			</div>
 		</div>
 		</div>
 	</form>
 	</form>

+ 111 - 82
views/test_list.php

@@ -219,99 +219,128 @@ $custom_filters = [
 			?>
 			?>
 		</div>
 		</div>
 
 
-		<div class="table-responsive mb-3">
+		<form method="post">
 
 
-			<table class="table table-sm table-hover" style="min-width: 1024px;">
-				<thead>
-					<th>ID</th>
-					<th>Location</th>
-					<th>Project</th>
-					<th>Tester</th>
-					<th>Due Date</th>
-					<th>Status</th>
-					<th>Result</th>
-					<th></th>
-				</thead>
-				<tbody>
-				<?php
+			<div class="table-responsive mb-3">
 
 
-				foreach($tests as $test) {
-					$location = $test->getLocation();
-					$project = $test->getProject();
-					$tester = $test->getTester();
+				<table class="table table-sm table-hover" style="min-width: 1024px;">
+					<thead>
+						<th></th>
+						<th>ID</th>
+						<th>Location</th>
+						<th>Project</th>
+						<th>Tester</th>
+						<th>Due Date</th>
+						<th>Status</th>
+						<th>Result</th>
+						<th></th>
+					</thead>
+					<tbody>
+					<?php
 
 
-					$unix_start = strtotime($test->dts_start . " UTC");
-					$unix_end = strtotime($test->dts_end . " UTC");
+					foreach($tests as $test) {
+						$location = $test->getLocation();
+						$project = $test->getProject();
+						$tester = $test->getTester();
 
 
-					?>
+						$unix_start = strtotime($test->dts_start . " UTC");
+						$unix_end = strtotime($test->dts_end . " UTC");
 
 
-					<tr>
-						<td>
-							<?=$test->id?>
-						</td>
-						<td class="align-middle">
-							<a href="/account/locations/<?=$location->id?>">
-								<?=htmlspecialchars($location->name)?>
-								<?php
-								if($location->internal_id) {
-									?>
-									<small>(Internal ID: <?=htmlspecialchars($location->internal_id)?>)</small>
+						?>
+
+						<tr>
+							<td>
+								<input type="checkbox" name="test_ids[]" value="<?=$test->id?>" />
+							</td>
+							<td>
+								<?=$test->id?>
+							</td>
+							<td class="align-middle">
+								<a href="/account/locations/<?=$location->id?>">
+									<?=htmlspecialchars($location->name)?>
 									<?php
 									<?php
-								}
+									if($location->internal_id) {
+										?>
+										<small>(Internal ID: <?=htmlspecialchars($location->internal_id)?>)</small>
+										<?php
+									}
+									?>
+								</a><br />
+								<small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city"]))?></small>
+							</td>
+							<td class="align-middle">
+								<a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a><br />
+								<small><strong>Deadline:</strong> <?=date("d/m/Y", strtotime($project->dts_deadline . " UTC"))?><small>
+							</td>
+							<td class="align-middle">
+							<?php
+							if($tester) {
 								?>
 								?>
-							</a><br />
-							<small><?=htmlspecialchars($location->getDisplayAddress(["address_1", "address_2", "city"]))?></small>
-						</td>
-						<td class="align-middle">
-							<a href="/account/projects/<?=$project->id?>"><?=htmlspecialchars($project->name)?></a><br />
-							<small><strong>Deadline:</strong> <?=date("d/m/Y", strtotime($project->dts_deadline . " UTC"))?><small>
-						</td>
-						<td class="align-middle">
-						<?php
-						if($tester) {
+								<a href="/account/users/<?=$tester->id?>"><?=htmlspecialchars($tester->getDisplayName())?></a>
+								<?php
+							}
+							else {
+								?>
+								<small class="text-muted">N/A</small>
+								<?php
+							}
 							?>
 							?>
-							<a href="/account/users/<?=$tester->id?>"><?=htmlspecialchars($tester->getDisplayName())?></a>
+							</td>
+							<td class="text-center align-middle">
 							<?php
 							<?php
-						}
-						else {
+							if(is_null($test->dts_due)) {
+								?>
+								<small class="text-muted">N/A</small>
+								<?php
+							}
+							else {
+								?>
+								<?=explode(" ", $test->dts_due)[0]?>
+								<?php
+							}
 							?>
 							?>
-							<small class="text-muted">N/A</small>
-							<?php
-						}
-						?>
-						</td>
-						<td class="text-center align-middle">
+							</td>
+							<td class="text-center align-middle">
+								<span class="badge badge-<?=$test->getStatusClass()?>"><?=$test->getStatusText()?></span>
+							</td>
+							<td class="text-center align-middle text-<?=$test->getPassClass()?>">
+								<div data-toggle="tooltip" title="<?=$test->getPassText()?>">
+									<i class="fas fa-2x fa-fw fa-<?=$test->getPassIcon()?>"></i>
+								</div>
+							</td>
+							<td class="text-right align-middle">
+								<a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View</a>
+							</td>
+						</tr>
 						<?php
 						<?php
-						if(is_null($test->dts_due)) {
-							?>
-							<small class="text-muted">N/A</small>
-							<?php
-						}
-						else {
-							?>
-							<?=explode(" ", $test->dts_due)[0]?>
-							<?php
-						}
-						?>
-						</td>
-						<td class="text-center align-middle">
-							<span class="badge badge-<?=$test->getStatusClass()?>"><?=$test->getStatusText()?></span>
-						</td>
-						<td class="text-center align-middle text-<?=$test->getPassClass()?>">
-							<div data-toggle="tooltip" title="<?=$test->getPassText()?>">
-								<i class="fas fa-2x fa-fw fa-<?=$test->getPassIcon()?>"></i>
-							</div>
-						</td>
-						<td class="text-right align-middle">
-							<a class="btn btn-outline-primary" href="/account/tests/<?=$test->id?>">View</a>
-						</td>
-					</tr>
-					<?php
-				}
-				?>
-				</tbody>
-			</table>
-		</div>
+					}
+					?>
+					</tbody>
+				</table>
+			</div>
+
+			<div class="row">
+				<div class="col-md-6 offset-md-6">
+					<div class="input-group">
+						<div class="input-group-prepend">
+							<span class="input-group-text">
+								Batch Action
+							</span>
+						</div>
+						<select class="form-control" name="batch_action" required>
+							<option value="">Select Action</option>
+							<option value="unassign">Unassign</option>
+						</select>
+						<div class="input-group-append">
+							<button type="submit" class="btn btn-primary" name="submit" value="<?=htmlspecialchars($_SESSION["csrf_token"])?>">
+								Submit
+							</button>
+						</div>
+					</div>
+				</div>
+			</div>
+
+		</form>
 
 
 		<div class="mt-3">
 		<div class="mt-3">
 			<?php
 			<?php

+ 23 - 3
views/test_verify_form.php

@@ -295,7 +295,9 @@ function render_card_list_group($details) {
 							if($customer->email) {
 							if($customer->email) {
 								?>
 								?>
 								<div class="row mb-1">
 								<div class="row mb-1">
-									<div class="col-sm-4">Email Headquarters</div>
+									<div class="col-sm-4">
+										<label class="form-check-label" for="email-customer">Email Headquarters</label>
+									</div>
 									<div class="col-sm">
 									<div class="col-sm">
 										<div class="form-check">
 										<div class="form-check">
 											<input class="form-check-input" type="checkbox" name="email_customer" id="email-customer" value="1" <?=Form::checked($customer->email_after_test)?> />
 											<input class="form-check-input" type="checkbox" name="email_customer" id="email-customer" value="1" <?=Form::checked($customer->email_after_test)?> />
@@ -308,7 +310,9 @@ function render_card_list_group($details) {
 							if($location->email) {
 							if($location->email) {
 								?>
 								?>
 								<div class="row mb-1">
 								<div class="row mb-1">
-									<div class="col-sm-4">Email Venue</div>
+									<div class="col-sm-4">
+										<label class="form-check-label" for="email-location">Email Venue</label>
+									</div>
 									<div class="col-sm">
 									<div class="col-sm">
 										<div class="form-check">
 										<div class="form-check">
 											<input class="form-check-input" type="checkbox" name="email_location" id="email-location" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
 											<input class="form-check-input" type="checkbox" name="email_location" id="email-location" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
@@ -321,7 +325,9 @@ function render_card_list_group($details) {
 							if($location->area_manager_email) {
 							if($location->area_manager_email) {
 								?>
 								?>
 								<div class="row mb-1">
 								<div class="row mb-1">
-									<div class="col-sm-4">Email Area Manager</div>
+									<div class="col-sm-4">
+										<label class="form-check-label" for="email-location-area-manager">Email Area Manager</label>
+									</div>
 									<div class="col-sm">
 									<div class="col-sm">
 										<div class="form-check">
 										<div class="form-check">
 											<input class="form-check-input" type="checkbox" name="email_location_area_manager" id="email-location-area-manager" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
 											<input class="form-check-input" type="checkbox" name="email_location_area_manager" id="email-location-area-manager" value="1" <?=Form::checked($customer->email_locations_after_test)?> />
@@ -332,6 +338,20 @@ function render_card_list_group($details) {
 								<?php
 								<?php
 							}
 							}
 							?>
 							?>
+
+							<div class="row mb-1">
+								<div class="col-sm-4">Retest</div>
+								<div class="col-sm">
+									<div class="form-check">
+										<input class="form-check-input" type="checkbox" name="retest" id="retest" value="1" <?=Form::checked($test->retest)?> />
+										<label class="form-check-label" for="retest">Retest</label>
+									</div>
+									<small class="form-text text-muted">
+										If this test was a retest, please check the box above. Once the test is accepted or rejected, this flag cannot be changed.
+									</small>
+								</div>
+							</div>
+
 							<div class="row mb-1">
 							<div class="row mb-1">
 								<label class="col-sm-4 col-form-label" for="tester-message">Message to Tester (if rejecting)</label>
 								<label class="col-sm-4 col-form-label" for="tester-message">Message to Tester (if rejecting)</label>
 								<div class="col-sm">
 								<div class="col-sm">

+ 20 - 3
views/tests_available.php

@@ -25,13 +25,30 @@
 				$location = $test->getLocation();
 				$location = $test->getLocation();
 				$distance = Geolocation::getDistance($location->getGeolocation(), $address->getGeolocation());
 				$distance = Geolocation::getDistance($location->getGeolocation(), $address->getGeolocation());
 				$distance_formatted = number_format($distance, 1);
 				$distance_formatted = number_format($distance, 1);
+				$project = $test->getProject();
+				$template = $project->getTemplate();
 				?>
 				?>
 				<div class="list-group-item">
 				<div class="list-group-item">
 					<div class="d-flex justify-content-between">
 					<div class="d-flex justify-content-between">
 						<div>
 						<div>
-							<?=htmlspecialchars($location->name)?><br />
-							<small><?=htmlspecialchars($location->getDisplayAddress())?></small><br />
-							<small><?=htmlspecialchars($distance_formatted)?> mi from your <?=htmlspecialchars($address->name)?> address.</small>
+							<div><?=htmlspecialchars($location->name)?></div>
+							<div><small><?=htmlspecialchars($location->getDisplayAddress())?></small></div>
+							<div>
+								<small><strong>Type:</strong> <?=htmlspecialchars($template->name)?></small>
+								<?php
+								if($project->isNighttime()) {
+									?>
+									<span class="badge badge-dark">
+										<i class="fas fa-fw fa-moon"></i>
+										Nighttime
+									</span>
+									<?php
+								}
+								?>
+							</div>
+							<div>
+								<small><strong><?=htmlspecialchars($distance_formatted)?> mi</strong> from your <?=htmlspecialchars($address->name)?> address.</small>
+							</div>
 						</div>
 						</div>
 						<button class="btn btn-primary align-self-start" data-test-id="<?=$test->id?>">Select</button>
 						<button class="btn btn-primary align-self-start" data-test-id="<?=$test->id?>">Select</button>
 					</div>
 					</div>