|
|
@@ -7,10 +7,14 @@ else {
|
|
|
$page_title = "Testers";
|
|
|
}
|
|
|
|
|
|
-
|
|
|
Core::addBreadcrumb("/account", "Account");
|
|
|
Core::addBreadcrumb("/account/users", $page_title);
|
|
|
|
|
|
+$sorts = [
|
|
|
+ "newest" => "Newest",
|
|
|
+ "score" => "Score",
|
|
|
+];
|
|
|
+
|
|
|
$id = http::value("id", "int");
|
|
|
$first_name = http::value("first_name", "trim");
|
|
|
$last_name = http::value("last_name", "trim");
|
|
|
@@ -34,7 +38,19 @@ if(empty($nvp)) {
|
|
|
$nvp["level"] = (new Constraint("NOT_EQUALS"))->setValues(User::LEVEL_REGISTERED);
|
|
|
}
|
|
|
|
|
|
-$users = User::query($nvp);
|
|
|
+$sort = http::value("sort");
|
|
|
+switch($sort) {
|
|
|
+ case "score":
|
|
|
+ $query_options = ["sort" => "score", "order" => "desc"];
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ $sort = "newest";
|
|
|
+ $query_options = ["sort" => "id", "order" => "desc"];
|
|
|
+ break;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
+$users = User::query($nvp, $query_options);
|
|
|
|
|
|
$pagination_object = Util::getPaginationObject($users);
|
|
|
|
|
|
@@ -45,7 +61,7 @@ $users = array_slice($users, $pagination_object->offset, $pagination_object->pag
|
|
|
|
|
|
|
|
|
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::include("users", compact("users", "pagination_object", "filter_count", "id", "first_name", "last_name", "email", "level", "customer_id", "location_id", "sort", "sorts"));
|
|
|
View::includeOnce("modal_page_jump");
|
|
|
View::includeOnce("footer");
|
|
|
|