diff --git a/website/public/styles/adminpanel.css b/website/public/styles/adminpanel.css index 5a9fb7e..c8e29b6 100644 --- a/website/public/styles/adminpanel.css +++ b/website/public/styles/adminpanel.css @@ -32,7 +32,7 @@ margin-bottom: 10px; } -.admin-filter, .admin-filtertype { +.admin-filter, .admin-filtertype, .admin-groupfilter { display: inline-block; margin: 10px; vertical-align: top; @@ -40,6 +40,14 @@ margin-left: 50px; } +.admin-filter, .admin-groupfilter { + width: 120px; +} + +.admin-groupfilter { + display: none; +} + .admin-users { margin: 10px; } diff --git a/website/queries/user.php b/website/queries/user.php index 8029154..42d90bc 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -41,4 +41,32 @@ function search20UsersFromN($db, $n, $keyword) { return $q; } +function search20UsersFromNByStatus($db, $n, $keyword, $status) { + $q = $db->prepare(" + SELECT + `userID`, + `username`, + `role`, + `bancomment` + FROM + `user` + WHERE + `username` LIKE :keyword AND + FIND_IN_SET (`role`, :statuses) + ORDER BY + `username` + LIMIT + :n, 20 + "); + + $keyword = "%$keyword%"; + $q->bindParam(':keyword', $keyword); + $q->bindParam(':n', $n, PDO::PARAM_INT); + $statuses = implode(',', $status); + $q->bindParam(':statuses', $statuses); + $q->execute(); + return $q; +} + + ?> diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php index a8cdb73..8ce9fb1 100644 --- a/website/views/adminpanel.php +++ b/website/views/adminpanel.php @@ -4,6 +4,10 @@ Admin Panel @@ -20,13 +35,14 @@ ">
-
+ +

Show:

- > + + >
- > + >
- > + >
- > + >
- > - + > +
+ > +
+ +
+

Show:

+ + > +
+ > +
+ > +
+
+

Page Type:

> + + onchange="changeFilter()">
> + + onchange="changeFilter()">
+

Batch Actions:

@@ -107,8 +151,10 @@ function test_input($data) {

+

Users:

+
1 / 1 @@ -126,8 +172,9 @@ function test_input($data) { Action + fetch(PDO::FETCH_ASSOC)) { $userID = $user['userID']; @@ -135,6 +182,7 @@ function test_input($data) { $role = $user['role']; $bancomment = $user['bancomment']; $thispage = htmlspecialchars($_SERVER['PHP_SELF']); + echo("
- -