<?php
require "defaultincludes.inc";
require_once "mrbs_sql.inc";
require_once "config.inc.php";


// print the page header
print_header($day, $month, $year, $area, isset($room) ? $room : "");

echo "<div id=\"dwm_header\" class=\"screenonly\">\n";
?>
<form action="room.php" method='post'>
  <div class="container">
    <h1>STEP 1 : Choose Area</h1>
    
    <hr>

    <label for="ROOM AREA"><b>ROOM AREA</b></label>
    
<?php


$conn = new mysqli($db_host, $db_login, $db_password, $db_database) 
or die ('Cannot connect to db');

    $result = $conn->query("select id, area_name from mrbs_area");
    
 
    echo "<select name='areas'>";

    while ($row = $result->fetch_assoc()) {

                  unset($id, $name);
                  $id = $row['id'];
                  $name = $row['area_name']; 
                  echo '<option value="'.$id.'">'.$name.'</option>';
                 
}

    echo "</select>";
 
?>
</BR>
  
    <hr>

    <button type="submit">NEXT</button>
  </div>

  
</form>

