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

    include 'include/database.php';

    $connection = connect($database);

    //$canEdit = canEditValues($connection, $_SESSION['login']);
    
    $building_id = getBuildingIdCG($connection, $_GET['campus'], $_GET['building']);
    $rooms = getRoomNamesCG($connection, $building_id);

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