edit user
This commit is contained in:
27
.hta_slug/leads/delete-lead.php
Normal file
27
.hta_slug/leads/delete-lead.php
Normal file
@@ -0,0 +1,27 @@
|
||||
<?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>
|
||||
Reference in New Issue
Block a user