<?php
chdir('../../');
require_once 'autoload.php';
$courses = new courses_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())) {

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

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

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

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