|
@@ -198,8 +198,10 @@ if($submit) {
|
|
|
|
|
|
|
|
"maleTesterCount" => 0,
|
|
"maleTesterCount" => 0,
|
|
|
"femaleTesterCount" => 0,
|
|
"femaleTesterCount" => 0,
|
|
|
|
|
+
|
|
|
"maleChallengerCount" => 0,
|
|
"maleChallengerCount" => 0,
|
|
|
"femaleChallengerCount" => 0,
|
|
"femaleChallengerCount" => 0,
|
|
|
|
|
+ "unspecifiedChallengerCount" => 0,
|
|
|
|
|
|
|
|
"maleChallengeMaleCount" => 0,
|
|
"maleChallengeMaleCount" => 0,
|
|
|
"maleChallengeMalePassCount" => 0,
|
|
"maleChallengeMalePassCount" => 0,
|
|
@@ -223,8 +225,11 @@ if($submit) {
|
|
|
$total_data = (object) [
|
|
$total_data = (object) [
|
|
|
"maleTesterCount" => 0,
|
|
"maleTesterCount" => 0,
|
|
|
"femaleTesterCount" => 0,
|
|
"femaleTesterCount" => 0,
|
|
|
|
|
+
|
|
|
"maleChallengerCount" => 0,
|
|
"maleChallengerCount" => 0,
|
|
|
"femaleChallengerCount" => 0,
|
|
"femaleChallengerCount" => 0,
|
|
|
|
|
+ "unspecifiedChallengerCount" => 0,
|
|
|
|
|
+
|
|
|
"testCount" => 0,
|
|
"testCount" => 0,
|
|
|
"passCount" => 0,
|
|
"passCount" => 0,
|
|
|
"failCount" => 0,
|
|
"failCount" => 0,
|
|
@@ -378,10 +383,15 @@ if($submit) {
|
|
|
$data[$key]->maleChallengerCount++;
|
|
$data[$key]->maleChallengerCount++;
|
|
|
$total_data->maleChallengerCount++;
|
|
$total_data->maleChallengerCount++;
|
|
|
}
|
|
}
|
|
|
- if($test->challenger_gender == "F") {
|
|
|
|
|
|
|
+ else if($test->challenger_gender == "F") {
|
|
|
$data[$key]->femaleChallengerCount++;
|
|
$data[$key]->femaleChallengerCount++;
|
|
|
$total_data->femaleChallengerCount++;
|
|
$total_data->femaleChallengerCount++;
|
|
|
}
|
|
}
|
|
|
|
|
+ else {
|
|
|
|
|
+ $data[$key]->unspecifiedChallengerCount++;
|
|
|
|
|
+ $total_data->unspecifiedChallengerCount++;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
if($tester->gender == "M") {
|
|
if($tester->gender == "M") {
|
|
|
if($test->challenger_gender == "M") {
|
|
if($test->challenger_gender == "M") {
|
|
@@ -443,10 +453,7 @@ if($submit) {
|
|
|
"#FFAB91",
|
|
"#FFAB91",
|
|
|
"#F44336",
|
|
"#F44336",
|
|
|
],
|
|
],
|
|
|
- "datalabels" => [
|
|
|
|
|
- "backgroundColor" => "rgba(0, 0, 0, 0.75)",
|
|
|
|
|
- "borderRadius" => "2",
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ "datalabels" => Chart::DATALABELS_BOX,
|
|
|
]);
|
|
]);
|
|
|
$chart->setPrintSuffixes("");
|
|
$chart->setPrintSuffixes("");
|
|
|
$chart->print = true;
|
|
$chart->print = true;
|
|
@@ -460,17 +467,19 @@ if($submit) {
|
|
|
$chart = new Chart;
|
|
$chart = new Chart;
|
|
|
$chart->setType("pie");
|
|
$chart->setType("pie");
|
|
|
$chart->setTitle("Staff Gender $date_range_label");
|
|
$chart->setTitle("Staff Gender $date_range_label");
|
|
|
- $chart->setLabels(["Male", "Female"]);
|
|
|
|
|
|
|
+ $chart->setLabels(["Male", "Female", "Unspecified"]);
|
|
|
$chart->addDataset("Counts", [
|
|
$chart->addDataset("Counts", [
|
|
|
$total_data->maleChallengerCount,
|
|
$total_data->maleChallengerCount,
|
|
|
$total_data->femaleChallengerCount,
|
|
$total_data->femaleChallengerCount,
|
|
|
|
|
+ $total_data->unspecifiedChallengerCount,
|
|
|
], [
|
|
], [
|
|
|
"background_colours" => [
|
|
"background_colours" => [
|
|
|
"#2196F3",
|
|
"#2196F3",
|
|
|
"#E91E63",
|
|
"#E91E63",
|
|
|
- ]
|
|
|
|
|
|
|
+ "#9E9E9E",
|
|
|
|
|
+ ],
|
|
|
|
|
+ "datalabels" => Chart::DATALABELS_BOX,
|
|
|
]);
|
|
]);
|
|
|
- $chart->setDatalabelSuffixes(" Test");
|
|
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
|
|
|
|
|
// Tester Gender
|
|
// Tester Gender
|
|
@@ -485,9 +494,9 @@ if($submit) {
|
|
|
"background_colours" => [
|
|
"background_colours" => [
|
|
|
"#2196F3",
|
|
"#2196F3",
|
|
|
"#E91E63",
|
|
"#E91E63",
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ "datalabels" => Chart::DATALABELS_BOX,
|
|
|
]);
|
|
]);
|
|
|
- $chart->setDatalabelSuffixes(" Test");
|
|
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
|
|
|
|
|
// Pass / Fail
|
|
// Pass / Fail
|
|
@@ -502,9 +511,9 @@ if($submit) {
|
|
|
"background_colours" => [
|
|
"background_colours" => [
|
|
|
"#4CAF50",
|
|
"#4CAF50",
|
|
|
"#F44336",
|
|
"#F44336",
|
|
|
- ]
|
|
|
|
|
|
|
+ ],
|
|
|
|
|
+ "datalabels" => Chart::DATALABELS_BOX,
|
|
|
]);
|
|
]);
|
|
|
- $chart->setDatalabelSuffixes(" Test");
|
|
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
|
|
|
|
|
// Pass Rate Period
|
|
// Pass Rate Period
|
|
@@ -628,10 +637,7 @@ if($submit) {
|
|
|
"#FFAB91",
|
|
"#FFAB91",
|
|
|
"#F44336",
|
|
"#F44336",
|
|
|
],
|
|
],
|
|
|
- "datalabels" => [
|
|
|
|
|
- "backgroundColor" => "rgba(0, 0, 0, 0.75)",
|
|
|
|
|
- "borderRadius" => "2",
|
|
|
|
|
- ],
|
|
|
|
|
|
|
+ "datalabels" => Chart::DATALABELS_BOX,
|
|
|
]);
|
|
]);
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
}
|
|
}
|
|
@@ -695,10 +701,19 @@ if($submit) {
|
|
|
|
|
|
|
|
// Region Pass Rate (Selected Date Range)
|
|
// Region Pass Rate (Selected Date Range)
|
|
|
$data_values = [];
|
|
$data_values = [];
|
|
|
|
|
+
|
|
|
|
|
+ $test_counts = [];
|
|
|
|
|
+ $pass_counts = [];
|
|
|
|
|
+ $fail_counts = [];
|
|
|
|
|
+
|
|
|
foreach($region_data as $region => $r_data) {
|
|
foreach($region_data as $region => $r_data) {
|
|
|
$total_region_test_count = array_sum(array_column($r_data, "testCount"));
|
|
$total_region_test_count = array_sum(array_column($r_data, "testCount"));
|
|
|
$total_region_pass_count = array_sum(array_column($r_data, "passCount"));
|
|
$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);
|
|
$data_values[] = ($total_region_test_count == 0) ? 0 : round(($total_region_pass_count * 100) / $total_region_test_count);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -710,10 +725,15 @@ if($submit) {
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("Region Pass Rate $date_range_label");
|
|
$chart->setTitle("Region Pass Rate $date_range_label");
|
|
|
$chart->setLabels($x_data_labels);
|
|
$chart->setLabels($x_data_labels);
|
|
|
- $chart->addDataset("Pass Rate (%)", $data_values , [
|
|
|
|
|
|
|
+ $chart->addDataset("Pass %", $data_values , [
|
|
|
"background_colours" => "#2196F3"
|
|
"background_colours" => "#2196F3"
|
|
|
]);
|
|
]);
|
|
|
|
|
+ $chart->addPrintDataset("Tests", $test_counts);
|
|
|
|
|
+ $chart->addPrintDataset("Pass", $pass_counts);
|
|
|
|
|
+ $chart->addPrintDataset("Fail", $fail_counts);
|
|
|
|
|
+
|
|
|
$chart->setDatalabelSuffixes("%");
|
|
$chart->setDatalabelSuffixes("%");
|
|
|
|
|
+ $chart->print = true;
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
|
|
|
|
|
// Region Pass Rate Period
|
|
// Region Pass Rate Period
|
|
@@ -752,11 +772,20 @@ if($submit) {
|
|
|
|
|
|
|
|
// Area Pass Rate (Selected Date Range)
|
|
// Area Pass Rate (Selected Date Range)
|
|
|
$data_values = [];
|
|
$data_values = [];
|
|
|
|
|
+
|
|
|
|
|
+ $test_counts = [];
|
|
|
|
|
+ $pass_counts = [];
|
|
|
|
|
+ $fail_counts = [];
|
|
|
|
|
+
|
|
|
foreach($area_manager_data as $area_manager => $a_data) {
|
|
foreach($area_manager_data as $area_manager => $a_data) {
|
|
|
$total_area_manager_test_count = array_sum(array_column($a_data, "testCount"));
|
|
$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_pass_count = array_sum(array_column($a_data, "passCount"));
|
|
|
$total_area_manager_fail_count = array_sum(array_column($a_data, "failCount"));
|
|
$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);
|
|
$data_values[] = ($total_region_test_count == 0) ? 0 : round(($total_area_manager_pass_count * 100) / $total_area_manager_test_count);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -775,10 +804,14 @@ if($submit) {
|
|
|
$chart->setType("bar");
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("Area Manager Pass Rate $date_range_label");
|
|
$chart->setTitle("Area Manager Pass Rate $date_range_label");
|
|
|
$chart->setLabels($x_data_labels);
|
|
$chart->setLabels($x_data_labels);
|
|
|
- $chart->addDataset("Pass Rate (%)", $data_values , [
|
|
|
|
|
|
|
+ $chart->addDataset("Pass %", $data_values , [
|
|
|
"background_colours" => "#2196F3"
|
|
"background_colours" => "#2196F3"
|
|
|
]);
|
|
]);
|
|
|
|
|
+ $chart->addPrintDataset("Tests", $test_counts);
|
|
|
|
|
+ $chart->addPrintDataset("Pass", $pass_counts);
|
|
|
|
|
+ $chart->addPrintDataset("Fail", $fail_counts);
|
|
|
$chart->setDatalabelSuffixes("%");
|
|
$chart->setDatalabelSuffixes("%");
|
|
|
|
|
+ $chart->print = true;
|
|
|
$charts[] = $chart;
|
|
$charts[] = $chart;
|
|
|
|
|
|
|
|
// Area Pass Rate Period
|
|
// Area Pass Rate Period
|
|
@@ -846,7 +879,7 @@ if($submit) {
|
|
|
|
|
|
|
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("reports", compact("customer", "date_range", "from_quarter", "to_quarter", "date_resolution", "all_projects", "project_ids", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "region_data", "area_manager_data"));
|
|
|
|
|
|
|
+View::include("reports", compact("customer", "date_range", "from_quarter", "to_quarter", "date_resolution", "all_projects", "project_ids", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "region_data", "area_manager_data", "key_labels"));
|
|
|
View::includeOnce("footer");
|
|
View::includeOnce("footer");
|
|
|
|
|
|
|
|
?>
|
|
?>
|