level == User::LEVEL_SUPERADMIN) { $page_title = "Users"; } else { $page_title = "Testers"; } Core::addBreadcrumb("/account", "Account"); Core::addBreadcrumb("/account/users", $page_title); $id = http::value("id", "int"); $first_name = http::value("first_name", "trim"); $last_name = http::value("last_name", "trim"); $email = http::value("email", "trim"); $level = http::value("level", "int"); $customer_id = http::value("customer_id", "int"); $location_id = http::value("location_id", "int"); $nvp = []; if($id !== false) $nvp["id"] = $id; if(strlen($first_name) > 0) $nvp["first_name"] = ((new Constraint("CONTAINS"))->setValues($first_name)); if(strlen($last_name) > 0) $nvp["last_name"] = ((new Constraint("CONTAINS"))->setValues($last_name)); if(strlen($email) > 0) $nvp["email"] = $email; if($level !== false) $nvp["level"] = $level; $filter_count = ""; if($nvp) $filter_count = count(array_keys($nvp)); if(empty($nvp)) { $nvp["level"] = (new Constraint("NOT_EQUALS"))->setValues(User::LEVEL_REGISTERED); } $users = User::query($nvp); $pagination_object = Util::getPaginationObject($users); Core::$page = $pagination_object->page; Core::$page_count = $pagination_object->pageCount; $users = array_slice($users, $pagination_object->offset, $pagination_object->pageSize); View::includeOnce("header", compact("page_title")); View::include("users", compact("users", "pagination_object", "filter_count", "id", "first_name", "last_name", "email", "level", "customer_id", "location_id")); View::includeOnce("modal_page_jump"); View::includeOnce("footer"); ?>