|
@@ -29,6 +29,17 @@ $to_quarter = http::value("to_quarter");
|
|
|
$project_ids = http::value("project_ids", "int");
|
|
$project_ids = http::value("project_ids", "int");
|
|
|
if(!is_array($project_ids)) $project_ids = [];
|
|
if(!is_array($project_ids)) $project_ids = [];
|
|
|
|
|
|
|
|
|
|
+$location_ids = http::value("location_ids");
|
|
|
|
|
+if(!empty($location_ids)) {
|
|
|
|
|
+ $location_ids = explode(" ", $location_ids);
|
|
|
|
|
+ $location_ids = array_map("intval", $location_ids);
|
|
|
|
|
+ $location_ids = array_filter($location_ids);
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
|
|
+if(!is_array($location_ids)) {
|
|
|
|
|
+ $location_ids = [];
|
|
|
|
|
+}
|
|
|
|
|
+
|
|
|
$all_projects = Project::query([
|
|
$all_projects = Project::query([
|
|
|
"customer_id" => $customer->id
|
|
"customer_id" => $customer->id
|
|
|
]);
|
|
]);
|
|
@@ -97,10 +108,16 @@ if($submit) {
|
|
|
if($form_exception->hasErrors()) throw $form_exception;
|
|
if($form_exception->hasErrors()) throw $form_exception;
|
|
|
|
|
|
|
|
// Get all completed tests
|
|
// Get all completed tests
|
|
|
- $tests = Test::query([
|
|
|
|
|
|
|
+ $test_nvp = [
|
|
|
"project_id" => $project_ids,
|
|
"project_id" => $project_ids,
|
|
|
"status" => Test::STATUS_COMPLETED
|
|
"status" => Test::STATUS_COMPLETED
|
|
|
- ]);
|
|
|
|
|
|
|
+ ];
|
|
|
|
|
+
|
|
|
|
|
+ if($location_ids) {
|
|
|
|
|
+ $test_nvp["location_id"] = $location_ids;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ $tests = Test::query($test_nvp);
|
|
|
$test_count = count($tests);
|
|
$test_count = count($tests);
|
|
|
|
|
|
|
|
// Get test values
|
|
// Get test values
|
|
@@ -393,7 +410,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", "key_labels", "has_pass_fail"));
|
|
|
|
|
|
|
+View::include("reports", compact("customer", "date_range", "from_quarter", "to_quarter", "date_resolution", "all_projects", "project_ids", "location_ids", "charts", "data", "total_data", "locations_missing_region", "locations_missing_area_manager", "region_data", "area_manager_data", "key_labels", "has_pass_fail"));
|
|
|
View::includeOnce("footer");
|
|
View::includeOnce("footer");
|
|
|
|
|
|
|
|
?>
|
|
?>
|