23 lines
451 B
PHP
23 lines
451 B
PHP
<?php
|
|
require_once 'session.php';
|
|
check_admin();
|
|
require_once 'db/config.php';
|
|
|
|
$id = $_POST['id'] ?? null;
|
|
if (!$id) {
|
|
header('Location: properties.php');
|
|
exit;
|
|
}
|
|
|
|
try {
|
|
$db = db();
|
|
$stmt = $db->prepare("DELETE FROM properties WHERE id = :id");
|
|
$stmt->bindParam(':id', $id, PDO::PARAM_INT);
|
|
$stmt->execute();
|
|
} catch (PDOException $e) {
|
|
die("DB ERROR: " . $e->getMessage());
|
|
}
|
|
|
|
header('Location: properties.php');
|
|
exit;
|
|
?>
|