<?php
require_once __DIR__ . '/../../config/database.php';
require_once __DIR__ . '/../../includes/auth.php';
requireAdmin();

$id = (int)($_GET['id'] ?? 0);
if ($id > 0) {
    $pdo->prepare("UPDATE kelas SET status = 'nonaktif' WHERE id = ?")->execute([$id]);
    setFlash('success', 'Kelas berhasil dinonaktifkan.');
}
header('Location: ' . url('/admin/kelas/index.php'));
exit;
