diff --git a/website/public/API/adminChangeUser.php b/website/public/API/adminChangeUser.php
new file mode 100644
index 0000000..067a7ba
--- /dev/null
+++ b/website/public/API/adminChangeUser.php
@@ -0,0 +1,20 @@
+
-
+
+
fetch(PDO::FETCH_ASSOC);
if ($userinfo['role'] != 'admin' AND $userinfo['role'] != 'owner') {
diff --git a/website/public/js/admin.js b/website/public/js/admin.js
index e3dfdd7..140c99a 100644
--- a/website/public/js/admin.js
+++ b/website/public/js/admin.js
@@ -1,6 +1,18 @@
-window.onload = function() {
+$(window).on("load", function () {
changeFilter();
-};
+ $(".admin-searchinput").keyup(function(){
+ adminSearch();
+ });
+ // all inputs and labels directly under admin filter and groupfilter
+ $("#admin-filter, #admin-groupfilter > input, label").click(function(){
+ adminSearch();
+ });
+ $("#pagetype").change(function(){
+ adminSearch();
+ });
+
+ adminSearch();
+});
function checkAll(allbox) {
var checkboxes = document.getElementsByClassName('checkbox-list');
@@ -32,13 +44,32 @@ function changeFilter() {
document.getElementById('admin-filter').style.display = 'none';
document.getElementById('admin-groupfilter').style.display = 'inline-block';
- document.getElementById('admin-batchactions').style.display = 'none';
- document.getElementById('admin-groupbatchactions').style.display = 'inline-block';
+ document.getElementById('admin-batchform').style.display = 'none';
+ document.getElementById('admin-groupbatchform').style.display = 'inline-block';
} else {
document.getElementById('admin-filter').style.display = 'inline-block';
document.getElementById('admin-groupfilter').style.display = 'none';
- document.getElementById('admin-batchactions').style.display = 'inline-block';
- document.getElementById('admin-groupbatchactions').style.display = 'none';
+ document.getElementById('admin-batchform').style.display = 'inline-block';
+ document.getElementById('admin-groupbatchform').style.display = 'none';
}
}
+
+function adminSearch() {
+ $.post(
+ "API/adminSearchUsers.php",
+ $("#admin-searchform").serialize()
+ ).done(function (data) {
+ console.log(data);
+ $("#usertable").html(data);
+ })
+}
+
+function updatePageN() {
+ $.post(
+ "API/adminPageNumber.php",
+ $("#admin-searchform").serialize()
+ ).done(function (data) {
+ $("#admin-pageinfo").html(data);
+ })
+}
\ No newline at end of file
diff --git a/website/queries/group_page.php b/website/queries/group_page.php
index f3de045..cdef6ae 100644
--- a/website/queries/group_page.php
+++ b/website/queries/group_page.php
@@ -143,15 +143,18 @@ function countSomeGroupsByStatus($keyword, $status) {
}
function changeGroupStatusByID($id, $status) {
- $q = $GLOBALS["db"]->query("
+ $q = $GLOBALS["db"]->prepare("
UPDATE
`group_page`
SET
- `status` = $status
+ `status` = :status
WHERE
- `groupID` = $id
+ `groupID` = :id
");
+ $q->bindParam(':status', $status);
+ $q->bindParam(':id', $id);
+ $q->execute();
return $q;
}
diff --git a/website/views/adminpanel-grouptable.php b/website/views/adminpanel-grouptable.php
new file mode 100644
index 0000000..4999666
--- /dev/null
+++ b/website/views/adminpanel-grouptable.php
@@ -0,0 +1,48 @@
+
@@ -62,7 +38,8 @@ $listm = $currentpage * $perpage;
Zoek naar gebruikers of groepen:
+
Resultaat:
-
- fetchColumn();
- $mincount = min($listm, $countresults);
- $minlist = min($listn + 1, $countresults);
- ?>
- Pagina:
-
-
+
+
+
+
-