<?php
include("../connect.php"); 
$response = array();
if(isset($_POST['policy_no']))
{
	$policy_number = $_POST['policy_no'];
	date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d")." ".date('h:i:sa');
	$res_product_stock = mysqli_query($con,"SELECT * FROM  tbl_policy_master where policy_no='$policy_no' and status='Active'");
	if(mysqli_num_rows($res_product_stock)>0)
	{	
		$uq2=mysqli_query($con,"update tbl_policy_master set status='Closed' where policy_no='$policy_no' and status='Active'"); 
		$response['success']='1';
		$response['details']="Update Status Successful";			
	}
	else
	{
		$response['success']='0';
		$response['details']="Id Not Valid";
	}
}
else
{
	$response['success']='0';
	$response['details']="Required field missing";
}	
echo json_encode($response);
?>