Initial import
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/../includes/functions.php';
|
||||
requireLogin();
|
||||
|
||||
if (isStudent()) {
|
||||
header('Location: ' . BASE_URL . '/index.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
$id = intval($_GET['id'] ?? 0);
|
||||
requireStudentAccess($id);
|
||||
$student = getStudent($id);
|
||||
if (!$student) {
|
||||
header('Location: list.php');
|
||||
exit;
|
||||
}
|
||||
|
||||
try {
|
||||
$stmt = getDB()->prepare("DELETE FROM students WHERE id = ?");
|
||||
$stmt->execute([$id]);
|
||||
} catch (PDOException $e) {
|
||||
// ignore
|
||||
}
|
||||
|
||||
header('Location: list.php');
|
||||
exit;
|
||||
Reference in New Issue
Block a user