Hendrik search #181

Merged
11342374 merged 70 commits from hendrik-search into master 2017-02-02 12:47:08 +01:00
5 changed files with 58 additions and 1 deletions
Showing only changes of commit b16dc1d4b7 - Show all commits

View File

@@ -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']);
}

View File

@@ -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();
});
}

View File

@@ -51,3 +51,11 @@
.usertable tr:hover {
background-color: #f5f5f5;
}
.bancommentedit {
display: none;
}
.bancommentform input[type="text"] {
width: 100%;
}

View File

@@ -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();
}

View File

@@ -27,7 +27,25 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
</td>
<td>$username</td>
<td>$role</td>
<td>$bancomment</td>
<td>
<div class='bancomment'>$bancomment</div>
<div class='bancommentedit'>
<form class='bancommentform'
id='bancommentform'
onsubmit='editComment(this);
return false;'>
<input type='text'
name='bancommenttext'
placeholder='Schrijf een aantekening'
value='$bancomment'>
<input type='hidden'
name='bancommentuserID'
value='$userID'>
<button type='submit'>Update</button>
</form>
</div>
<button type='button' onclick='toggleBancomment(this)'>Verander</button>
</td>
<td>
<form class='admin-useraction'
onsubmit=\"adminUpdate(this); return false;\">