diff --git a/website/public/styles/adminpanel.css b/website/public/styles/adminpanel.css
index e761592..d5b740e 100644
--- a/website/public/styles/adminpanel.css
+++ b/website/public/styles/adminpanel.css
@@ -32,17 +32,36 @@
margin-bottom: 10px;
}
-.admin-filter {
+.admin-filter, .admin-filtertype, .admin-groupfilter {
display: inline-block;
margin: 10px;
vertical-align: top;
- margin-right: 100px;
+ margin-right: 50px;
+ margin-left: 50px;
+}
+
+.admin-filter, .admin-groupfilter {
+ width: 120px;
+}
+
+.admin-groupfilter {
+ display: none;
}
.admin-users {
margin: 10px;
}
+.admin-userpage {
+ width: 170px;
+ margin-bottom: 20px;
+ float: right;
+}
+
+.usertitle {
+ width: 150px;
+}
+
.usertable {
width: 100%;
}
diff --git a/website/queries/group_page.php b/website/queries/group_page.php
index d8bab8f..c6db01b 100644
--- a/website/queries/group_page.php
+++ b/website/queries/group_page.php
@@ -53,4 +53,47 @@ function select20GroupsByStatusFromN($db, $n, $status) {
");
}
-?>
\ No newline at end of file
+function search20GroupsFromNByStatus($db, $n, $keyword, $status) {
+ $q = $db->prepare("
+ SELECT
+ `groupID`,
+ `name`,
+ `status`,
+ `description`
+ FROM
+ `group_page`
+ WHERE
+ `name` LIKE :keyword AND
+ FIND_IN_SET (`status`, :statuses)
+ ORDER BY
+ `name`
+ 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;
+}
+
+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
new file mode 100644
index 0000000..bfd9579
--- /dev/null
+++ b/website/queries/user.php
@@ -0,0 +1,86 @@
+query("
+ SELECT
+ `userID`,
+ `username`,
+ `role`,
+ `bancomment`
+ FROM
+ `user`
+ ORDER BY
+ `role`,
+ `username`
+ LIMIT
+ $n, 20
+ ");
+}
+
+function search20UsersFromN($db, $n, $keyword) {
+ $q = $db->prepare("
+ SELECT
+ `userID`,
+ `username`,
+ `role`,
+ `bancomment`
+ FROM
+ `user`
+ WHERE
+ `username` LIKE :keyword
+ ORDER BY
+ `username`
+ LIMIT
+ :n, 20
+ ");
+
+ $keyword = "%$keyword%";
+ $q->bindParam(':keyword', $keyword);
+ $q->bindParam(':n', $n, PDO::PARAM_INT);
+ $q->execute();
+ 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
+ `role`,
+ `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;
+}
+
+function changeUserStatusByID($db, $id, $status) {
+ $q = $db->query("
+ UPDATE
+ `user`
+ SET
+ `role` = $status
+ WHERE
+ `userID` = $id
+ ");
+
+ return $q;
+}
+
+
+?>
diff --git a/website/views/adminpanel.php b/website/views/adminpanel.php
index b789aad..5a3ba97 100644
--- a/website/views/adminpanel.php
+++ b/website/views/adminpanel.php
@@ -1,98 +1,266 @@
-
-
- Admin Panel
-
-
-
-