|
|
@@ -2,17 +2,17 @@
|
|
|
|
|
|
Core::addScript("public/js/Chart.bundle.min.js");
|
|
|
Core::addScript("public/js/chartjs-plugin-datalabels.min.js");
|
|
|
-Core::addScript("public/js/app-performance.js");
|
|
|
+Core::addScript("public/js/app-reports.js");
|
|
|
|
|
|
Core::addBreadcrumb("/account", "Account");
|
|
|
-Core::addBreadcrumb("/account/performance", "Performance");
|
|
|
+Core::addBreadcrumb("/account/reports", "Reports");
|
|
|
|
|
|
$customer = Customer::getForAdmin();
|
|
|
if(!$customer) throw new Exception("You do not have permission to access this page.");
|
|
|
|
|
|
-$page_title = "$customer->name Performance";
|
|
|
+$page_title = "$customer->name Reports";
|
|
|
|
|
|
-Core::addBreadcrumb("/account/performance?customer_id=$customer->id", $page_title);
|
|
|
+Core::addBreadcrumb("/account/reports?customer_id=$customer->id", $page_title);
|
|
|
|
|
|
$date_range = http::value("date_range");
|
|
|
if(!$date_range) $date_range = "ytd";
|
|
|
@@ -505,7 +505,7 @@ if($submit) {
|
|
|
$charts[] = $chart;
|
|
|
|
|
|
// Pass Rate Period
|
|
|
- $performance = array_values(array_map(function($d) {
|
|
|
+ $pass_rates = array_values(array_map(function($d) {
|
|
|
if($d->testCount == 0) return 0;
|
|
|
return round(($d->passCount / $d->testCount) * 100);
|
|
|
}, $data));
|
|
|
@@ -515,7 +515,7 @@ if($submit) {
|
|
|
$chart->setType("bar");
|
|
|
$chart->setTitle("Pass Rate by $resolution_name");
|
|
|
$chart->setLabels($x_data_labels);
|
|
|
- $chart->addDataset("Pass Rate (%)", $performance, [
|
|
|
+ $chart->addDataset("Pass Rate (%)", $pass_rates, [
|
|
|
"background_colours" => "#2196F3"
|
|
|
]);
|
|
|
$chart->setDatalabelSuffixes("%");
|
|
|
@@ -534,7 +534,7 @@ if($submit) {
|
|
|
$chart->addYAxis("linear", "left", "y-axis-1", true, ["min" => 0, "max" => ceil(max($test_counts) / 10) * 10]);
|
|
|
$chart->addYAxis("linear", "right", "y-axis-2", false, ["min" => 0, "max" => 100]);
|
|
|
|
|
|
- $chart->addDataset("Pass Rate (%)", $performance, [
|
|
|
+ $chart->addDataset("Pass Rate (%)", $pass_rates, [
|
|
|
"border_colours" => "#FFEB3B",
|
|
|
"background_colours" => "transparent",
|
|
|
"type" => "line",
|
|
|
@@ -779,7 +779,7 @@ if($submit) {
|
|
|
case "export-pptx":
|
|
|
case "export-odp":
|
|
|
|
|
|
- require "performance_presentation.php";
|
|
|
+ require "reports_presentation.php";
|
|
|
|
|
|
break;
|
|
|
default:
|
|
|
@@ -791,7 +791,7 @@ if($submit) {
|
|
|
|
|
|
|
|
|
View::includeOnce("header", compact("page_title"));
|
|
|
-View::include("performance", 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"));
|
|
|
View::includeOnce("footer");
|
|
|
|
|
|
?>
|