editUser state api
This commit is contained in:
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
|||||||
|
.hta_config/
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
$stmt->bindParam(':pass', $password);
|
$stmt->bindParam(':pass', $password);
|
||||||
$stmt->bindParam(':id', $user_id);
|
$stmt->bindParam(':id', $user_id);
|
||||||
$stmt->execute();
|
$stmt->execute();
|
||||||
echo "Record Updated successfully";
|
echo '<script> window.location.assign("/admin/users") </script>';
|
||||||
} catch(PDOException $e) {
|
} catch(PDOException $e) {
|
||||||
echo "Error: " . $e->getMessage();
|
echo "Error: " . $e->getMessage();
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@
|
|||||||
if ($num_rows >= 1) {
|
if ($num_rows >= 1) {
|
||||||
foreach($rows as $row){?>
|
foreach($rows as $row){?>
|
||||||
<div class="flex flex-col place-items-center mt-4">
|
<div class="flex flex-col place-items-center mt-4">
|
||||||
<form action="" method="post" class="max-w-2xl shadow-xl p-4 rounded-lg">
|
<form id="form_edit_user" method="post" class="max-w-2xl shadow-xl p-4 rounded-lg">
|
||||||
<p class="my-4" style="border-bottom: 2px solid #464E5F; border-style: dashed; font-size: 20px; font-weight: bold" >Edit User</p>
|
<p class="my-4" style="border-bottom: 2px solid #464E5F; border-style: dashed; font-size: 20px; font-weight: bold" >Edit User</p>
|
||||||
<div style="display: flex; flex-direction: column;">
|
<div style="display: flex; flex-direction: column;">
|
||||||
<label for="name">Name:</label>
|
<label for="name">Name:</label>
|
||||||
@@ -184,6 +184,19 @@
|
|||||||
|
|
||||||
?>
|
?>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// Check if the page is refreshed
|
||||||
|
if (performance.navigation.type === 1) {
|
||||||
|
// Disable form submission on refresh
|
||||||
|
window.onload = function () {
|
||||||
|
document.getElementById("form_edit_user").addEventListener("submit", function (event) {
|
||||||
|
event.preventDefault();
|
||||||
|
alert("Form submission is disabled on refresh.");
|
||||||
|
});
|
||||||
|
};
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
/* For small screens */
|
/* For small screens */
|
||||||
@media screen and (max-width: 767px) {
|
@media screen and (max-width: 767px) {
|
||||||
|
|||||||
Reference in New Issue
Block a user