20 lines
430 B
PHP
20 lines
430 B
PHP
<?php
|
|
require_once 'db/config.php';
|
|
|
|
$plan_id = $_GET['id'] ?? null;
|
|
|
|
if ($plan_id) {
|
|
try {
|
|
$pdo = db();
|
|
$stmt = $pdo->prepare('DELETE FROM plans WHERE id = ?');
|
|
$stmt->execute([$plan_id]);
|
|
} catch (PDOException $e) {
|
|
// Optional: Log the error or show a generic error message
|
|
// For simplicity, we redirect without an error message
|
|
}
|
|
}
|
|
|
|
header('Location: plans.php');
|
|
exit;
|
|
?>
|