| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- <?php
- if(Core::$user->level == User::LEVEL_SUPERADMIN) {
- $page_title = "Users";
- }
- else {
- $page_title = "Testers";
- }
- Core::addBreadcrumb("/account", "Account");
- Core::addBreadcrumb("/account/users", $page_title);
- $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($first_name !== false) $nvp["first_name"] = ((new Constraint("CONTAINS"))->setValues($first_name));
- if($last_name !== false) $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));
- $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", "first_name", "last_name", "email", "level", "customer_id", "location_id"));
- View::includeOnce("modal_page_jump");
- View::includeOnce("footer");
- ?>
|