This commit is contained in:
Hendrik
2017-02-03 10:33:44 +01:00
parent afb45d6709
commit fde736b8c5
5 changed files with 20 additions and 6 deletions

View File

@@ -24,12 +24,14 @@ $(window).on("load", function () {
});
});
// Toggles all checkboxes based on one.
function checkAll() {
$('.checkbox-list').each(function () {
$(this).prop('checked', $('#checkall').prop('checked'));
});
}
// Simple function that checks if checkall should stay checked.
function checkCheckAll() {
var checked = true;
@@ -43,6 +45,7 @@ function checkCheckAll() {
$('#checkall').prop('checked', checked);
}
// Toggle of filter options.
function changeFilter() {
if ($('#pagetype').find(":selected").val() == "group") {
document.getElementById('admin-filter').style.display = 'none';
@@ -59,11 +62,13 @@ function changeFilter() {
}
}
// Sets the search page to one, relevant when changing filter or search.
function searchFromOne() {
$('#currentpage').prop('value', 1);
adminSearch();
}
// AJAX live search.
function adminSearch() {
$.post(
"API/adminSearchUsers.php",
@@ -74,6 +79,7 @@ function adminSearch() {
})
}
// AJAX live update.
function adminUpdate(form) {
$.post(
"API/adminChangeUser.php",
@@ -83,6 +89,7 @@ function adminUpdate(form) {
})
}
// AJAX pagenumber functionality.
function updatePageN() {
$.post(
"API/adminPageNumber.php",
@@ -92,11 +99,13 @@ function updatePageN() {
})
}
// Intended for the edit button to show a form.
function toggleBancomment(button) {
$(button).siblings("div").toggle();
$(button).toggle();
}
// AJAX value editing.
function editComment(form) {
$.post(
"API/adminChangeUser.php",

View File

@@ -34,9 +34,10 @@
width: 100%;
}
.usertable .table-username {width: 150px}
.usertable .table-status {width: 100px}
.usertable .table-action {width: 200px}
.table-checkbox {width: 20px}
.table-username {width: 150px}
.table-status {width: 100px}
.table-action {width: 200px}
.usertable th, td {
border-bottom: 1px solid #ddd;
@@ -51,6 +52,10 @@
background-color: #f5f5f5;
}
.bancomment {
width: 80%;
}
.bancommentedit {
display: none;
}

View File

@@ -216,6 +216,7 @@ function test_input($data) {
$data = trim($data);
$data = stripslashes($data);
$data = htmlspecialchars($data);
$data = trim($data);
return $data;
}

View File

@@ -3,7 +3,7 @@
<th class="table-username">Groepsnaam</th>
<th class="table-status">Status</th>
<th class="table-comment">Beschrijving</th>
<th class="table-action">Actie</th>
<th class="table-action">Zichtbaarheid</th>
</tr>
<?php

View File

@@ -1,5 +1,4 @@
<!-- function test_input taken from http://www.w3schools.com/php/php_form_validation.asp -->
<!-- Form value holding. -->
<?php
$search = "";
$status = array("user", "frozen", "banned", "unconfirmed", "admin", "owner");