23 lines
487 B
PHP
23 lines
487 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
ini_set('display_errors', '1');
|
|
error_reporting(E_ALL);
|
|
|
|
require_once __DIR__ . '/auth.php';
|
|
require_once __DIR__ . '/db/database.php';
|
|
|
|
if (!isset($_GET['id'])) {
|
|
header('Location: index.php');
|
|
exit;
|
|
}
|
|
|
|
$dependent_id = (int)$_GET['id'];
|
|
|
|
$pdo = get_db_connection();
|
|
|
|
$stmt = $pdo->prepare('DELETE FROM dependents WHERE id = ?');
|
|
$stmt->execute([$dependent_id]);
|
|
|
|
header('Location: index.php?success_message=Dependent deleted successfully');
|
|
exit;
|