Marijn button #99

Merged
11166932 merged 152 commits from marijn-button into master 2017-01-23 13:25:08 +01:00
3 changed files with 20 additions and 3 deletions
Showing only changes of commit e7e3ae9c8b - Show all commits

View File

@@ -80,6 +80,20 @@ function search20GroupsFromNByStatus($db, $n, $keyword, $status) {
return $q; return $q;
} }
function changeGroupStatusByID($db, $id, $status) {
$q = $db->query("
UPDATE
`group_page`
SET
`status` = $status
WHERE
`groupID` = $id
");
return $q;
}
?> ?>

View File

@@ -54,6 +54,7 @@ function search20UsersFromNByStatus($db, $n, $keyword, $status) {
`username` LIKE :keyword AND `username` LIKE :keyword AND
FIND_IN_SET (`role`, :statuses) FIND_IN_SET (`role`, :statuses)
ORDER BY ORDER BY
`role`,
`username` `username`
LIMIT LIMIT
:n, 20 :n, 20

View File

@@ -62,6 +62,8 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") {
if (!empty($_POST["actions"]) && !empty($_POST["userID"])) { if (!empty($_POST["actions"]) && !empty($_POST["userID"])) {
changeUserStatusByID($db, $_POST["userID"], $_POST["actions"]); 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' action='$thispage'
method='post'> method='post'>
<select class='action' name='actions'> <select class='action' name='actions'>
<option value='hide'>Hide</option> <option value='0'>Hide</option>
<option value='public'>Public</option> <option value='1'>Public</option>
<option value='restore'>Restore</option> <option value='2'>Members-only</option>
</select> </select>
<input type='hidden' name='groupID' value='$groupID'> <input type='hidden' name='groupID' value='$groupID'>
<input type='submit' value='Confirm'> <input type='submit' value='Confirm'>