add bancomment change
This commit is contained in:
@@ -20,4 +20,6 @@ if (isset($_POST["actions"]) && isset($_POST["userID"])) {
|
|||||||
}
|
}
|
||||||
} else if (isset($_POST["groupbatchactions"]) && isset($_POST["checkbox-group"])) {
|
} else if (isset($_POST["groupbatchactions"]) && isset($_POST["checkbox-group"])) {
|
||||||
changeMultipleGroupStatusByID($_POST["checkbox-group"], $_POST["groupbatchactions"]);
|
changeMultipleGroupStatusByID($_POST["checkbox-group"], $_POST["groupbatchactions"]);
|
||||||
|
} else if (isset($_POST['bancommentuserID']) && isset($_POST['bancommenttext'])) {
|
||||||
|
editBanCommentByID($_POST['bancommentuserID'], $_POST['bancommenttext']);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -93,4 +93,18 @@ function updatePageN() {
|
|||||||
).done(function (data) {
|
).done(function (data) {
|
||||||
$("#admin-pageinfo").html(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();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
@@ -51,3 +51,11 @@
|
|||||||
.usertable tr:hover {
|
.usertable tr:hover {
|
||||||
background-color: #f5f5f5;
|
background-color: #f5f5f5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.bancommentedit {
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.bancommentform input[type="text"] {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
@@ -424,4 +424,19 @@ function getRoleByID($userID) {
|
|||||||
$stmt->bindParam(':userID', $userID);
|
$stmt->bindParam(':userID', $userID);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
return $stmt;
|
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();
|
||||||
}
|
}
|
||||||
@@ -27,7 +27,25 @@ while($user = $q->fetch(PDO::FETCH_ASSOC)) {
|
|||||||
</td>
|
</td>
|
||||||
<td>$username</td>
|
<td>$username</td>
|
||||||
<td>$role</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>
|
<td>
|
||||||
<form class='admin-useraction'
|
<form class='admin-useraction'
|
||||||
onsubmit=\"adminUpdate(this); return false;\">
|
onsubmit=\"adminUpdate(this); return false;\">
|
||||||
|
|||||||
Reference in New Issue
Block a user