<?php
chdir('../../');
require_once 'autoload.php';
$students = new students_controller;

if ($_SERVER['REQUEST_METHOD'] === 'GET' && isset($_GET['csrf_token']) && isset($_GET['csrf_form_id']) && $waf->csrf_validate($_GET['csrf_form_id'], $_GET['csrf_token'], $utility->action_name())) {

$students->destroy($_GET['id']);

$utility->setMessage("success", 'Enrollment deleted');

header("location:../enrollments");

}else{
header("location:../enrollments");
}
?>
