diff --git a/website/public/API/adminChangeUser.php b/website/public/API/adminChangeUser.php index 72acb8c..359497a 100644 --- a/website/public/API/adminChangeUser.php +++ b/website/public/API/adminChangeUser.php @@ -20,4 +20,6 @@ if (isset($_POST["actions"]) && isset($_POST["userID"])) { } } else if (isset($_POST["groupbatchactions"]) && isset($_POST["checkbox-group"])) { changeMultipleGroupStatusByID($_POST["checkbox-group"], $_POST["groupbatchactions"]); +} else if (isset($_POST['bancommentuserID']) && isset($_POST['bancommenttext'])) { + editBanCommentByID($_POST['bancommentuserID'], $_POST['bancommenttext']); } diff --git a/website/public/js/admin.js b/website/public/js/admin.js index 7e2efad..2b78e0b 100644 --- a/website/public/js/admin.js +++ b/website/public/js/admin.js @@ -93,4 +93,18 @@ function updatePageN() { ).done(function (data) { $("#admin-pageinfo").html(data); }) +} + +function toggleBancomment(button) { + $(button).siblings("div").toggle(); + $(button).toggle(); +} + +function editComment(form) { + $.post( + "API/adminChangeUser.php", + $(form).serialize() + ).done(function (data) { + adminSearch(); + }); } \ No newline at end of file diff --git a/website/public/styles/adminpanel.css b/website/public/styles/adminpanel.css index 75fa8b1..7f117c6 100644 --- a/website/public/styles/adminpanel.css +++ b/website/public/styles/adminpanel.css @@ -51,3 +51,11 @@ .usertable tr:hover { background-color: #f5f5f5; } + +.bancommentedit { + display: none; +} + +.bancommentform input[type="text"] { + width: 100%; +} \ No newline at end of file diff --git a/website/queries/user.php b/website/queries/user.php index bf20e7d..39f1c4e 100644 --- a/website/queries/user.php +++ b/website/queries/user.php @@ -424,4 +424,19 @@ function getRoleByID($userID) { $stmt->bindParam(':userID', $userID); $stmt->execute(); return $stmt; +} + +function editBanCommentByID($userID, $comment) { + $stmt = prepareQuery(" + UPDATE + `user` + SET + `bancomment` = :comment + WHERE + `userID` = :userID + "); + + $stmt->bindParam(':userID', $userID, PDO::PARAM_INT); + $stmt->bindParam(':comment', $comment); + $stmt->execute(); } \ No newline at end of file diff --git a/website/views/adminpanel-table.php b/website/views/adminpanel-table.php index 7ac0873..9e6b9bc 100644 --- a/website/views/adminpanel-table.php +++ b/website/views/adminpanel-table.php @@ -27,7 +27,25 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {