Explorar el Código

Add template for Hilton Group

Alan Lam hace 3 años
padre
commit
21dbf0d6db

+ 262 - 0
json/age_verification_hilton.json

@@ -0,0 +1,262 @@
+{
+	"customerInvoiceFields": [
+	],
+	"testerInvoiceFields": [
+		{"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": "door_sensor_alert",
+			"label": "Door Sensor Alert",
+			"values": ["", "0", "1"],
+			"displayStrings": ["Did not notice", "No", "Yes"],
+			"helpText": "Was there a sound or visual alert when you entered the venue?",
+			"customerExport": false,
+			"defaultValue": "1"
+		},
+
+		{
+			"type": "inline-radio",
+			"name": "social_distancing_signage",
+			"label": "Signage for Social Distancing",
+			"values": [0, 1],
+			"displayStrings": ["No", "Yes"],
+			"required": true,
+			"requiredKey": "COVID-19"
+		},
+		{
+			"type": "inline-radio",
+			"name": "entrance_hand_sanitiser",
+			"label": "Hand Sanitisers at Entrance",
+			"values": [0, 1],
+			"displayStrings": ["No", "Yes"],
+			"required": true,
+			"requiredKey": "COVID-19"
+		},
+		{
+			"type": "inline-radio",
+			"name": "social_distancing_measures",
+			"label": "Social Distancing Measures",
+			"values": [0, 1],
+			"displayStrings": ["No", "Yes"],
+			"helpText": "Were there social distancing measures in place?",
+			"required": true,
+			"requiredKey": "COVID-19"
+		},
+
+		{
+			"type": "hr"
+		},
+
+		{
+			"type": "header",
+			"content": "Challenge Details"
+		},
+		{
+			"type": "dropdown",
+			"name": "challenge_stage",
+			"label": "Stage",
+			"values": ["", 1, 2, 3, 4, 5],
+			"displayStrings": ["Select stage", "Challenge on entry", "Challenge on ordering", "Challenge at service", "Challenge at payment", "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": "Name",
+			"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": "Gender",
+			"values": ["", "M", "F"],
+			"displayStrings": ["No challenge", "Male", "Female"],
+			"customerExport": false
+		},
+		{
+			"type": "inline-radio",
+			"name": "challenger_eye_contact",
+			"label": "Eye Contact",
+			"values": ["", "0", "1"],
+			"displayStrings": ["No challenge", "No", "Yes"],
+			"customerExport": false
+		},
+
+		{
+			"type": "hr",
+			"hidden": true
+		},
+
+		{
+			"type": "header",
+			"content": "Bar Details"
+		},
+		{
+			"type": "inline-radio",
+			"name": "bar_purchase",
+			"label": "Bar Purchase",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"helpText": "Did you buy anything at the bar?"
+		},
+		{
+			"type": "number",
+			"name": "bar_expenditure",
+			"label": "Bar Expenditure",
+			"maxLength": 10,
+			"min": 0,
+			"max": 20,
+			"step": 0.01,
+			"prependText": "£",
+			"helpText": "For example: Enter 1.50 if you have spent £1.50."
+		},
+		{
+			"type": "inline-radio",
+			"name": "alcohol_purchased",
+			"label": "Alcohol Purchased",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"]
+		},
+		{
+			"type": "text",
+			"name": "bar_purchase_item",
+			"label": "Name of Item Purchased",
+			"maxLength": 40
+		},
+
+		{
+			"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": "think_21_25",
+			"label": "Think 21 or Think 25",
+			"values": ["Think 21", "Think 25"],
+			"displayStrings": ["Think 21", "Think 25"]
+		},
+		{
+			"type": "inline-radio",
+			"name": "think_21_badge",
+			"label": "Think 21/25 Badge Worn by Staff",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"defaultValue": "1"
+		},
+		{
+			"type": "inline-radio",
+			"name": "think_21_poster",
+			"label": "Think 21/25 Poster Displayed",
+			"values": ["0", "1"],
+			"displayStrings": ["No", "Yes"],
+			"defaultValue": "1"
+		},
+		{
+			"type": "textarea",
+			"name": "think_21_poster_notes",
+			"label": "Think 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_hilton/project_csv.php

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

+ 3 - 0
template_processing/age_verification_hilton/project_customer_csv.php

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

+ 48 - 0
template_processing/age_verification_hilton/reports_build_charts.php

@@ -0,0 +1,48 @@
+<?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->getPeriodicDoorSensorAlertPassRateChart();
+$charts[] = $generator->getPeriodicEyeContactPassRateChart();
+$charts[] = $generator->getPeriodicLineOfSightPassRateChart();
+$charts[] = $generator->getPeriodicBarPurchasePassRateChart();
+$charts[] = $generator->getPeriodicTotalsChart();
+$charts = array_merge($charts, $generator->getPointOfChallengeCharts());
+$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();
+}

+ 78 - 0
template_processing/age_verification_hilton/reports_create_empty_objects.php

@@ -0,0 +1,78 @@
+<?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],
+
+	"doorSensorAlertPassCounts" => [0, 0, 0],
+	"doorSensorAlertFailCounts" => [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,
+];

+ 118 - 0
template_processing/age_verification_hilton/reports_process_test.php

@@ -0,0 +1,118 @@
+<?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;
+$door_sensor_alert = $test_values->door_sensor_alert ?? 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");
+	$booleanPassFieldIncrementor($door_sensor_alert, true, "doorSensorAlert");
+}
+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");
+	$booleanPassFieldIncrementor($door_sensor_alert, false, "doorSensorAlert");
+}
+
+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_hilton/result_email_subject_format.txt

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

+ 389 - 0
template_processing/age_verification_hilton/test_pdf.php

@@ -0,0 +1,389 @@
+<?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 class="field">Door Sensor:</div>
+		<div class="value"><?=TestPDF::getBooleanHtml($values["door_sensor_alert"] ?? false)?></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>