<?php


define('DB_SERVER', 'localhost');
define('DB_USERNAME', 'Restax_final');

define('DB_PASSWORD', 'Restax_final123');

define('DB_NAME', 'Restax_api_data');  

$con = new mysqli(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

$block_id = $request->getAttribute('block_id');
$floor_id = $request->getAttribute('floors');


if(mysqli_connect_errno())
{
	echo "Failed to connect mysqli".mysqli_connect_errno();
}


/////get room number block id number/////

$sql_seat="SELECT set_seats.id,set_seats.set_rooms_room_id,set_seats.seats,set_seats.proctors,set_rooms.room_name FROM  set_seats INNER JOIN set_rooms ON set_rooms.room_id = set_seats.set_rooms_room_id  WHERE set_seats.set_blocks_block_id = '$block_id' AND set_seats.floors = '$floor_id'";

$result_seat=mysqli_query($con,$sql_seat);


$i=0;
    while ($row_seat[]=mysqli_fetch_assoc($result_seat)) {  


$user_seat = $row_seat;

//$array1 = array("checked"=>"false");
$array = array("checked"=>"false");

print_r($array1);
$user_seating[] = array_merge($user_seat[$i],$array);
$i++;
}



//print_r($user_seat);



  echo json_encode($user_seating);
?>