"Quarterly",
"monthly" => "Monthly",
];
$date_ranges = [
"ytd" => "Year to Date",
//"unbound" => "Unbound",
"custom" => "Custom",
];
$retests_options = [
0 => "Exclude",
1 => "Retests Only"
];
$years = range(2018, date("Y"));
$date_range_custom_style = ($date_range === "custom") ? "" : "display: none";
$date_range_value = "";
if($date_start && $date_end) {
[$min_year, $min_month, $min_day] = explode("-", $date_start);
[$max_year, $max_month, $max_day] = explode("-", $date_end);
$date_range_value = "$min_day/$min_month/$min_year - $max_day/$max_month/$max_year";
}
$collator = new Collator("en_GB");
if($charts) {
$brands = array_keys($brand_data);
$regions = array_keys($region_data);
$area_managers = array_keys($area_manager_data);
$operations_managers = array_keys($operations_manager_data);
}
else {
$brands = $customer->getBrands();
$regions = $customer->getRegions();
$area_managers = $customer->getAreaManagerNames();
$operations_managers = $customer->getOperationsManagerNames();
}
$gaming_managers = $customer->getGamingManagerNames();
$senior_gaming_managers = $customer->getSeniorGamingManagerNames();
$collator->sort($brands);
$collator->sort($regions);
$collator->sort($area_managers);
$collator->sort($operations_managers);
$project_options = [];
foreach($project_table_data as $project_data) {
$project_options[$project_data["id"]] = $project_data["name"];
}
?>
=htmlspecialchars($customer->name)?> Reports
canSeeMissingData()) {
/**
* @param string $field
* @param Location[] $locations
* @return void
*/
$render_locations_missing_data = static function(string $field, array $locations): void {
?>
There are some locations that are missing "=htmlspecialchars($field)?>" information:
Report
Retests Excluded
Retests Only
Retests Included
0) {
$pass_percentage = number_format(($pass * 100) / $total, 2);
}
?>
| =htmlspecialchars($title)?> |
=$total?> |
=$pass?> |
=$fail?> |
=$pass_percentage?>% |
=$void?> |
testCount + $total_data->voidCount;
?>
=htmlspecialchars(__("Numbers"))?>
=htmlspecialchars(n__("%d Visit", "%d Visits", $visit_count, $visit_count))?>
| =htmlspecialchars(__("Type"))?> |
=htmlspecialchars(__("Total"))?> |
=htmlspecialchars(__("Passes"))?> |
=htmlspecialchars(__("Fails"))?> |
=htmlspecialchars(__("Pass Rate"))?> |
=htmlspecialchars(__("Voids"))?> |
| =htmlspecialchars(__("Venue Tests"))?> |
=htmlspecialchars($total_data->testCount)?> |
|
|
|
=htmlspecialchars($total_data->voidCount)?> |
passCount)) {
$pass_count = $total_data->passCount;
$fail_count = $total_data->failCount;
$void_count = $total_data->gamingCounts["void"] ?? 0;
$render_pass_fail_row(__("Gaming Tests"), $pass_count, $fail_count, $void_count);
}
if(isset($total_data->barCounts)) {
$pass_count = $total_data->barCounts["pass"];
$fail_count = $total_data->barCounts["fail"];
$void_count = $total_data->barCounts["void"] ?? 0;
$render_pass_fail_row(__("Alcohol Tests"), $pass_count, $fail_count, $void_count);
}
if(isset($total_data->combinedCounts) || isset($total_data->blendedCounts) || isset($total_data->mergedCounts)) {
?>
| =htmlspecialchars(__("Aggregate Counts"))?> |
combinedCounts)) {
$render_pass_fail_row(__("Gaming and Alcohol"), $total_data->combinedCounts["pass"], $total_data->combinedCounts["fail"], $total_data->combinedCounts["void"] ?? 0);
}
if(isset($total_data->blendedCounts)) {
$render_pass_fail_row(__("Gaming and Assumed Alcohol"), $total_data->blendedCounts["pass"], $total_data->blendedCounts["fail"], $total_data->blendedCounts["void"] ?? 0);
}
if(isset($total_data->mergedCounts)) {
$render_pass_fail_row(__("Gaming or Alcohol Pass"), $total_data->mergedCounts["pass"], $total_data->mergedCounts["fail"], $total_data->mergedCounts["void"] ?? 0);
}
}
?>
=htmlspecialchars(__("Numbers Explained"))?>
| =htmlspecialchars(__("Type"))?> |
=htmlspecialchars(__("Description"))?> |
| =htmlspecialchars(__("Venue Tests"))?> |
=htmlspecialchars(__("There were %d tests of which %d were voids resulting in %d gaming tests being carried out.", $total_data->testCount + $total_data->voidCount, $total_data->voidCount, $total_data->testCount))?> |
passCount)) {
$pass_count = $total_data->passCount;
$fail_count = $total_data->failCount;
$void_count = $total_data->gamingCounts["void"] ?? 0;
?>
| =htmlspecialchars(__("Gaming Tests"))?> |
=htmlspecialchars(__("There were %d gaming tests of which there were %d passes and %d fails and %d voids.", ($pass_count + $fail_count + $void_count), $pass_count, $fail_count, $void_count))?> |
barCounts)) {
$gaming_stage_5 = $total_data->stage5Count ?? 0;
$gaming_void_count = $total_data->gamingCounts["void"] ?? 0;
$pass_count = $total_data->barCounts["pass"];
$fail_count = $total_data->barCounts["fail"];
$void_count = $total_data->barCounts["void"] ?? 0;
$explainer = __("There were %d alcohol tests which come from %d gaming tests that ended up in Stage 5 plus %d gaming tests that were void. Of these alcohol tests there were %d passes and %d fails and %d voids.", ($pass_count + $fail_count + $void_count), $gaming_stage_5, $gaming_void_count, $pass_count, $fail_count, $void_count);
?>
| =htmlspecialchars(__("Alcohol Tests"))?> |
=htmlspecialchars(__("There were %d alcohol tests which come from %d gaming tests that ended up in Stage 5 plus %d gaming tests that were void. Of these alcohol tests there were %d passes and %d fails and %d voids.", ($pass_count + $fail_count + $void_count), $gaming_stage_5, $gaming_void_count, $pass_count, $fail_count, $void_count))?> |
combinedCounts) || isset($total_data->blendedCounts) || isset($total_data->mergedCounts)) {
?>
| =htmlspecialchars(__("Aggregate Counts"))?> |
combinedCounts)) {
?>
| =htmlspecialchars(__("Gaming and Alcohol"))?> |
=htmlspecialchars(__("The gaming and alcohol tests added together."))?> |
blendedCounts)) {
?>
| =htmlspecialchars(__("Gaming and Assumed Alcohol"))?> |
=htmlspecialchars(__("The gaming and alcohol tests added together but also assuming that any gaming test pass is also an alcohol test pass. %d passes were added.", $total_data->passCount))?> |
mergedCounts)) {
$gaming_stage_3 = $total_data->stage3Count ?? 0;
$gaming_stage_4 = $total_data->stage4Count ?? 0;
?>
| =htmlspecialchars(__("Gaming or Alcohol Pass"))?> |
=htmlspecialchars(__("The gaming and alcohol passes added together. %d tests either passed the gaming test or alcohol test. There were %d outright fails: %d were caught at Stage 3, %d were caught at Stage 4 and %d failed the alcohol test.", $total_data->mergedCounts["pass"], $total_data->mergedCounts["fail"], $gaming_stage_3, $gaming_stage_4, $total_data->barCounts["fail"]))?> |
=htmlspecialchars(__("Challenge Stage Reference"))?>
| =htmlspecialchars(__("Stage"))?> |
=htmlspecialchars(__("Description"))?> |
$description) {
?>
| =htmlspecialchars(__("Stage %d", $stage))?> |
=htmlspecialchars($description)?> |
$chart) {
if($project_id && $chart->isPeriodic()) {
continue;
}
if($index > 0) {
?>
beforeHtml) {
echo $chart->beforeHtml;
}
?>
print) {
$chart->printDataTable();
}
if($chart->afterHtml) {
echo $chart->afterHtml;
}
}
?>
$customer->getRegionLabel(1),
"data" => $region_data
],
(object) [
"name" => $customer->getAreaManagerLabel(1),
"data" => $area_manager_data
],
(object) [
"name" => $customer->getOperationsManagerLabel(1),
"data" => $operations_manager_data
],
(object) [
"name" => $customer->getBrandLabel(1),
"data" => $brand_data
],
(object) [
"name" => $customer->getGamingManagerLabel(1),
"data" => $gaming_manager_data
],
(object) [
"name" => $customer->getSeniorGamingManagerLabel(1),
"data" => $senior_gaming_manager_data
],
]
?>
Extra Information
name . " Data";
$entity_type = $table->name;
// Calculate totals
$totals = [];
foreach($table->data as $entity_name => $rows) {
$totals[] = [
"name" => $entity_name,
"testCount" => array_sum(array_column($rows, "testCount")),
"passCount" => array_sum(array_column($rows, "passCount")),
"failCount" => array_sum(array_column($rows, "failCount")),
];
}
if(!$totals) {
continue;
}
?>
=htmlspecialchars($title)?>
=htmlspecialchars($entity_type)?>: Totals
| =htmlspecialchars($title)?> |
Tests |
Passes |
Fails |
Rate |
| =htmlspecialchars($data["name"])?> |
=number_format($data["testCount"])?> |
=number_format($data["passCount"])?> |
=number_format($data["failCount"])?> |
=$rate?>% |
|
Total
|
=number_format($total_test_count)?>
|
=number_format($total_pass_count)?>
|
=number_format($total_fail_count)?>
|
=$total_rate?>% |
data as $entity_name => $rows) {
?>
=htmlspecialchars($entity_type)?>: =htmlspecialchars($entity_name)?>
| Period |
Tests |
Passes |
Fails |
Rate |
$data) {
$rate = ($data->testCount == 0) ? "0.00" : number_format(($data->passCount * 100) / $data->testCount, 2);
$label = $key_labels[$index];
?>
| =htmlspecialchars($label)?> |
=number_format($data->testCount)?> |
=number_format($data->passCount)?> |
=number_format($data->failCount)?> |
=$rate?>% |