<?php
include("../connect.php"); 
$response = array();
if(isset($_POST['customer_id']) && isset($_POST['status']))
{
	$cust_id = $_POST['customer_id'];
	$status=$_POST['status'];
	date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d")." ".date('h:i:sa');
	$res_product_stock = mysqli_query($con,"SELECT customer_name FROM  tbl_customer where customer_id='$cust_id'");
	if(mysqli_num_rows($res_product_stock)>0)
	{	
		$uq2=mysqli_query($con,"update tbl_customer set status='$status',update_datetime='$cdate' where customer_id='$cust_id'"); 
		$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);
?>