Files
pongpon pitisuk 72701ad58c Initial import
2026-06-25 16:49:13 +07:00

21 lines
475 B
PHP

<?php
require_once __DIR__ . '/../includes/functions.php';
requireLogin();
if (isStudent()) {
header('Location: ' . BASE_URL . '/index.php');
exit;
}
$id = intval($_GET['id'] ?? 0);
$student_id = intval($_GET['student_id'] ?? 0);
requireStudentAccess($student_id);
if ($id > 0) {
$stmt = getDB()->prepare("DELETE FROM student_courses WHERE id = ?");
$stmt->execute([$id]);
}
header('Location: ' . BASE_URL . '/students/view.php?id=' . $student_id);
exit;