singular n mod

This commit is contained in:
Kar l5
2024-05-01 22:22:29 +05:30
parent 89b64d7925
commit 6289aa7327
3 changed files with 4 additions and 6 deletions

View File

@@ -0,0 +1,42 @@
<?php
require_once('.hta_config/crm_config.php');
require_once('.htac_header.php');
require_once('.htac_nav.php');
if($_SERVER['REQUEST_METHOD'] == "POST"){
try {
$conn = new PDO("mysql:host=$mariaServer;dbname=$mariaDb", $mariaUser, $mariaPass);
$conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
$stmt = $conn->prepare("DELETE FROM addforms WHERE id = :id");
$stmt->bindParam(':id', $_POST['id']);
$stmt->execute();
echo '<script>window.location.href = "/admin/add-forms";</script>';
exit();
} catch (PDOException $e) {
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
}
}
?>
<div class="delete-div">
<form method="post">
<p style="font-size: 20px; padding: 10px 0px 10px 0px;">Confirm to Delete id <?php echo $_GET['id']; ?>? </p>
<input type="hidden" name="id" value="<?php echo $_GET['id']; ?>">
<input type="submit" name="submit" id="submit" value="YES" style="background: linear-gradient(90deg, rgba(111, 107, 255, 0.91) 0%, rgba(68, 55, 128, 0.91) 100%); text-align: center; padding: 9px 20px 9px 20px; color: #fff; border-radius: 6px; cursor: pointer;" />
<a href="/admin/users" style="border:3px solid #443780; text-align: center; padding: 10px 20px 10px 20px; color: #443780; border-radius: 6px;">NO</a>
</form>
</div>
<style>
.delete-div{
position: absolute;
margin: auto;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
background: #E6E5F4;
max-width: 500px;
min-width: 400px;
padding: 30px 50px 30px 50px;
border-radius: 9px
}
</style>