<?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);


$course_id = $request->getAttribute('course_id');
$season_id = $request->getAttribute('season_id');
$exams_id = $request->getAttribute('exams_id');
$paper = $request->getAttribute('paper');

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


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

$sql_seat="SELECT slots FROM schedule_exam WHERE course_id = '$course_id' AND season_id = '$season_id' AND exams_id = '$exams_id' AND paper_id = '$paper'";

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

    while ($row_seat=mysqli_fetch_assoc($result_seat)) {  


$user[] = $row_seat;

// $user_seat[] = $row_seat['slots'];

// $keys = array('slots');

// $final_data[] = array_combine($keys,$user_seat);

}



  echo json_encode($user);
?>