Files
crm_php/.hta_slug/admin/delete-forms.php
Suvodip 06887b01a6 c1
2024-04-30 20:13:19 +05:30

42 lines
1.8 KiB
PHP

<?php
require_once('/var/www/html/.hta_config/crm_config.php');
require_once('/var/www/html/.htac_header.php');
require_once('/var/www/html/.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>