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(':id', $user_id);
|
||||
$stmt->execute();
|
||||
echo "Record Updated successfully";
|
||||
echo '<script> window.location.assign("/admin/users") </script>';
|
||||
} catch(PDOException $e) {
|
||||
echo "Error: " . $e->getMessage();
|
||||
}
|
||||
@@ -66,7 +66,7 @@
|
||||
if ($num_rows >= 1) {
|
||||
foreach($rows as $row){?>
|
||||
<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>
|
||||
<div style="display: flex; flex-direction: column;">
|
||||
<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>
|
||||
/* For small screens */
|
||||
@media screen and (max-width: 767px) {
|
||||
|
||||
Reference in New Issue
Block a user