28 lines
956 B
PHP
28 lines
956 B
PHP
<?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 cleads WHERE id = :id");
|
|
$stmt->bindParam(':id', $_POST['id']);
|
|
$stmt->execute();
|
|
echo '<script>window.location.href = "/cleads";</script>';
|
|
exit();
|
|
} catch (PDOException $e) {
|
|
echo "<p class='text-danger'>Error: " . $e->getMessage() . "</p>";
|
|
}
|
|
}
|
|
?>
|
|
<div>
|
|
<form method="post">
|
|
<p>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" />
|
|
<a href="/cleads">NO</a>
|
|
</form>
|
|
</div>
|