<?php require_once '../auth/cek_login.php';
require_role('admin');
include 'header.php';
$id=(int)($_GET['id']??0);
if($id>0){
    $conn->query("DELETE FROM nilai WHERE mapel_id=$id");
    $conn->query("DELETE FROM mapel WHERE id=$id");
}
header('Location: mapel.php'); exit;
