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


$id = $request->getAttribute('id');
$status = json_encode($request->getParsedBody()['status']);
//  $status = $request->getParsedBody('status');
// $status = ["1","1","1"];


			
	$sql= ("UPDATE pwi_submit SET  status='$status' WHERE proctor_sheet_id=$id");	
	
 if($con->query($sql)){
		$data=array(
    "id" => $id,
	"rollnumber"=>$rollnumber,
	"student_name"=>$student_name,
	"detained"=>$detained,
	
	);
	    $message=$data;
	

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

?>