<?php
session_start();
require_once '../config.php';
if (!isset($_SESSION['role']) || $_SESSION['role'] !== 'kader') { exit; }

$id_periksa = $_GET['id'];
$id_lansia = $_GET['id_lansia']; // Kita butuh ID lansia untuk redirect balik

$pdo->prepare("DELETE FROM pemeriksaan_lansia WHERE id_periksa_lansia = ?")->execute([$id_periksa]);

header("Location: lansia_detail.php?id=$id_lansia");