|
|
@@ -1,53 +1,130 @@
|
|
|
-<?php
|
|
|
+<?php /** @noinspection PhpUnhandledExceptionInspection */
|
|
|
|
|
|
/**
|
|
|
* @var ChartGenerator $generator
|
|
|
* @var Template $template
|
|
|
+ * @var array $exclude_categories
|
|
|
*/
|
|
|
|
|
|
-$charts[] = $generator->getTestsByStageChart(["1 - On Entry", "2 - While Browsing", "3 - During Play", "4 - After Play", "5 - No Challenge"], __("Gaming Tests by Stage"));
|
|
|
-//$charts[] = $generator->getChallengerGenderChart();
|
|
|
-//$charts[] = $generator->getTesterGenderChart();
|
|
|
-$charts[] = $generator->getPassFailCountChart(__("Gaming Pass / Fail"));
|
|
|
-$charts[] = $generator->getPassFailCountChartByKey(__("Alcohol Age Verification"), "barAgeVerificationCounts");
|
|
|
-$charts[] = $generator->getPassFailCountChartByKey(__("Alcohol Pass / Fail"), "barCounts");
|
|
|
+$charts = [];
|
|
|
+
|
|
|
+$tests_by_stage_chart = $generator->getTestsByStageChart(["1 - On Entry", "2 - While Browsing", "3 - During Play", "4 - After Play", "5 - No Challenge"], __("Gaming Tests by Stage"));
|
|
|
+$tests_by_stage_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $tests_by_stage_chart;
|
|
|
+
|
|
|
+$challenge_gender_chart = $generator->getChallengerGenderChart();
|
|
|
+$challenge_gender_chart->setCategories(["All", "Gaming", "Gender"]);
|
|
|
+$charts[] = $challenge_gender_chart;
|
|
|
+
|
|
|
+$tester_gender_chart = $generator->getTesterGenderChart();
|
|
|
+$tester_gender_chart->setCategories(["All", "Gaming", "Gender"]);
|
|
|
+$charts[] = $tester_gender_chart;
|
|
|
+
|
|
|
+$gaming_pass_fail_chart = $generator->getPassFailCountChart(__("Gaming Pass / Fail"));
|
|
|
+$gaming_pass_fail_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $gaming_pass_fail_chart;
|
|
|
+
|
|
|
+$alcohol_age_verification_chart = $generator->getPassFailCountChartByKey(__("Alcohol Age Verification"), "barAgeVerificationCounts");
|
|
|
+$alcohol_age_verification_chart->setCategories(["All", "Alcohol"]);
|
|
|
+$charts[] = $alcohol_age_verification_chart;
|
|
|
+
|
|
|
+$alcohol_pass_fail_chart = $generator->getPassFailCountChartByKey(__("Alcohol Pass / Fail"), "barCounts");
|
|
|
+$alcohol_pass_fail_chart->setCategories(["All", "Alcohol"]);
|
|
|
+$charts[] = $alcohol_pass_fail_chart;
|
|
|
|
|
|
if(!empty($venue_type_data)) {
|
|
|
- $charts[] = ChartGenerator::getVenueTypePassFailChart($venue_type_data);
|
|
|
- $charts = array_merge($charts, $generator->getVenueTypeChallengeStagePieCharts($venue_type_data));
|
|
|
+ $venue_type_pass_fail_chart = ChartGenerator::getVenueTypePassFailChart($venue_type_data);
|
|
|
+ $venue_type_pass_fail_chart->setCategories(["All", "Gaming", "Venue Type"]);
|
|
|
+ $charts[] = $venue_type_pass_fail_chart;
|
|
|
|
|
|
- $chart = $generator->getVenueTypeChallengeStageStackedBarChart($venue_type_data);
|
|
|
- if($chart) {
|
|
|
- $charts[] = $chart;
|
|
|
+ foreach($generator->getVenueTypeChallengeStagePieCharts($venue_type_data) as $venue_type_challenge_stage_chart) {
|
|
|
+ $venue_type_challenge_stage_chart->setCategories(["All", "Gaming", "Venue Type"]);
|
|
|
+ $charts[] = $venue_type_challenge_stage_chart;
|
|
|
+ }
|
|
|
+
|
|
|
+ $venue_type_challenge_stage_stacked_chart = $generator->getVenueTypeChallengeStageStackedBarChart($venue_type_data);
|
|
|
+ if($venue_type_challenge_stage_stacked_chart) {
|
|
|
+ $venue_type_challenge_stage_stacked_chart->setCategories(["All", "Gaming", "Venue Type"]);
|
|
|
+ $charts[] = $venue_type_challenge_stage_stacked_chart;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-$charts[] = $generator->getPeriodicPassFailRateChart(__("Gaming Pass / Fail"));
|
|
|
-//$charts[] = $generator->getPeriodicEyeContactChart();
|
|
|
-//$charts[] = $generator->getPeriodicEyeContactPassRateChart();
|
|
|
-$charts[] = $generator->getPeriodicLineOfSightPassRateChart([
|
|
|
+$periodic_pass_fail_chart = $generator->getPeriodicPassFailRateChart(__("Gaming Pass / Fail"));
|
|
|
+$periodic_pass_fail_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $periodic_pass_fail_chart;
|
|
|
+
|
|
|
+$periodic_eye_contact_chart = $generator->getPeriodicEyeContactChart();
|
|
|
+$periodic_eye_contact_chart->setCategories(["All", "Gaming", "Eye Contact"]);
|
|
|
+$charts[] = $periodic_eye_contact_chart;
|
|
|
+
|
|
|
+$periodic_eye_contact_pass_rate_chart = $generator->getPeriodicEyeContactPassRateChart();
|
|
|
+$periodic_eye_contact_pass_rate_chart->setCategories(["All", "Gaming", "Eye Contact"]);
|
|
|
+$charts[] = $periodic_eye_contact_pass_rate_chart;
|
|
|
+
|
|
|
+$periodic_line_of_sight_pass_rate_chart = $generator->getPeriodicLineOfSightPassRateChart([
|
|
|
"title" => __("Gaming Pass Rate by Line of Sight"),
|
|
|
"include_no_challenge" => false
|
|
|
]);
|
|
|
-$charts[] = $generator->getPeriodicPassRateChartByKey(__("Alcohol Age Verification Rate"), "barAgeVerificationCounts");
|
|
|
-$charts[] = $generator->getPeriodicPassRateChartByKey(__("Alcohol Pass Rate"), "barCounts");
|
|
|
-$charts[] = $generator->getPeriodicTotalsChart(__("Gaming Totals"));
|
|
|
-$charts = array_merge($charts, $generator->getPointOfChallengeCharts("Gaming %s Point of Challenge", ["On Entry", "While Browsing", "During Play", "After Play", "No Challenge"]));
|
|
|
-//$charts[] = $generator->getPeriodicTesterGenderChart();
|
|
|
-$charts[] = $generator->getPeriodicTestCountChart(__("Gaming Tests"));
|
|
|
-//$charts = array_merge($charts, $generator->getGenderComparisonCharts());
|
|
|
-
|
|
|
-if($generator->hasRegionData()) {
|
|
|
-// $charts[] = $generator->getRegionPassRateChart();
|
|
|
-// $charts[] = $generator->getPeriodicRegionPassRateChart();
|
|
|
+$periodic_line_of_sight_pass_rate_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $periodic_line_of_sight_pass_rate_chart;
|
|
|
+
|
|
|
+$periodic_alcohol_age_verification_rate_chart = $generator->getPeriodicPassRateChartByKey(__("Alcohol Age Verification Rate"), "barAgeVerificationCounts");
|
|
|
+$periodic_alcohol_age_verification_rate_chart->setCategories(["All", "Alcohol"]);
|
|
|
+$charts[] = $periodic_alcohol_age_verification_rate_chart;
|
|
|
+
|
|
|
+$periodic_alcohol_pass_rate_chart = $generator->getPeriodicPassRateChartByKey(__("Alcohol Pass Rate"), "barCounts");
|
|
|
+$periodic_alcohol_pass_rate_chart->setCategories(["All", "Alcohol"]);
|
|
|
+$charts[] = $periodic_alcohol_pass_rate_chart;
|
|
|
+
|
|
|
+$periodic_gaming_totals_chart = $generator->getPeriodicTotalsChart(__("Gaming Totals"));
|
|
|
+$periodic_gaming_totals_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $periodic_gaming_totals_chart;
|
|
|
+
|
|
|
+foreach($generator->getPointOfChallengeCharts("Gaming %s Point of Challenge", ["On Entry", "While Browsing", "During Play", "After Play", "No Challenge"]) as $gaming_point_of_challenge_chart) {
|
|
|
+ $gaming_point_of_challenge_chart->setCategories(["All", "Gaming"]);
|
|
|
+ $charts[] = $gaming_point_of_challenge_chart;
|
|
|
+}
|
|
|
+
|
|
|
+$periodic_test_count_chart = $generator->getPeriodicTestCountChart(__("Gaming Tests"));
|
|
|
+$periodic_test_count_chart->setCategories(["All", "Gaming"]);
|
|
|
+$charts[] = $periodic_test_count_chart;
|
|
|
+
|
|
|
+$periodic_tester_gender_chart = $generator->getPeriodicTesterGenderChart();
|
|
|
+$periodic_tester_gender_chart->setCategories(["All", "Gaming", "Gender"]);
|
|
|
+$charts[] = $periodic_tester_gender_chart;
|
|
|
+
|
|
|
+foreach($generator->getGenderComparisonCharts() as $gender_comparison_chart) {
|
|
|
+ $gender_comparison_chart->setCategories(["All", "Gaming", "Gender"]);
|
|
|
+ $charts[] = $gender_comparison_chart;
|
|
|
}
|
|
|
|
|
|
if($generator->hasAreaManagerData()) {
|
|
|
- $charts[] = $generator->getAreaManagerPassRateChart();
|
|
|
- $charts[] = $generator->getPeriodicAreaManagerPassRateChart();
|
|
|
+ $area_manager_pass_rate_chart = $generator->getAreaManagerPassRateChart();
|
|
|
+ $area_manager_pass_rate_chart->setCategories(["All", "Gaming", "Area Manager"]);
|
|
|
+ $charts[] = $area_manager_pass_rate_chart;
|
|
|
+
|
|
|
+ $periodic_area_manager_pass_rate_chart = $generator->getPeriodicAreaManagerPassRateChart();
|
|
|
+ $periodic_area_manager_pass_rate_chart->setCategories(["All", "Gaming", "Area Manager"]);
|
|
|
+ $charts[] = $periodic_area_manager_pass_rate_chart;
|
|
|
}
|
|
|
|
|
|
if($generator->hasBrandData()) {
|
|
|
- $charts[] = $generator->getBrandPassRateChart();
|
|
|
- $charts[] = $generator->getPeriodicBrandPassRateChart();
|
|
|
+ $brand_pass_rate_chart = $generator->getBrandPassRateChart();
|
|
|
+ $brand_pass_rate_chart->setCategories(["All", "Gaming", "Brand"]);
|
|
|
+ $charts[] = $brand_pass_rate_chart;
|
|
|
+
|
|
|
+ $periodic_brand_pass_rate_chart = $generator->getPeriodicBrandPassRateChart();
|
|
|
+ $periodic_brand_pass_rate_chart->setCategories(["All", "Gaming", "Brand"]);
|
|
|
+ $charts[] = $periodic_brand_pass_rate_chart;
|
|
|
}
|
|
|
+
|
|
|
+$charts = array_filter($charts, static function(Chart $chart) use ($exclude_categories) {
|
|
|
+ foreach($exclude_categories as $exclude_category) {
|
|
|
+ $categories = $chart->getCategories();
|
|
|
+ if(in_array($exclude_category, $categories)) {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ return true;
|
|
|
+});
|