<?php
/* Attempt to connect to MySQL database */
$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);

 
    //Verifying the required parameters
    // verifyRequiredParams(array('firstname', 'email', 'password'));
$id=$request->getAttribute('mark_id');
$paper=$request->getParsedBody()['paper'];
$max_mark=$request->getParsedBody()['max_marks'];
$min_mark=$request->getParsedBody()['min_marks'];

 $data=array();

  $query ="UPDATE  set_marks SET paper=?,max_marks=?,min_marks=? WHERE id='$id'";
  $stmt = $con->prepare($query);
 $stmt->bind_param("sss",$paper,$max_mark,$min_mark);
  //$stmt->execute();
 $result = $stmt->execute();
        $stmt->close();
        if($result==true){
            $data=
        array(
            'paper' => $paper,
            'max_marks' =>$max_mark,
            'min_marks' => $min_mark,
         );
    
    $message=$data;

$response=array('status' => "true",'Message' => "Paper Marks updated Succesfully",'Faculty' => $message);
echo json_encode($response);
        }
        else{
          $response=array('status' => "false",'Message' => "Update Paper Marks Failed");
         echo json_encode($response);
        }   
?>