<?php
require_once '../../includes/functions.php';
requireAdmin();
$id = intval($_GET['id'] ?? 0);
$kelas = db_fetch("SELECT * FROM kelas WHERE id = ?", [$id]);
if ($kelas) {
    db_query("DELETE FROM kelas WHERE id = ?", [$id]);
    setFlash('success', "Kelas {$kelas['nama_kelas']} berhasil dihapus.");
} else {
    setFlash('danger', 'Kelas tidak ditemukan.');
}
header('Location: list.php'); exit;
