hasPermission($location)) throw new Exception("You do not have permission to access this page."); $page_title = $location->name; Core::addBreadcrumb("/account", "Account"); Core::addBreadcrumb("/account/locations", "Locations"); Core::addBreadcrumb("/account/locations/$location->id", $page_title); $status_constraint = new Constraint("BETWEEN"); if(Core::$user->level >= User::LEVEL_ADMIN) { $status_constraint->setValues(Test::STATUS_UNASSIGNED, Test::STATUS_COMPLETED); } else { $status_constraint->setValues(Test::STATUS_COMPLETED, Test::STATUS_COMPLETED); } $tests = Test::query([ "location_id" => $location->id, "status" => $status_constraint, ], [ "sort" => "status", "order" => "asc", ]); $projects = Project::load(array_column($tests, "project_id")); View::includeOnce("header", compact("page_title")); View::include("location", compact("location", "tests")); View::includeOnce("footer"); ?>