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

    include 'include/database.php';

    $connection = connect($database);

    //$canEdit = canEditValues($connection, $_SESSION['login']);
    
    $campus_id = getCampusIdCG($connection, $_GET['campus']);
    $buildings = getBuildingNamesCG($connection, $campus_id);

	$connection = null;
    
    $building_options = '';
    
    foreach ($buildings as $building) {
        $building_options .= "
            <option value=\"{$building['name']}\">{$building['name']}</option>
        ";
    }
    
    echo $building_options;
?>