diff --git a/website/queries/group_page.php b/website/queries/group_page.php index 8f04ca3..c6db01b 100644 --- a/website/queries/group_page.php +++ b/website/queries/group_page.php @@ -80,6 +80,20 @@ function search20GroupsFromNByStatus($db, $n, $keyword, $status) { return $q; } +function changeGroupStatusByID($db, $id, $status) { + $q = $db->query(" + UPDATE + `group_page` + SET + `status` = $status + WHERE + `groupID` = $id + "); + + return $q; +} + + ?> diff --git a/website/queries/user.php b/website/queries/user.php index de8c52b..bfd9579 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -54,6 +54,7 @@ function search20UsersFromNByStatus($db, $n, $keyword, $status) { `username` LIKE :keyword AND FIND_IN_SET (`role`, :statuses) ORDER BY + `role`, `username` LIMIT :n, 20 diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php index d478003..5a3ba97 100644 --- a/website/views/adminpanel.php +++ b/website/views/adminpanel.php @@ -62,6 +62,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { if (!empty($_POST["actions"]) && !empty($_POST["userID"])) { changeUserStatusByID($db, $_POST["userID"], $_POST["actions"]); + } elseif (!empty($_POST["actions"]) && !empty($_POST["groupID"])) { + changeGroupStatusByID($db, $_POST["groupID"], $_POST["actions"]); } } @@ -239,9 +241,9 @@ function test_input($data) { action='$thispage' method='post'>