<?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_time=$request->getParsedBody()['date_time'];
     $exam_name=$request->getParsedBody()['exam_name'];
      $proctor_id=$request->getParsedBody()['proctor_id'];
       $block=$request->getParsedBody()['block'];
	    $floor=$request->getParsedBody()['floor'];
	     $room=$request->getParsedBody()['room'];
	      $papers=$request->getParsedBody()['papers'];
	       $total_students=$request->getParsedBody()['total_students'];
	        $students=$request->getParsedBody()['students'];
			
			
$response=array();
/*
$sqll="(SELECT * FROM assign_papers WHERE  papers_id='$papers_id')";
$res= $con->query($sqll);
if($res->num_rows>0)
{
$response1=array('status' => "true",'Message' => "data already exist");
echo json_encode($response1);
}

else{
*/
$sql="INSERT INTO proctors_sheet(course_id,season_id,exams_id,date_time,exam_name,proctor_id,block,floor,room,papers,total_students,students) VALUES 
('$course_id','$season_id','$exams_id','$date_time',
'$exam_name','$proctor_id','$block','$floor','$room','$papers','$total_students','$students')";

$res= $con->query($sql);
	
if($res==true)
{
		$data=array(
	"course_id"=>$course_id,
	"season_id"=>$season_id,
	"exams_id"=>$exams_id,	
	"date_time"=>$dept_id,
	"exam_name"=>$exam_name,
	"proctor_id"=>$proctor_id,
	"block"=>$block,
	"floor"=>$floor,
	"room"=>$room,
	"papers"=>$papers,
	"total_students"=>$total_students,
	"students"=>$students,
	
	
	
	);
	    $message=$data;

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


?>