										                                                                                                         

<?php



$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
     
		$course_id=$request->getParsedBody()['course_id'];
		$season_id=$request->getParsedBody()['season_id'];
		$exams_id=$request->getParsedBody()['exams_id'];
		$date=$request->getParsedBody()['date'];
		$time=$request->getParsedBody()['time'];
		$blockid=$request->getParsedBody()['blockid'];
		$floors=$request->getParsedBody()['floors'];
		$room_id=$request->getParsedBody()['room_id'];
		$seats=$request->getParsedBody()['seats'];
		$proctors=$request->getParsedBody()['proctors'];
			
$response=array();

$sql="INSERT INTO seatingarrangements (course_id,season_id,exams_id,date,time,blockid,floors,room_id,seats,proctors)
VALUES ('$course_id','$season_id','$exams_id','$date','$time','$blockid','$floors',
'$room_id','$seats','$proctors')";

$res= $con->query($sql);
	
if($res==true)
{
		$data=array(
	
	"course_id"=>$course_id,
	"season_id"=>$season_id,
	"exams_id"=>$exams_id,
	"date"=>$date,
	"time"=>$time,
	"blockid"=>$blockid,
	"floors"=>$floors,
	"room_id"=>$room_id,
	"seats"=>$seats,
	"proctors"=>$proctors,
	
	);
	    $message=$data;

	$response=array('status' => "true",'Message' => "Data inserted successfully",'seatingarrangements' => $message);
echo json_encode($response);
        
}
        else{
          $response=array('status' => "false",'Message' => " insert data failed");
         echo json_encode($response);
        }   
		
	



?>