                                                                                                                                         


<?php

$con = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);



        $block_id = $request->getAttribute('block_id');
		$block_name=$request->getParsedBody()['block_name'];
	    $block_shortcode=$request->getParsedBody()['block_shortcode'];
		$floors=$request->getParsedBody()['floors'];
		
				
	$sql= ("UPDATE set_blocks SET  block_name='$block_name', block_shortcode='$block_shortcode' , floors='$floors' WHERE block_id=$block_id");	
	
 if($con->query($sql)){
		$data=array(
    "block_id" => $block_id,
	"block_name"=>$block_name,
	"block_shortcode"=>$block_shortcode,	
	"floors"=>$floors,
	);
	    $message=$data;
	

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

?>
