<?php
    session_start();
	if ( empty($_SESSION['login']) ) {
        header( 'Location: login.php' );
        die;
	}

    include 'include/database.php';

    $connection = connect($database);

    $canDelete = canDeleteValues($connection, $_SESSION['login']);
    
    if ($canDelete) {
        $campus_id = getCampusId($connection, $_POST['campus']);
        deleteCampus($connection, $campus_id);
    }

    $connection = null;
?>