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

    include 'include/database.php';

    $connection = connect($database);

    $canAdmin = canAdministrate($connection, $_SESSION['login']);
    
    if ($canAdmin) {
        $building_id = getBuildingIdCG($connection, $_POST['campus'], $_POST['building']);
        return deleteBuildingCG($connection, $building_id);
    }
?>