Alan Lam пре 3 година
родитељ
комит
e30955150f

+ 2 - 2
controllers/customer_add.php

@@ -28,8 +28,8 @@ if($submit) {
 		$customer->country = http::value("country", "trim");
 		$customer->email = http::value("email", "email");
 		$customer->phone = http::value("phone", "trim");
-		$customer->email_after_test = http::value("email_after_test", "int");
-		$customer->email_locations_after_test = http::value("email_locations_after_test", "int");
+		$customer->email_after_test = (int) http::value("email_after_test", "int");
+		$customer->email_locations_after_test = (int) http::value("email_locations_after_test", "int");
 		$customer->year_cycle_month = http::value("year_cycle_month", "int");
 		$customer->show_in_map_overview = (int) http::value("show_in_map_overview", "int");
 

+ 41 - 6
engine/form.php

@@ -166,6 +166,10 @@ class Form {
                 self::renderHorizontalBar($options);
                 break;
 
+            case "time":
+                self::renderTimeField($options);
+                break;
+
 		}
 
 	}
@@ -183,7 +187,6 @@ class Form {
 	 */
 	private static function renderTextField(object $options): void {
 		$id = str_replace("_", "-", $options->name);
-		$placeholder = "Enter " . strtolower($options->label);
 		$value = $options->value ?? http::value($options->name);
 		$required = ($options->required ?? false) ? "required" : "";
 		$help_text = $options->helpText ?? false;
@@ -201,7 +204,7 @@ class Form {
 				}
 				?>
 			</label>
-			<input class="form-control" type="text" name="<?=$options->name?>" id="<?=$id?>" placeholder="<?=htmlspecialchars($placeholder)?>" value="<?=htmlspecialchars($value)?>" <?=$required?> <?=$max_length?> />
+			<input class="form-control" type="text" name="<?=$options->name?>" id="<?=$id?>" placeholder="Enter text" value="<?=htmlspecialchars($value)?>" <?=$required?> <?=$max_length?> />
 			<?php
 			if($help_text) {
 				?>
@@ -219,7 +222,6 @@ class Form {
 	 */
 	private static function renderNumberField(object $options): void {
 		$id = str_replace("_", "-", $options->name);
-		$placeholder = $options->placeholder ?? "Enter " . strtolower($options->label);
 		$value = $options->value ?? http::value($options->name);
 		$required = ($options->required ?? false) ? "required" : "";
 		$help_text = $options->helpText ?? false;
@@ -252,7 +254,7 @@ class Form {
 					<?php
 				}
 				?>
-				<input class="form-control" type="number" name="<?=$options->name?>" id="<?=$id?>" placeholder="<?=htmlspecialchars($placeholder)?>" value="<?=htmlspecialchars($value)?>" step="<?=$step?>" <?=$required?> <?=$min?> <?=$max?> <?=$max_length?> />
+				<input class="form-control" type="number" name="<?=$options->name?>" id="<?=$id?>" placeholder="Enter number" value="<?=htmlspecialchars($value)?>" step="<?=$step?>" <?=$required?> <?=$min?> <?=$max?> <?=$max_length?> />
 			</div>
 			<?php
 			if($help_text) {
@@ -350,7 +352,6 @@ class Form {
 	 */
 	private static function renderTextareaField(object $options): void {
 		$id = str_replace("_", "-", $options->name);
-		$placeholder = $options->placeholder ?? "Enter " . strtolower($options->label);
 		$value = $options->value ?? http::value($options->name);
 		$required = ($options->required ?? false) ? "required" : "";
 		$help_text = $options->helpText ?? false;
@@ -367,7 +368,7 @@ class Form {
 				}
 				?>
 			</label>
-			<textarea class="form-control" name="<?=$options->name?>" id="<?=$id?>" placeholder="<?=htmlspecialchars($placeholder)?>" rows="4" <?=$required?> <?=$max_length?>><?=htmlspecialchars($value)?></textarea>
+			<textarea class="form-control" name="<?=$options->name?>" id="<?=$id?>" placeholder="Enter text" rows="4" <?=$required?> <?=$max_length?>><?=htmlspecialchars($value)?></textarea>
 			<?php
 			if($help_text) {
 				?>
@@ -469,4 +470,38 @@ class Form {
 		<?php
 	}
 
+	/**
+	 * @param object $options
+	 * @throws Exception
+	 */
+	private static function renderTimeField(object $options): void {
+		$id = str_replace("_", "-", $options->name);
+		$value = $options->value ?? http::value($options->name);
+		$required = ($options->required ?? false) ? "required" : "";
+		$help_text = $options->helpText ?? false;
+		$hidden = !empty($options->hidden) ? "hidden" : "";
+		?>
+		<div class="form-group" <?=$hidden?>>
+			<label for="<?=$id?>">
+				<?=htmlspecialchars($options->label)?>
+				<?php
+				if($required) {
+					?>
+					<span class="badge badge-danger"><?=htmlspecialchars(__("Required"))?></span>
+					<?php
+				}
+				?>
+			</label>
+			<input class="form-control" type="time" name="<?=$options->name?>" id="<?=$id?>" value="<?=htmlspecialchars($value)?>" <?=$required?> />
+			<?php
+			if($help_text) {
+				?>
+				<small class="form-text text-muted"><?=htmlspecialchars($help_text)?></small>
+				<?php
+			}
+			?>
+		</div>
+		<?php
+	}
+
 }

+ 325 - 0
json/age_verification_greene_king.json

@@ -0,0 +1,325 @@
+{
+	"customerInvoiceFields": [
+		{"name": "play_spent", "label": "Money Spent by Testers"}
+	],
+	"testerInvoiceFields": [
+		{"name": "play_spent", "label": "Play Costs"},
+		{"name": "bar_expenditure", "label": "Bar Expenditure"}
+	],
+	"beforeTest": [
+		{
+			"type": "header",
+			"content": "Before the Test"
+		},
+		{
+			"type": "text",
+			"name": "shop_left",
+			"label": "Name of the shop to the left of the venue",
+			"maxLength": 32,
+			"required": true,
+			"customerExport": false
+		},
+		{
+			"type": "text",
+			"name": "shop_right",
+			"label": "Name of the shop to the right of the venue",
+			"maxLength": 32,
+			"required": true,
+			"customerExport": false
+		},
+		{
+			"type": "text",
+			"name": "attire",
+			"label": "Tester Clothing",
+			"maxLength": 50,
+			"required": true,
+			"customerExport": false
+		},
+		{
+			"type": "file",
+			"label": "Selfie",
+			"name": "selfie",
+			"required": true
+		},
+		{
+			"type": "file",
+			"label": "Location Photo",
+			"name": "location_photo",
+			"required": true
+		}
+	],
+	"duringTest": [
+		{
+			"type": "header",
+			"content": "Venue"
+		},
+		{
+			"type": "inline-radio",
+			"name": "play_machine_line_of_sight",
+			"label": "Was the machine in line of sight of the bar?",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"]
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Challenge Details"
+		},
+		{
+			"type": "dropdown",
+			"name": "challenge_stage",
+			"label": "At which stage were you challenged?",
+			"values": ["", 1, 2, 3, 4, 5],
+			"displayStrings": ["Select stage", "Challenged on entry", "Challenged during browsing", "Challenged during play", "Challenged after play (min. 3 minutes)", "No challenge"],
+			"required": true
+		},
+		{
+			"type": "textarea",
+			"name": "challenge_description",
+			"label": "Describe the test from start to finish",
+			"maxLength": 400,
+			"helpText": "Describe how the challenge took place. For example: \"While entering I was approached politely and asked for ID.\""
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Staff Description"
+		},
+		{
+			"type": "text",
+			"name": "challenger_name",
+			"label": "What was the name of the staff member that challenged you? (If applicable)",
+			"maxLength": 32,
+			"customerExport": false
+		},
+		{
+			"type": "textarea",
+			"name": "challenger_description",
+			"label": "Descriptions of staff and their locations/interactions",
+			"maxLength": 250,
+			"helpText": "Describe ANY members of staff that you saw in the venue and any comments you feel that are relevant. Please add an accurate description of any staff members you saw even if not challenged. For example: \"She was about 150cm tall and had long red hair and glasses. She approached me and asked me if I wanted some water and then asked if I had any ID.\"",
+			"customerExport": false
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenger_gender",
+			"label": "What was the the staff member's gender? (If applicable)",
+			"values": ["", "M", "F"],
+			"displayStrings": ["No challenge", "Male", "Female"],
+			"customerExport": false
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenger_eye_contact",
+			"label": "Was there eye contact with the staff member?",
+			"values": ["", "0", "1"],
+			"displayStrings": ["No challenge", "No", "Yes"],
+			"customerExport": false
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Play Details"
+		},
+		{
+			"type": "text",
+			"name": "play_machine",
+			"label": "What was the name of the machine that you played?",
+			"maxLength": 20,
+			"customerExport": false
+		},
+		{
+			"type": "text",
+			"name": "play_machine_position",
+			"label": "Where was the machine located in the venue?",
+			"maxLength": 100,
+			"customerExport": false,
+			"helpText": "For example: Opposite the bar."
+		},
+		{
+			"type": "radio",
+			"name": "play_jackpot",
+			"label": "What was the machine's jackpot value?",
+			"values": ["", 5, 10, 15, 20, 25, 35, 50, 100, 500],
+			"displayStrings": ["Did not play", "£5", "£10", "£15", "£20", "£25", "£35", "£50", "£100", "£500"],
+			"customerExport": false
+		},
+		{
+			"type": "radio",
+			"name": "play_machine_stake",
+			"label": "What was the stake played?",
+			"values": ["", 0.1, 0.2, 0.25, 0.3, 0.5, 1, 2],
+			"displayStrings": ["Did not play", "10p", "20p", "25p", "30p", "50p", "£1", "£2"],
+			"helpText": "This is how much the machine charges you per spin."
+		},
+		{
+			"type": "radio",
+			"name": "play_minutes",
+			"label": "How long did you play? (Minutes)",
+			"values": ["", "1", "2", "3", "4", "5"],
+			"displayStrings": ["Did not play", "1 minute", "2 minutes", "3 minutes", "4 minutes", "5 minutes or more"]
+		},
+		{
+			"type": "number",
+			"name": "play_spent",
+			"label": "How much did you spend on the machine?",
+			"maxLength": 10,
+			"min": 0,
+			"max": 2,
+			"step": 0.01,
+			"prependText": "£",
+			"helpText": "For example: Enter 1.50 if you have spent £1.50."
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Bar Details"
+		},
+
+		{
+			"type": "time",
+			"name": "bar_time",
+			"label": "What time did you arrive at the bar?",
+			"maxLength": 32,
+			"customerExport": false
+		},
+
+		{
+			"type": "text",
+			"name": "bar_staff_name",
+			"label": "What is the bartender's name?",
+			"maxLength": 32,
+			"customerExport": false
+		},
+		{
+			"type": "textarea",
+			"name": "bar_staff_description",
+			"label": "Description of the bartender and their interactions",
+			"maxLength": 250,
+			"customerExport": false
+		},
+		{
+			"type": "inline-radio",
+			"name": "bar_staff_gender",
+			"label": "What gender was the bartender?",
+			"values": ["M", "F", "O"],
+			"displayStrings": ["Male", "Female", "Other"],
+			"customerExport": false
+		},
+
+		{
+			"type": "inline-radio",
+			"name": "bar_age_verification",
+			"label": "Were you asked for ID?",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"]
+		},
+		{
+			"type": "inline-radio",
+			"name": "alcohol_purchased",
+			"label": "Were you served alcohol?",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"]
+		},
+		{
+			"type": "text",
+			"name": "bar_purchase_item",
+			"label": "What were you served?",
+			"maxLength": 20
+		},
+		{
+			"type": "number",
+			"name": "bar_expenditure",
+			"label": "How much did you spend at the bar?",
+			"maxLength": 10,
+			"min": 0,
+			"max": 20,
+			"step": 0.01,
+			"prependText": "£",
+			"helpText": "For example: Enter 1.50 if you have spent £1.50."
+		},
+		{
+			"type": "file",
+			"label": "Photo of receipt",
+			"name": "bar_receipt"
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Signage Details"
+		},
+		{
+			"type": "inline-radio",
+			"name": "citizen_card_brochure_displayed",
+			"label": "Citizen Card Brochure Displayed",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"defaultValue": "1"
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenge_21_25",
+			"label": "Challenge 21 or Challenge 25",
+			"values": ["Challenge 21", "Challenge 25"],
+			"displayStrings": ["Challenge 21", "Challenge 25"]
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenge_21_badge",
+			"label": "Challenge 21/25 Badge Worn by Staff",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"defaultValue": "1"
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenge_21_poster",
+			"label": "Challenge 21/25 Poster Displayed",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"defaultValue": "1"
+		},
+		{
+			"type": "textarea",
+			"name": "challenge_21_poster_notes",
+			"label": "Challenge 21/25 Poster Details",
+			"maxLength": 200,
+			"helpText": "Describe the location of the poster that was displayed."
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Notes"
+		},
+		{
+			"type": "textarea",
+			"name": "additional_notes",
+			"label": "Additional Notes",
+			"maxLength": 600
+		}
+	]
+}

+ 3 - 0
template_processing/age_verification_greene_king/project_csv.php

@@ -0,0 +1,3 @@
+<?php
+
+require ROOT_DIR . "/template_processing/age_verification/project_csv.php";

+ 3 - 0
template_processing/age_verification_greene_king/project_customer_csv.php

@@ -0,0 +1,3 @@
+<?php
+
+require ROOT_DIR . "/template_processing/age_verification/project_customer_csv.php";

+ 47 - 0
template_processing/age_verification_greene_king/reports_build_charts.php

@@ -0,0 +1,47 @@
+<?php
+
+/**
+ * @var ChartGenerator $generator
+ * @var Template $template
+ */
+
+$charts[] = $generator->getTestsByStageChart();
+$charts[] = $generator->getChallengerGenderChart();
+$charts[] = $generator->getTesterGenderChart();
+$charts[] = $generator->getPassFailCountChart();
+
+if(!empty($venue_type_data)) {
+	$charts[] = ChartGenerator::getVenueTypePassFailChart($venue_type_data);
+	$charts = array_merge($charts, $generator->getVenueTypeChallengeStagePieCharts($venue_type_data));
+
+	$chart = $generator->getVenueTypeChallengeStageStackedBarChart($venue_type_data);
+	if($chart) {
+		$charts[] = $chart;
+	}
+}
+
+$charts[] = $generator->getPeriodicPassFailRateChart();
+$charts[] = $generator->getPeriodicEyeContactChart();
+$charts[] = $generator->getPeriodicEyeContactPassRateChart();
+$charts[] = $generator->getPeriodicLineOfSightPassRateChart();
+$charts[] = $generator->getPeriodicBarPurchasePassRateChart();
+$charts[] = $generator->getPeriodicTotalsChart();
+$charts = array_merge($charts, $generator->getPointOfChallengeCharts("%s Point of Challenge", ["On Entry", "While Browsing", "During Play", "After Play", "No Challenge"]));
+$charts[] = $generator->getPeriodicTesterGenderChart();
+$charts[] = $generator->getPeriodicTestCountChart();
+$charts = array_merge($charts, $generator->getGenderComparisonCharts());
+
+if($generator->hasRegionData()) {
+	$charts[] = $generator->getRegionPassRateChart();
+	$charts[] = $generator->getPeriodicRegionPassRateChart();
+}
+
+if($generator->hasAreaManagerData()) {
+	$charts[] = $generator->getAreaManagerPassRateChart();
+	$charts[] = $generator->getPeriodicAreaManagerPassRateChart();
+}
+
+if($generator->hasBrandData()) {
+	$charts[] = $generator->getBrandPassRateChart();
+	$charts[] = $generator->getPeriodicBrandPassRateChart();
+}

+ 75 - 0
template_processing/age_verification_greene_king/reports_create_empty_objects.php

@@ -0,0 +1,75 @@
+<?php
+
+$empty_data = (object) [
+	"label" => "",
+	"testCount" => 0,
+	"passCount" => 0,
+	"failCount" => 0,
+	"voidCount" => 0,
+
+	"eyeContactCounts" => [0, 0, 0],
+
+	"eyeContactPassCounts" => [0, 0, 0],
+	"eyeContactFailCounts" => [0, 0, 0],
+
+	"lineOfSightPassCounts" => [0, 0, 0],
+	"lineOfSightFailCounts" => [0, 0, 0],
+
+	"barPurchasePassCounts" => [0, 0, 0],
+	"barPurchaseFailCounts" => [0, 0, 0],
+
+	"maleTesterCount" => 0,
+	"femaleTesterCount" => 0,
+
+	"maleChallengerCount" => 0,
+	"femaleChallengerCount" => 0,
+	"unspecifiedChallengerCount" => 0,
+
+	"maleChallengeMaleCount" => 0,
+	"maleChallengeMalePassCount" => 0,
+	"maleChallengeMaleStages" => [0, 0, 0, 0, 0],
+
+	"maleChallengeFemaleCount" => 0,
+	"maleChallengeFemalePassCount" => 0,
+	"maleChallengeFemaleStages" => [0, 0, 0, 0, 0],
+
+	"femaleChallengeMaleCount" => 0,
+	"femaleChallengeMalePassCount" => 0,
+	"femaleChallengeMaleStages" => [0, 0, 0, 0, 0],
+
+	"femaleChallengeFemaleCount" => 0,
+	"femaleChallengeFemalePassCount" => 0,
+	"femaleChallengeFemaleStages" => [0, 0, 0, 0, 0],
+
+	"unknownChallengeCount" => 0,
+	"unknownChallengePassCount" => 0,
+	"unknownChallengeStages" => [0, 0, 0, 0, 0],
+
+	"stage1Count" => 0,
+	"stage2Count" => 0,
+	"stage3Count" => 0,
+	"stage4Count" => 0,
+	"stage5Count" => 0,
+];
+
+$total_data = (object) [
+	"maleTesterCount" => 0,
+	"femaleTesterCount" => 0,
+
+	"maleChallengerCount" => 0,
+	"femaleChallengerCount" => 0,
+	"unspecifiedChallengerCount" => 0,
+
+	"eyeContactCounts" => [0, 0, 0],
+
+	"testCount" => 0,
+	"passCount" => 0,
+	"failCount" => 0,
+	"voidCount" => 0,
+
+	"stage1Count" => 0,
+	"stage2Count" => 0,
+	"stage3Count" => 0,
+	"stage4Count" => 0,
+	"stage5Count" => 0,
+];

+ 115 - 0
template_processing/age_verification_greene_king/reports_process_test.php

@@ -0,0 +1,115 @@
+<?php
+
+/**
+ * @var object $total_data Total data
+ * @var array $region_data
+ * @var array $area_manager_data
+ * @var array $brand_data
+ * @var array $data Periodic data
+ * @var string $key Current period key
+ * @var string $region
+ * @var string $area_manager
+ * @var string $brand
+ * @var Test $test
+ * @var User $tester
+ * @var array $test_values
+ */
+
+$booleanPassFieldIncrementor = static function($value, $pass, $prefix) use (&$data, $key) {
+
+	if($pass) {
+		$field = $prefix . "PassCounts";
+	}
+	else {
+		$field = $prefix . "FailCounts";
+	}
+
+	if($value === null) {
+		$index = 2;
+	}
+	else if($value) {
+		$index = 1;
+	}
+	else {
+		$index = 0;
+	}
+
+	$data[$key]->$field[$index]++;
+};
+
+$stage_key = "stage" . $test->challenge_stage . "Count";
+$data[$key]->$stage_key++;
+$total_data->{$stage_key}++;
+
+$line_of_sight = $test_values->play_machine_line_of_sight ?? null;
+$bar_purchase = $test_values->bar_purchase ?? null;
+$eye_contact = $test->challenger_eye_contact ?? null;
+
+if($test->pass) {
+	$data[$key]->passCount++;
+	$total_data->passCount++;
+	if($region) $region_data[$region][$key]->passCount++;
+	if($area_manager) $area_manager_data[$area_manager][$key]->passCount++;
+	if($brand) $brand_data[$brand][$key]->passCount++;
+
+	$booleanPassFieldIncrementor($eye_contact, true, "eyeContact");
+	$booleanPassFieldIncrementor($line_of_sight, true, "lineOfSight");
+	$booleanPassFieldIncrementor($bar_purchase, true, "barPurchase");
+}
+else {
+	$data[$key]->failCount++;
+	$total_data->failCount++;
+	if($region) $region_data[$region][$key]->failCount++;
+	if($area_manager) $area_manager_data[$area_manager][$key]->failCount++;
+	if($brand) $brand_data[$brand][$key]->failCount++;
+
+	$booleanPassFieldIncrementor($eye_contact, false, "eyeContact");
+	$booleanPassFieldIncrementor($line_of_sight, false, "lineOfSight");
+	$booleanPassFieldIncrementor($bar_purchase, false, "barPurchase");
+}
+
+if($test->challenger_gender === "M") {
+	$data[$key]->maleChallengerCount++;
+	$total_data->maleChallengerCount++;
+}
+else if($test->challenger_gender === "F") {
+	$data[$key]->femaleChallengerCount++;
+	$total_data->femaleChallengerCount++;
+}
+else {
+	$data[$key]->unspecifiedChallengerCount++;
+	$total_data->unspecifiedChallengerCount++;
+}
+
+// Eye Contact
+if(is_null($test->challenger_eye_contact)) {
+	++$data[$key]->eyeContactCounts[2];
+}
+else if($test->challenger_eye_contact) {
+	++$data[$key]->eyeContactCounts[0];
+}
+else {
+	++$data[$key]->eyeContactCounts[1];
+}
+
+// Genders Comparison
+$gender_prefix = "";
+switch($test->challenger_gender) {
+	case "M": $gender_prefix = "male"; break;
+	case "F": $gender_prefix = "female"; break;
+	default:  $gender_prefix = "unknown"; break;
+}
+
+$gender_prefix .= "Challenge";
+
+if($gender_prefix !== "unknownChallenge") {
+	switch($tester->gender) {
+		case "M": $gender_prefix .= "Male"; break;
+		case "F": $gender_prefix .= "Female"; break;
+		default: $gender_prefix = "unknownChallenge"; break;
+	}
+}
+
+$data[$key]->{$gender_prefix . "Count"}++;
+$data[$key]->{$gender_prefix . "Stages"}[$test->challenge_stage - 1]++;
+if($test->pass) $data[$key]->{$gender_prefix . "PassCount"}++;

+ 1 - 0
template_processing/age_verification_greene_king/result_email_subject_format.txt

@@ -0,0 +1 @@
+{pass} - {stage} - Check Policy visit to: {location} {date-time}

+ 383 - 0
template_processing/age_verification_greene_king/test_pdf.php

@@ -0,0 +1,383 @@
+<?php
+
+/**
+ * @var Template $template
+ * @var Test $test
+ * @var array $values
+ * @var string $location_text
+ * @var Customer $customer
+ * @var Location $location
+ * @var User $tester
+ * @var string $date_start
+ * @var string $time_start
+ * @var string $time_end
+ * @var string $duration_text
+ */
+
+$pass_image = $test->pass ? "pass.png" : "fail.png";
+
+// COVID-19
+$covid_19 = in_array("COVID-19", $template->getKeys());
+
+?>
+
+<h3 class="section">Test Result</h3>
+
+<div align="center" style="margin: auto; width: 75%;">
+	<img src="/img/<?=htmlspecialchars($pass_image)?>" alt="" />
+</div>
+
+<div style="float: left; width: 70%; position: relative;">
+	<h3 class="section"><?=htmlspecialchars($location_text)?></h3>
+
+	<div class="bl">
+		<div class="field"><?=htmlspecialchars($customer->region_field_name)?> / <?=htmlspecialchars($customer->area_manager_field_name)?>:</div>
+		<div class="value">
+			<div style="float: left; width: 25%;">
+				<?=TestPDF::getValueHtml($location->region)?> / <?=TestPDF::getValueHtml($location->area_manager)?>
+			</div>
+			<div style="float: right; width: 74%; text-align: right;">
+				<?=TestPDF::getValueHtml($location->region_name)?> / <?=TestPDF::getValueHtml($location->area_manager_name)?>
+			</div>
+		</div>
+	</div>
+
+	<div class="bl">
+		<div class="field">Address:</div>
+		<div class="value">
+			<div style="float: left; width: 50%;">
+				<?=htmlspecialchars($location->address_1)?><br />
+				<?php
+				if($location->address_2) {
+					?>
+					<?=htmlspecialchars($location->address_2)?><br />
+					<?php
+				}
+				?>
+				<?=htmlspecialchars($location->city)?>
+			</div>
+			<div style="float: right; width: 49%; text-align: right;">
+				<?=htmlspecialchars($location->legal_entity_name)?><br />
+				<strong>OPM:</strong> <?=htmlspecialchars($location->operations_manager_name)?>
+			</div>
+		</div>
+	</div>
+
+	<div class="bl">
+		<div class="field">Postcode:</div>
+		<div class="value"><?=htmlspecialchars($location->postal_code)?></div>
+	</div>
+
+	<div class="bl">
+		<div class="field">Shop Name - Left:</div>
+		<div class="value"><?=htmlspecialchars($test->shop_left)?></div>
+	</div>
+
+	<div class="bl">
+		<div class="field">Shop Name - Right:</div>
+		<div class="value"><?=htmlspecialchars($test->shop_right)?></div>
+	</div>
+
+</div>
+
+<div style="float: right; width: 29%">
+	<h3 class="section">Tester</h3>
+
+	<div class="bl">
+		<div class="field">Gender:</div>
+		<div class="value"><?=htmlspecialchars($tester->getGenderText())?></div>
+	</div>
+
+	<div>
+		<strong>Attire:</strong><br />
+		<?=htmlspecialchars($test->attire)?>
+	</div>
+
+	<h3 class="section">Brand</h3>
+	<strong><?=htmlspecialchars($location->brand)?></strong>
+
+
+</div>
+
+<div style="clear: both;"></div>
+
+<h3 class="section">Test Details</h3>
+
+<div style="float: left; width: 49.5%">
+	<div class="subheader">
+		<strong>Date &amp; Time</strong>
+	</div>
+
+	<div style="float: left; width: 24%">
+		<strong>Date:</strong><br />
+		<?=htmlspecialchars($date_start)?>
+	</div>
+	<div style="float: left; width: 24%">
+		<strong>Entry:</strong><br />
+		<?=htmlspecialchars($time_start)?>
+	</div>
+	<div style="float: left; width: 24%">
+		<strong>Exit:</strong><br />
+		<?=htmlspecialchars($time_end)?>
+	</div>
+	<div style="float: left; width: 24%">
+		<strong>Duration:</strong><br />
+		<?=htmlspecialchars($duration_text)?>
+	</div>
+
+	<div style="clear: both;"></div><br />
+
+	<?php
+	if($covid_19) {
+		?>
+		<div class="subheader">
+			<strong>Venue</strong>
+		</div>
+		<div class="bl">
+			<div class="field">Social Distancing Signage:</div>
+			<div class="value"><?=TestPDF::getBooleanHtml($values["social_distancing_signage"] ?? false)?></div>
+		</div>
+
+		<div class="bl">
+			<div class="field">Entrance Hand Sanitiser:</div>
+			<div class="value"><?=TestPDF::getBooleanHtml($values["entrance_hand_sanitiser"] ?? false)?></div>
+		</div>
+
+		<div>
+			<div class="field">Social Distancing Measures:</div>
+			<div class="value"><?=TestPDF::getBooleanHtml($values["social_distancing_measures"] ?? false)?></div>
+		</div>
+		<?php
+	}
+	?>
+
+	<div style="clear: both;"></div><br />
+
+	<div class="subheader">
+		<strong>Staff</strong>
+	</div>
+
+	<div class="bl">
+		<div class="field">Name:</div>
+		<div class="value"><?=TestPDF::getValueHtml($test->challenger_name)?></div>
+	</div>
+
+	<div class="bl">
+		<div class="field">Gender:</div>
+		<div class="value"><?=TestPDF::getValueHtml(Util::getGenderText($test->challenger_gender))?></div>
+	</div>
+
+	<strong>Description:</strong><br />
+	<?=TestPDF::getValueHtml($test->challenger_description)?><br />
+
+	<br />
+
+	<div class="subheader">
+		<strong>Signage</strong>
+	</div>
+
+	<div class="wide-field-names">
+		<div class="bl">
+			<div class="field">Think 21/25:</div>
+			<div class="value"><?=TestPDF::getValueHtml($values["think_21_25"] ?? "")?></div>
+		</div>
+
+		<?php
+		$value = $values["citizen_card_brochure_displayed"] ?? "";
+		if(strlen($value)) $value = $value ? "Yes" : "No";
+		?>
+
+		<div class="bl">
+			<div class="field">Citizen Card Brochure Displayed:</div>
+			<div class="value"><?=TestPDF::getValueHtml($value)?></div>
+		</div>
+
+		<?php
+		$value = $values["think_21_poster"] ?? "";
+		if(strlen($value)) $value = $value ? "Yes" : "No";
+		?>
+
+		<div class="bl">
+			<div class="field">Think 21/25 Posters Displayed:</div>
+			<div class="value"><?=TestPDF::getValueHtml($value)?></div>
+		</div>
+
+		<strong>Think 21/25 Poster Notes:</strong><br />
+		<?=TestPDF::getValueHtml($values["think_21_poster_notes"] ?? "")?>
+	</div>
+
+	<br />
+
+	<?php
+	$bar_purchase = ($values["bar_purchase"] ?? "") ? "Yes" : "No";
+	$bar_expenditure = ($values["bar_expenditure"] ?? "") ?: 0;
+	$alcohol_purchased = ($values["alcohol_purchased"] ?? "") ? "Yes" : "No";
+	$bar_purchase_item = ($values["bar_purchase_item"] ?? "");
+	?>
+
+	<div class="subheader">
+		<strong>Bar Details</strong>
+	</div>
+
+	<div class="wide-field-names">
+		<div class="bl">
+			<div class="field">Bar Purchase:</div>
+			<div class="value"><?=TestPDF::getValueHtml($bar_purchase)?></div>
+		</div>
+		<div class="bl">
+			<div class="field">Bar Expenditure:</div>
+			<div class="value">£<?=number_format($bar_expenditure, 2)?></div>
+		</div>
+		<div class="bl">
+			<div class="field">Alcohol Purchased:</div>
+			<div class="value"><?=$alcohol_purchased?></div>
+		</div>
+		<div>
+			<div class="field">Name of Item Purchased:</div>
+			<div class="value"><?=TestPDF::getValueHtml($bar_purchase_item)?></div>
+		</div>
+	</div>
+
+
+</div>
+
+<div style="float: right; width: 49.5%">
+	<div class="subheader">
+		<strong>ID Request</strong>
+	</div>
+
+	<?php
+
+	$pass_colour = $test->pass ? "green" : "red";
+
+	switch($test->challenge_stage) {
+		case 1:
+		case 2:
+			$challenge_colour = "green";
+			break;
+		case 3:
+			$challenge_colour = "orange";
+			break;
+		case 4:
+		case 5:
+		default:
+			$challenge_colour = "red";
+			break;
+	}
+	?>
+
+	<div class="bl">
+		<div class="field">Result:</div>
+		<div class="value" style="color: <?=$pass_colour?>">
+			<strong><?=htmlspecialchars($test->getPassText())?></strong>
+		</div>
+	</div>
+
+	<div>
+		<div class="field">ID Stage:</div>
+		<div class="value" style="color: <?=$challenge_colour?>">
+			<strong><?=htmlspecialchars($test->challenge_stage . " - " . $test->getChallengeStageText())?></strong>
+		</div>
+	</div>
+
+	<br />
+
+	<div>
+		<div style="color: green;">1: Challenge on entry</div>
+		<div style="color: green;">2: Challenge while browsing</div>
+		<div style="color: orange;">3: Challenge during play</div>
+		<div style="color: red;">4: Challenge on exit</div>
+		<div style="color: red;">5: No challenge</div>
+	</div>
+
+	<br />
+
+	<div class="bl">
+		<div class="field">Eye Contact:</div>
+		<div class="value"><?=($test->challenger_eye_contact ? "Yes" : "No")?></div>
+	</div>
+
+	<div>
+		<strong>Description:</strong><br />
+		<?=TestPDF::getValueHtml($test->challenge_description)?>
+	</div>
+
+	<br />
+
+	<div class="subheader">
+		<strong>Play Details</strong>
+	</div>
+	<div class="wide-field-names">
+		<div class="bl">
+			<div class="field">Machine Played:</div>
+			<div class="value"><?=TestPDF::getValueHtml($values["play_machine"] ?? "")?></div>
+		</div>
+
+		<div class="bl">
+			<div class="field">Machine Position:</div>
+			<div class="value"><?=TestPDF::getValueHtml($values["play_machine_position"] ?? "")?></div>
+		</div>
+
+		<?php
+		$value = $values["play_machine_line_of_sight"] ?? "";
+		if(strlen($value)) $value = $value ? "Yes" : "No";
+		?>
+
+		<div class="bl">
+			<div class="field">Line of Sight of Bar:</div>
+			<div class="value"><?=TestPDF::getValueHtml($value)?></div>
+		</div>
+
+		<?php
+		$play_jackpot = $values["play_jackpot"] ?? "";
+		if(!empty($play_jackpot)) {
+			$play_jackpot = "£" . number_format($play_jackpot, 2);
+		}
+		?>
+
+		<div class="bl">
+			<div class="field">Jackpot Value:</div>
+			<div class="value"><?=TestPDF::getValueHtml($play_jackpot)?></div>
+		</div>
+
+		<?php
+		$play_machine_stake = $values["play_machine_stake"] ?? "";
+		if(!empty($play_machine_stake)) {
+			$play_machine_stake = "£" . number_format($play_machine_stake, 2);
+		}
+		?>
+
+		<div class="bl">
+			<div class="field">Stake Played:</div>
+			<div class="value"><?=TestPDF::getValueHtml($play_machine_stake)?></div>
+		</div>
+
+		<div class="bl">
+			<div class="field">Minutes Played:</div>
+			<div class="value"><?=TestPDF::getValueHtml($values["play_minutes"] ?? "")?></div>
+		</div>
+
+		<?php
+		$play_spent = $values["play_spent"] ?? "";
+		if(!empty($play_spent)) $play_spent = "£" . number_format($play_spent, 2);
+		?>
+
+		<div>
+			<div class="field">Amount Spent:</div>
+			<div class="value"><?=TestPDF::getValueHtml($play_spent)?></div>
+		</div>
+	</div>
+
+</div>
+
+<div class="clear"></div>
+
+<br />
+
+<div>
+	<div class="subheader">
+		<strong>Additional Notes</strong>
+	</div>
+
+	<?=TestPDF::getValueHtml($test->additional_notes)?>
+</div>