Просмотр исходного кода

Add template processing for Mitchells & Butlers

Alan Lam 7 лет назад
Родитель
Сommit
35bd0f6cf3

+ 99 - 0
template_processing/age_verification_mitchells_butlers/project_csv.php

@@ -0,0 +1,99 @@
+<?php
+
+
+$field_names = [
+	"Project ID", "Project Name",
+	"Template Name",
+	"Test ID", "Test Status", "Test Result",
+	"Location Name", "Legal Entity", "Address", "Email", "Phone", "Region", "Internal ID", "Area Manager",
+	"Tester Age", "Tester Gender", "Travel Costs",
+
+	"Date", "Start Time", "End Time", "Duration",
+];
+
+foreach($fields as $field) {
+	$field_names[] = $field->label;
+}
+
+fputcsv($handle, $field_names);
+
+foreach($tests as $test) {
+
+	$location = $test->getLocation();
+	$tester = $test->getTester();
+	$values = $test->getValues(true);
+
+	$test_date = "";
+	$test_start = "";
+	$test_end = "";
+	$test_duration = "";
+
+	$result = "Pending";
+
+	$age = "";
+	$gender = "";
+	$travel_costs = "";
+
+	$output = [];
+	$output[] = $id;
+	$output[] = $project->name;
+	$output[] = $template->name;
+	$output[] = $test->id;
+	$output[] = $test->getStatusText();
+
+	if(!is_null($test->pass)) {
+
+		$result = $test->pass ? "Pass" : "Fail";
+
+		$test_start_dt = new DateTime($test->dts_start);
+		$test_end_dt = new DateTime($test->dts_end);
+		$test_duration_diff = $test_start_dt->diff($test_end_dt, true);
+
+		$test_date = $test_start_dt->format("d/m/Y");
+		$test_start = $test_start_dt->format("H:i:s");
+		$test_end = $test_end_dt->format("H:i:s");
+		$test_duration = $test_duration_diff->h . ":" . $test_duration_diff->i . ":" . $test_duration_diff->s;
+
+		if($tester) {
+			$tester_dob_dt = new DateTime($tester->date_of_birth);
+			$dob_diff = $test_start_dt->diff($tester_dob_dt, true);
+			$age = $dob_diff->y;
+			$gender = $tester->gender;
+			$travel_costs = $test->test_travel_costs;
+		}
+	}
+
+
+	$output[] = $result;
+	$output[] = $location->name;
+	$output[] = $location->legal_entity_name;
+	$output[] = $location->getDisplayAddress();
+	$output[] = $location->email;
+	$output[] = $location->phone;
+	$output[] = $location->region;
+	$output[] = $location->internal_id;
+	$output[] = $location->area_manager;
+	$output[] = $age;
+	$output[] = $gender;
+	$output[] = $travel_costs;
+	$output[] = $test_date;
+	$output[] = $test_start;
+	$output[] = $test_end;
+	$output[] = $test_duration;
+
+	foreach($fields as $field) {
+		$field_name = $field->name;
+		$value = isset($test->$field_name) ? $test->$field_name : ($values[$field->name] ?? "");
+
+		if(!empty($field->displayStrings)) {
+			$index = array_search($value, $field->values);
+			$value = $field->displayStrings[$index];
+		}
+
+		$output[] = $value;
+	}
+
+	fputcsv($handle, $output);
+}
+
+?>

+ 87 - 0
template_processing/age_verification_mitchells_butlers/project_customer_csv.php

@@ -0,0 +1,87 @@
+<?php
+
+$field_names = [
+	"Test Result",
+	"Location Name", "Address", "Region", "Internal ID", "Area Manager",
+
+	"Date",
+];
+
+foreach($fields as $field) {
+	$customer_export = $field->customerExport ?? true;
+	if(!$customer_export) continue;
+
+	$field_names[] = $field->label;
+}
+
+fputcsv($handle, $field_names);
+
+foreach($tests as $test) {
+
+	$location = $test->getLocation();
+	$tester = $test->getTester();
+	$values = $test->getValues(true);
+
+	$test_date = "";
+	$test_start = "";
+	$test_end = "";
+	$test_duration = "";
+
+	$result = "Pending";
+
+	$age = "";
+	$gender = "";
+	$travel_costs = "";
+
+	$output = [];
+
+	if(!is_null($test->pass)) {
+
+		$result = $test->pass ? "Pass" : "Fail";
+
+		$test_start_dt = new DateTime($test->dts_start);
+		$test_end_dt = new DateTime($test->dts_end);
+		$test_duration_diff = $test_start_dt->diff($test_end_dt, true);
+
+		$test_date = $test_start_dt->format("d/m/Y");
+		$test_start = $test_start_dt->format("H:i:s");
+		$test_end = $test_end_dt->format("H:i:s");
+		$test_duration = $test_duration_diff->h . ":" . $test_duration_diff->i . ":" . $test_duration_diff->s;
+
+		if($tester) {
+			$tester_dob_dt = new DateTime($tester->date_of_birth);
+			$dob_diff = $test_start_dt->diff($tester_dob_dt, true);
+			$age = $dob_diff->y;
+			$gender = $tester->gender;
+			$travel_costs = $test->test_travel_costs;
+		}
+	}
+
+	$output[] = $result;
+	$output[] = $location->name;
+	$output[] = $location->getDisplayAddress();
+	$output[] = $location->region;
+	$output[] = $location->internal_id;
+	$output[] = $location->area_manager;
+	$output[] = $test_date;
+
+	foreach($fields as $field) {
+
+		$customer_export = $field->customerExport ?? true;
+		if(!$customer_export) continue;
+
+		$field_name = $field->name;
+		$value = isset($test->$field_name) ? $test->$field_name : ($values[$field->name] ?? "");
+
+		if(!empty($field->displayStrings)) {
+			$index = array_search($value, $field->values);
+			$value = $field->displayStrings[$index];
+		}
+
+		$output[] = $value;
+	}
+
+	fputcsv($handle, $output);
+}
+
+?>

+ 558 - 0
template_processing/age_verification_mitchells_butlers/reports_build_charts.php

@@ -0,0 +1,558 @@
+<?php
+
+// Tests by Stage
+
+$chart = new Chart;
+$chart->setType("doughnut");
+$chart->setTitle("Tests by Stage $date_range_label");
+$chart->setLabels(["1 - On Entry", "2 - While Browsing", "3 - During Play", "4 - On Exit", "5 - No Challenge"]);
+$chart->addDataset("Tests", [
+	$total_data->stage1Count,
+	$total_data->stage2Count,
+	$total_data->stage3Count,
+	$total_data->stage4Count,
+	$total_data->stage5Count,
+], [
+	"background_colours" => [
+		"#4CAF50",
+		"#FFEB3B",
+		"#FBC02D",
+		"#FFAB91",
+		"#F44336",
+	],
+	"datalabels" => Chart::DATALABELS_BOX,
+]);
+$chart->setPrintSuffixes("");
+$chart->print = true;
+$chart->printPercentages = true;
+$chart->setPrintLabels(["Stage 1", "Stage 2", "Stage 3", "Stage 4", "Stage 5"]);
+
+$charts[] = $chart;
+
+
+// Challenger Gender
+$chart = new Chart;
+$chart->setType("pie");
+$chart->setTitle("Staff Gender $date_range_label");
+$chart->setLabels(["Male", "Female", "Unspecified"]);
+$chart->addDataset("Counts", [
+	$total_data->maleChallengerCount,
+	$total_data->femaleChallengerCount,
+	$total_data->unspecifiedChallengerCount,
+], [
+	"background_colours" => [
+		"#2196F3",
+		"#E91E63",
+		"#9E9E9E",
+	],
+	"datalabels" => Chart::DATALABELS_BOX,
+]);
+$charts[] = $chart;
+
+// Tester Gender
+$chart = new Chart;
+$chart->setType("pie");
+$chart->setTitle("Tester Gender $date_range_label");
+$chart->setLabels(["Male", "Female"]);
+$chart->addDataset("Counts", [
+	$total_data->maleTesterCount,
+	$total_data->femaleTesterCount,
+], [
+	"background_colours" => [
+		"#2196F3",
+		"#E91E63",
+	],
+	"datalabels" => Chart::DATALABELS_BOX,
+]);
+$charts[] = $chart;
+
+// Pass / Fail
+$chart = new Chart;
+$chart->setType("pie");
+$chart->setTitle("Pass / Fail $date_range_label");
+$chart->setLabels(["Pass", "Fail"]);
+$chart->addDataset("Counts", [
+	$total_data->passCount,
+	$total_data->failCount,
+], [
+	"background_colours" => [
+		"#4CAF50",
+		"#F44336",
+	],
+	"datalabels" => Chart::DATALABELS_BOX,
+]);
+$charts[] = $chart;
+
+// Pass Rate Period
+$pass_rates = array_values(array_map(function($d) {
+	if($d->testCount == 0) return 0;
+	return round(($d->passCount / $d->testCount) * 100);
+}, $data));
+
+$fail_rates = array_values(array_map(function($d) {
+	if($d->testCount == 0) return 0;
+	$pass_rate = round(($d->passCount / $d->testCount) * 100);
+	return 100 - $pass_rate;
+}, $data));
+
+$chart = new Chart;
+$chart->addXAxis([
+	"type" => "category",
+	"stacked" => true,
+]);
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => 100],
+	"stacked" => true,
+]);
+
+$chart->setType("bar");
+$chart->setTitle("Pass / Fail by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addDataset("Pass Rate (%)", $pass_rates, [
+	"background_colours" => "#4CAF50"
+]);
+$chart->addDataset("Fail Rate (%)", $fail_rates, [
+	"background_colours" => "#F44336"
+]);
+$chart->setDatalabelSuffixes("%", "%");
+$charts[] = $chart;
+
+// Totals by Period
+
+$test_counts = array_column($data, "testCount");
+$pass_counts = array_column($data, "passCount");
+$fail_counts = array_column($data, "failCount");
+
+$chart = new Chart;
+$chart->setType("bar");
+$chart->setTitle("Totals by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => ceil(max($test_counts) / 10) * 10]
+]);
+$chart->addYAxis([
+	"position" => "right",
+	"id" => "y-axis-2",
+	"grid_lines" => false,
+	"tick_config" => ["min" => 0, "max" => 100]
+]);
+
+$chart->addDataset("Pass Rate (%)", $pass_rates, [
+	"border_colours" => "#FFEB3B",
+	"background_colours" => "transparent",
+	"type" => "line",
+	"y_axis_id" => "y-axis-2",
+	"datalabels" => [
+		"display" => false
+	],
+	"line_tension" => 0,
+]);
+$chart->addDataset("Test Count", $test_counts, [
+	"background_colours" => "#2196F3",
+	"type" => "bar",
+	"y_axis_id" => "y-axis-1",
+	"datalabels" => [
+		"display" => false
+	],
+]);
+$chart->addDataset("Pass", $pass_counts, [
+	"background_colours" => "#4CAF50",
+	"type" => "bar",
+	"y_axis_id" => "y-axis-1",
+	"datalabels" => [
+		"display" => false
+	],
+]);
+$chart->addDataset("Fail", $fail_counts, [
+	"background_colours" => "#F44336",
+	"type" => "bar",
+	"y_axis_id" => "y-axis-1",
+	"datalabels" => [
+		"display" => false
+	],
+]);
+$chart->setDatalabelSuffixes("%", "", "", "");
+$chart->print = true;
+$charts[] = $chart;
+
+// Point of Challenge (Each Period)
+
+foreach($keys as $index => $key) {
+	$key_label = $key_labels[$index];
+
+	$period_data = $data[$key];
+
+	if($period_data->testCount == 0) continue;
+
+	$chart = new Chart;
+	$chart->setType("pie");
+	$chart->setTitle("$key_label Point of Challenge");
+	$chart->setLabels(["On Entry", "While Browsing", "During Play", "On Exit", "No Challenge"]);
+	$chart->addDataset("Counts", [
+		$period_data->stage1Count,
+		$period_data->stage2Count,
+		$period_data->stage3Count,
+		$period_data->stage4Count,
+		$period_data->stage5Count,
+	], [
+		"background_colours" => [
+			"#4CAF50",
+			"#FFEB3B",
+			"#FBC02D",
+			"#FFAB91",
+			"#F44336",
+		],
+		"datalabels" => Chart::DATALABELS_BOX,
+	]);
+	$charts[] = $chart;
+}
+
+// Tester Genders by Period
+$male_counts = array_values(array_map(function($d) {
+	return $d->maleTesterCount;
+}, $data));
+
+$female_counts = array_values(array_map(function($d) {
+	return $d->femaleTesterCount;
+}, $data));
+
+$chart = new Chart;
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => ceil(max(max($male_counts), max($female_counts)) / 10) * 10]
+]);
+
+$chart->setType("bar");
+$chart->setTitle("Tester Gender by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addDataset("Male", $male_counts, [
+	"background_colours" => "#2196F3"
+]);
+$chart->addDataset("Female", $female_counts, [
+	"background_colours" => "#E91E63"
+]);
+$charts[] = $chart;
+
+// Test Count by Period
+$test_counts = array_values(array_map(function($d) {
+	return $d->testCount;
+}, $data));
+
+$chart = new Chart;
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => ceil(max($test_counts) / 10) * 10]
+]);
+$chart->setType("bar");
+$chart->setTitle("Tests by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addDataset("Tests", $test_counts, [
+	"background_colours" => "#2196F3"
+]);
+$charts[] = $chart;
+
+// Gender Graphs
+$gender_keys = [
+	"maleChallengeMale" => [
+		"title" => "Male Challenge Male",
+		"label" => "M Cha. M",
+	],
+	"maleChallengeFemale" => [
+		"title" => "Male Challenge Female",
+		"label" => "M Cha. F",
+	],
+	"femaleChallengeMale" => [
+		"title" => "Female Challenge Male",
+		"label" => "F Cha. M",
+	],
+	"femaleChallengeFemale" => [
+		"title" => "Female Challenge Female",
+		"label" => "F Cha. F",
+	],
+	"unknownChallenge" => [
+		"title" => "Gender Not Specified",
+		"label" => "Gender Not Specified",
+	],
+];
+
+$gender_test_counts = [];
+foreach($gender_keys as $gk => $gv) {
+	$gender_test_counts[] = array_sum(array_column($data, "{$gk}Count"));
+}
+
+// Gender Comparison by Date Range
+$chart = new Chart;
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => ceil(max($gender_test_counts) / 10) * 10]
+]);
+$chart->setType("bar");
+$chart->setTitle("Gender Comparison $date_range_label");
+$chart->setLabels(array_column($gender_keys, "label"));
+$chart->addDataset("Tests", $gender_test_counts, [
+	"background_colours" => "#2196F3"
+]);
+$charts[] = $chart;
+
+// Gender Comparison by Resolution
+$mcm_counts = array_column($data, "maleChallengeMaleCount");
+$mcf_counts = array_column($data, "maleChallengeFemaleCount");
+$fcm_counts = array_column($data, "femaleChallengeMaleCount");
+$fcf_counts = array_column($data, "femaleChallengeFemaleCount");
+$ns_counts = array_column($data, "unknownChallengeCount");
+
+$chart = new Chart;
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => ceil(max(max($mcm_counts), max($mcf_counts), max($fcm_counts), max($fcf_counts)) / 10) * 10]
+]);
+$chart->setType("bar");
+$chart->setTitle("Gender Comparison by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addDataset("M Cha. M", $mcm_counts, ["background_colours" => "#2196F3"]);
+$chart->addDataset("M Cha. F", $mcf_counts, ["background_colours" => "#3F51B5"]);
+$chart->addDataset("F Cha. M", $fcm_counts, ["background_colours" => "#9C27B0"]);
+$chart->addDataset("F Cha. F", $fcf_counts, ["background_colours" => "#E91E63"]);
+$chart->addDataset("Not Specified", $ns_counts, ["background_colours" => "#9E9E9E"]);
+$chart->print = true;
+$charts[] = $chart;
+
+// Gender Comparison Pass Rate by Resolution
+$mcm_pass_counts = array_column($data, "maleChallengeMalePassCount");
+$mcf_pass_counts = array_column($data, "maleChallengeFemalePassCount");
+$fcm_pass_counts = array_column($data, "femaleChallengeMalePassCount");
+$fcf_pass_counts = array_column($data, "femaleChallengeFemalePassCount");
+$ns_pass_counts = array_column($data, "unknownChallengePassCount");
+
+foreach(["mcm", "mcf", "fcm", "fcf", "ns"] as $prefix) {
+	$pass_rates = [];
+	$pass_counts = ${$prefix . "_pass_counts"};
+	$test_counts = ${$prefix . "_counts"};
+
+	foreach($test_counts as $index => $test_count) {
+		if($test_count == 0) {
+			$pass_rates[] = 0;
+			continue;
+		}
+		$pass_rates[] = number_format(($pass_counts[$index] * 100) / $test_count, 2);
+	}
+
+	${$prefix . "_pass_rates"} = $pass_rates;
+}
+
+$chart = new Chart;
+$chart->addYAxis([
+	"id" => "y-axis-1",
+	"tick_config" => ["min" => 0, "max" => 100],
+]);
+$chart->setType("bar");
+$chart->setTitle("Gender Comparison Pass Rate by $resolution_name");
+$chart->setLabels($x_data_labels);
+$chart->addDataset("M Cha. M", $mcm_pass_rates, ["background_colours" => "#2196F3", "datalabels" => ["display" => false],  "line_tension" => 0]);
+$chart->addDataset("M Cha. F", $mcf_pass_rates, ["background_colours" => "#3F51B5", "datalabels" => ["display" => false], "line_tension" => 0]);
+$chart->addDataset("F Cha. M", $fcm_pass_rates, ["background_colours" => "#9C27B0", "datalabels" => ["display" => false], "line_tension" => 0]);
+$chart->addDataset("F Cha. F", $fcf_pass_rates, ["background_colours" => "#E91E63", "datalabels" => ["display" => false], "line_tension" => 0]);
+$chart->addDataset("Not Specified", $ns_pass_rates, ["background_colours" => "#9E9E9E", "datalabels" => ["display" => false], "line_tension" => 0]);
+$chart->print = true;
+$chart->setDatalabelSuffixes("%", "%", "%", "%", "%");
+$charts[] = $chart;
+
+// Gender Comparison Point of Challenge
+foreach($keys as $index => $key) {
+	$key_label = $key_labels[$index];
+	$period_data = $data[$key];
+
+	foreach($gender_keys as $prefix => $gv) {
+
+		$title = $gv["label"];
+		$test_count = $period_data->{$prefix . "Count"};
+		$stage_data = $period_data->{$prefix . "Stages"};
+
+		if($test_count == 0) continue;
+
+		$chart = new Chart;
+		$chart->setType("pie");
+		$chart->setTitle("$key_label $title Point of Challenge");
+		$chart->setLabels(["On Entry", "While Browsing", "During Play", "On Exit", "No Challenge"]);
+		$chart->addDataset("Counts", $stage_data, [
+			"background_colours" => [
+				"#4CAF50",
+				"#FFEB3B",
+				"#FBC02D",
+				"#FFAB91",
+				"#F44336",
+			],
+			"datalabels" => Chart::DATALABELS_BOX,
+		]);
+		$charts[] = $chart;
+	}
+}
+
+// Region Graphs
+if($has_regions) {
+
+	ksort($region_data, SORT_NATURAL);
+
+	$region_keys = array_keys($region_data);
+
+	$x_data_labels = array_map(function($key) {
+		return "Region $key";
+	}, $region_keys);
+
+	// Region Pass Rate (Selected Date Range)
+	$data_values = [];
+
+	$test_counts = [];
+	$pass_counts = [];
+	$fail_counts = [];
+
+	foreach($region_data as $region => $r_data) {
+		$total_region_test_count = array_sum(array_column($r_data, "testCount"));
+		$total_region_pass_count = array_sum(array_column($r_data, "passCount"));
+
+		$test_counts[] = $total_region_test_count;
+		$pass_counts[] = $total_region_pass_count;
+		$fail_counts[] = $total_region_test_count - $total_region_pass_count;
+
+		$data_values[] = ($total_region_test_count == 0) ? 0 : round(($total_region_pass_count * 100) / $total_region_test_count);
+	}
+
+	$chart = new Chart;
+	$chart->addYAxis([
+		"id" => "y-axis-1",
+		"tick_config" => ["min" => 0, "max" => 100]
+	]);
+	$chart->setType("bar");
+	$chart->setTitle("Region Pass Rate $date_range_label");
+	$chart->setLabels($x_data_labels);
+	$chart->addDataset("Pass %", $data_values , [
+		"background_colours" => "#2196F3"
+	]);
+	$chart->addPrintDataset("Tests", $test_counts);
+	$chart->addPrintDataset("Pass", $pass_counts);
+	$chart->addPrintDataset("Fail", $fail_counts);
+
+	$chart->setDatalabelSuffixes("%");
+	$chart->print = true;
+	$chart->printTotalColumn = true;
+	$charts[] = $chart;
+
+	// Region Pass Rate Period
+	$chart = new Chart;
+	$chart->addYAxis([
+		"id" => "y-axis-1",
+		"tick_config" => ["min" => 0, "max" => 100]
+	]);
+	$chart->setType("bar");
+	$chart->setTitle("Region Pass Rate by $resolution_name");
+	$chart->setLabels($x_data_labels);
+
+	foreach($keys as $index => $key) {
+		$data_values = [];
+		foreach($region_keys as $region) {
+			$r_data = $region_data[$region][$key];
+			$data_values[] = ($r_data->testCount == 0) ? 0 : round(($r_data->passCount * 100) / $r_data->testCount);
+		}
+		$chart->addDataset($key_labels[$index], $data_values, ["background_colours" => $colours[$index]]);
+	}
+	$chart->setDatalabelSuffixes(...array_fill(0, count($keys), "%"));
+
+	$charts[] = $chart;
+
+}
+
+// Area Manager Graphs
+if($has_area_managers) {
+
+	ksort($area_manager_data, SORT_NATURAL);
+
+	$area_manager_keys = array_keys($area_manager_data);
+
+	$x_data_labels = array_map(function($key) {
+		return "$key";
+	}, $area_manager_keys);
+
+	// Area Pass Rate (Selected Date Range)
+	$data_values = [];
+
+	$test_counts = [];
+	$pass_counts = [];
+	$fail_counts = [];
+
+	foreach($area_manager_data as $area_manager => $a_data) {
+		$total_area_manager_test_count = array_sum(array_column($a_data, "testCount"));
+		$total_area_manager_pass_count = array_sum(array_column($a_data, "passCount"));
+		$total_area_manager_fail_count = array_sum(array_column($a_data, "failCount"));
+
+		$test_counts[] = $total_area_manager_test_count;
+		$pass_counts[] = $total_area_manager_pass_count;
+		$fail_counts[] = $total_area_manager_fail_count;
+
+		$data_values[] = ($total_region_test_count == 0) ? 0 : round(($total_area_manager_pass_count * 100) / $total_area_manager_test_count);
+	}
+
+	$chart = new Chart;
+	$chart->addXAxis([
+		"type" => "category",
+		"scale_label_config" => [
+			"display" => true,
+			"labelString" => "Area Manager",
+		]
+	]);
+	$chart->addYAxis([
+		"id" => "y-axis-1",
+		"tick_config" => ["min" => 0, "max" => 100]
+	]);
+	$chart->setType("bar");
+	$chart->setTitle("Area Manager Pass Rate $date_range_label");
+	$chart->setLabels($x_data_labels);
+	$chart->addDataset("Pass %", $data_values , [
+		"background_colours" => "#2196F3"
+	]);
+	$chart->addPrintDataset("Tests", $test_counts);
+	$chart->addPrintDataset("Pass", $pass_counts);
+	$chart->addPrintDataset("Fail", $fail_counts);
+	$chart->setDatalabelSuffixes("%");
+	$chart->print = true;
+	$chart->printTotalColumn = true;
+	$charts[] = $chart;
+
+	// Area Pass Rate Period
+	$chart = new Chart;
+	$chart->addXAxis([
+		"type" => "category",
+		"scale_label_config" => [
+			"display" => true,
+			"labelString" => "Area Manager",
+		]
+	]);
+	$chart->addYAxis([
+		"id" => "y-axis-1",
+		"tick_config" => ["min" => 0, "max" => 100]
+	]);
+	$chart->setType("bar");
+	$chart->setTitle("Area Manager Pass Rate by $resolution_name");
+	$chart->setLabels($x_data_labels);
+
+	foreach($keys as $index => $key) {
+		$data_values = [];
+		foreach($area_manager_keys as $area_manager) {
+			$a_data = $area_manager_data[$area_manager][$key];
+			$data_values[] = ($a_data->testCount == 0) ? 0 : round(($a_data->passCount * 100) / $a_data->testCount);
+		}
+		$chart->addDataset($key_labels[$index], $data_values, [
+			"background_colours" => $colours[$index],
+			"datalabels" => [
+				"display" => false,
+			],
+		]);
+	}
+	$chart->setDatalabelSuffixes(...array_fill(0, count($keys), "%"));
+
+	$charts[] = $chart;
+
+}
+
+?>

+ 62 - 0
template_processing/age_verification_mitchells_butlers/reports_create_empty_objects.php

@@ -0,0 +1,62 @@
+<?php
+
+$empty_data = (object) [
+	"label" => "",
+	"testCount" => 0,
+	"passCount" => 0,
+	"failCount" => 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,
+
+	"testCount" => 0,
+	"passCount" => 0,
+	"failCount" => 0,
+
+	"stage1Count" => 0,
+	"stage2Count" => 0,
+	"stage3Count" => 0,
+	"stage4Count" => 0,
+	"stage5Count" => 0,
+];
+
+?>

+ 70 - 0
template_processing/age_verification_mitchells_butlers/reports_process_test.php

@@ -0,0 +1,70 @@
+<?php
+
+$stage_key = "stage" . $test->challenge_stage . "Count";
+$data[$key]->$stage_key++;
+$total_data->{$stage_key}++;
+
+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++;
+}
+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($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++;
+}
+
+// Genders Comparison
+if($tester->gender == "M") {
+	if($test->challenger_gender == "M") {
+		$data[$key]->maleChallengeMaleCount++;
+		$data[$key]->maleChallengeMaleStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->maleChallengeMalePassCount++;
+	}
+	else if($test->challenger_gender == "F") {
+		$data[$key]->femaleChallengeMaleCount++;
+		$data[$key]->femaleChallengeMaleStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->femaleChallengeMalePassCount++;
+	}
+	else {
+		$data[$key]->unknownChallengeCount++;
+		$data[$key]->unknownChallengeStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->unknownChallengePassCount++;
+	}
+}
+
+if($tester->gender == "F") {
+	if($test->challenger_gender == "M") {
+		$data[$key]->maleChallengeFemaleCount++;
+		$data[$key]->maleChallengeFemaleStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->maleChallengeFemalePassCount++;
+	}
+	else if($test->challenger_gender == "F") {
+		$data[$key]->femaleChallengeFemaleCount++;
+		$data[$key]->femaleChallengeFemaleStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->femaleChallengeFemalePassCount++;
+	}
+	else {
+		$data[$key]->unknownChallengeCount++;
+		$data[$key]->unknownChallengeStages[$test->challenge_stage - 1]++;
+		if($test->pass) $data[$key]->unknownChallengePassCount++;
+	}
+}
+
+?>

+ 1 - 0
template_processing/age_verification_mitchells_butlers/result_email_subject_format.txt

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

+ 347 - 0
template_processing/age_verification_mitchells_butlers/test_pdf.php

@@ -0,0 +1,347 @@
+<?php
+
+$main_y = $pdf->GetY();
+
+// Retest info
+if($test->retest) {
+	$pdf->SetLeftMargin(83);
+	$pdf->SetY(10);
+
+	$pdf->Image("public/img/retest.png", 83, $pdf->GetY(), 63);
+}
+
+$pdf->SetLeftMargin(10);
+$pdf->SetY($main_y);
+
+// Header
+$pdf->SetTextColor(56, 87, 35);
+$pdf->SetFont("Arial", "B", $header_font_size);
+$pdf->Cell(190, 10, " Test Result", 0, 1, "L", true);
+
+// Pass/Fail
+$image_width = 130;
+
+if($test->pass) {
+	$pdf->Image("public/img/pass.png", (210 - $image_width) / 2, $pdf->GetY() + 2, $image_width);
+}
+else {
+	$pdf->Image("public/img/fail.png", (210 - $image_width) / 2, $pdf->GetY() + 2, $image_width);
+}
+
+$pdf->SetY($pdf->GetY() + 30);
+
+$pdf->SetTextColor(56, 87, 35);
+
+// Location / Tester Headers
+$pdf->SetFont("Arial", "B", $header_font_size);
+
+$tester_x = 150;
+$tester_y = $pdf->GetY();
+
+$pdf->Cell(135, 10, $location_text, 0, 1, "L", true);
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial", "", $normal_font_size);
+$pdf->SetTextColor(0, 0, 0);
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+$pdf->Cell(30, $cell_height, "Region / Manager:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Write($cell_height, $location->region);
+$pdf->Write($cell_height, " / ");
+$pdf->Write($cell_height, $location->area_manager);
+$pdf->SetY($pdf->GetY() + $cell_height);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Address:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->MultiCell(100, $cell_height, $location->getDisplayAddress(["address_1", "address_2", "city"], "\n"), 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Postcode:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(100, $cell_height, $location->postal_code, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Shop Name - Left:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(100, $cell_height, $test->shop_left, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Shop Name - Right:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(100, $cell_height, $test->shop_right, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 135, $pdf->GetY());
+
+$test_details_y = $pdf->GetY();
+
+// Tester Info
+$pdf->SetXY($tester_x, $tester_y);
+$pdf->SetLeftMargin(150);
+
+$pdf->SetTextColor(56, 87, 35);
+$pdf->SetFont("Arial", "B", $header_font_size);
+
+$pdf->Cell(50, 10, " Tester", 0, 1, "L", true);
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial", "", $normal_font_size);
+$pdf->SetTextColor(0, 0, 0);
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
+$pdf->Cell(20, $cell_height, "Gender:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(20, $cell_height, $tester->getGenderText(), 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
+
+$pdf->Cell(20, $cell_height, "Attire:", 0, 1);
+$pdf->SetX(150);
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->MultiCell(50, 4, $test->attire, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 50, $pdf->GetY());
+
+
+// Test Details
+$pdf->SetLeftMargin(10);
+
+$pdf->setXY(10, $test_details_y + 2);
+
+$pdf->SetTextColor(56, 87, 35);
+$pdf->SetFont("Arial", "B", $header_font_size);
+
+$pdf->Cell(190, 10, " Test Details", 0, 1, "L", true);
+$pdf->SetY($pdf->GetY() + 2);
+
+// Date / Time
+$id_requests_y = $pdf->GetY();
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->SetTextColor(0, 0, 0);
+
+$pdf->Cell(95, $cell_height, "Date & Time", 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial");
+
+$pdf->Cell(23, $cell_height, "Date");
+$pdf->Cell(23, $cell_height, "Entry");
+$pdf->Cell(23, $cell_height, "Exit");
+$pdf->Cell(23, $cell_height, "Duration", 0, 1);
+
+$pdf->SetFont("Arial", "", $small_font_size);
+
+$pdf->Cell(23, $cell_height, $date_start);
+$pdf->Cell(23, $cell_height, $time_start);
+$pdf->Cell(23, $cell_height, $time_end);
+$pdf->Cell(23, $cell_height, str_pad($diff->h, 2, "0", STR_PAD_LEFT) . ":" . str_pad($diff->i, 2, "0", STR_PAD_LEFT) . ":" . str_pad($diff->s, 2, "0", STR_PAD_LEFT), 0, 1);
+
+$pdf->SetY($pdf->GetY() + 2);
+
+// Staff
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(95, $cell_height, "Staff", 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial");
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+$pdf->Cell(30, $cell_height, "Name:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(57.5, $cell_height, $test->challenger_name, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Gender:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(57.5, $cell_height, $test->challenger_gender, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Description:", 0, 1);
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->MultiCell(90, 4, $test->challenger_description, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(95, $cell_height, "Tester's Notes", 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+$pdf->SetFont("Arial");
+
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->MultiCell(90, 4, Util::convertUTF8($test->additional_notes), 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+
+// Challenge
+$pdf->SetLeftMargin(107.5);
+$pdf->SetY($id_requests_y);
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(95, $cell_height, "ID Request", 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+$pdf->SetFont("Arial");
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "Result:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(60, $cell_height, $test->getPassText(), 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell(30, $cell_height, "ID Stage:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(60, $cell_height, $test->challenge_stage . " - " . $test->getChallengeStageText(), 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->SetTextColor(0, 128, 0);
+$pdf->MultiCell(95, 4, "1: Challenge on entry", 0, 1);
+
+$pdf->SetTextColor(255, 128, 0);
+$pdf->MultiCell(95, 4, "2: Challenge while browsing
+3: Challenge during play", 0, 1);
+
+$pdf->SetTextColor(255, 0, 0);
+
+$pdf->MultiCell(95, 4, "4: Challenge on exit
+5: No challenge", 0, 1);
+
+$pdf->SetFont("Arial", "", $normal_font_size);
+$pdf->SetTextColor(0, 0, 0);
+
+$pdf->SetY($pdf->GetY() + 2);
+
+$pdf->SetFont("Arial", "", $normal_font_size);
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+$pdf->Cell(30, $cell_height, "Eye Contact:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell(60, $cell_height, $test->challenger_eye_contact ? "Y" : "N", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell(95, $cell_height, "Description:", 0, 1);
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->MultiCell(90, 4, $test->challenge_description, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->SetY($pdf->GetY() + 2);
+
+// Details / Signage
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(95, $cell_height, "Play Details & Signage", 0, 1);
+$pdf->SetY($pdf->GetY() + 2);
+$pdf->SetFont("Arial");
+
+$field_width = 50;
+$value_width = 40;
+
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell($field_width, $cell_height, "Machine Played:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $values["play_machine"] ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+// Machine Position
+$value = $values["play_machine_position"] ?? "N/A";
+
+$pdf->Cell($field_width, $cell_height, "Machine Position:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+// Machine Line of Sight
+$value = $values["play_machine_line_of_sight"] ?? "";
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
+$pdf->Cell($field_width, $cell_height, "Line of Sight of Bar:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+// Jackpot Value
+$value = $values["play_jackpot"] ?? "N/A";
+if($value != "N/A") $value = "\xa3" . number_format($value);
+
+$pdf->Cell($field_width, $cell_height, "Jackpot Value:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+// Stake Played
+$value = $values["play_machine_stake"] ?? "N/A";
+if($value != "N/A") $value = "\xa3" . number_format($value, 2);
+
+$pdf->Cell($field_width, $cell_height, "Stake Played:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell($field_width, $cell_height, "Minutes Played:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $values["play_minutes"] ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$value = $values["play_spent"] ?? "N/A";
+if($value != "N/A") $value = "\xa3" . number_format($value, 2);
+
+$pdf->Cell($field_width, $cell_height, "Amount Spent:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value, 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell($field_width, $cell_height, "Think 21/25:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $values["think_21_25"] ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$value = $values["citizen_card_brochure_displayed"] ?? "";
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
+$pdf->Cell($field_width, $cell_height, "Citizen Card Brochure Displayed:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$value = $values["think_21_badge"] ?? "";
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
+$pdf->Cell($field_width, $cell_height, "Think 21/25 Badge Worn by Staff:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$value = $values["think_21_poster"] ?? "";
+if(strlen($value) > 0) $value = $value ? "Yes" : "No";
+
+$pdf->Cell($field_width, $cell_height, "Think 21/25 Posters Displayed:", 0, 0);
+$pdf->SetX($pdf->GetX() + 5);
+$pdf->Cell($value_width, $cell_height, $value ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+$pdf->Cell($field_width, $cell_height, "Think 21/25 Poster Notes:", 0, 1);
+$pdf->SetFont("Arial", "", $small_font_size);
+$pdf->MultiCell(95, 4, $values["think_21_poster_notes"] ?? "N/A", 0, 1);
+$pdf->Line($pdf->GetX(), $pdf->GetY(), $pdf->GetX() + 92.5, $pdf->GetY());
+
+// Footer
+$pdf->SetLeftMargin(10);
+
+$pdf->SetY(265);
+
+$pdf->SetFillColor(0, 146, 69);
+$pdf->Rect($pdf->GetX(), $pdf->GetY(), 190, 1, "DF");
+
+$pdf->SetY($pdf->GetY() + 6);
+
+$pdf->SetFont("Arial", "B", $normal_font_size);
+$pdf->Cell(0, $cell_height, "Check Policy Limited");
+$pdf->SetY($pdf->GetY() + $cell_height);
+$pdf->SetFont("Arial", "", $normal_font_size);
+$pdf->Cell(0, $cell_height, "8 Market Street, Liskeard, Cornwall, PL14 3JJ");
+$pdf->SetY($pdf->GetY() + $cell_height);
+$pdf->Cell(0, $cell_height, "Company Number: 09506865");
+
+?>