
<?php
include("../connect.php"); 
$response = array();
if(isset($_POST['m_name']) && isset($_POST['m_phone']) && isset($_POST['manager_id']) && isset($_POST['address']) && isset($_POST['email']))
{
	$ver = $_POST['manager_id'];
	$m_name=$_POST['m_name'];
	$m_phone=$_POST['m_phone'];
	$address=$_POST['address'];
	$email=$_POST['email'];
	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 phone_no='$phone_no'");
	// if(mysqli_num_rows($res_product_stock)<=0)
	// {		
		$query = mysqli_query($con,"INSERT INTO `tbl_customer`(`manager_id`, `customer_name`, `phone_no`, `address`, `email`, `insert_datetime`,`status`) VALUES ('$ver','$m_name','$m_phone','$address','$email','$cdate','Active')");	
		$response['success']='1';
		$response['details']="Insert Successful";			
	// }
	// else
	// {
	// 	$response['success']='0';
	// 	$response['details']="Customer already exists";
	// }
}
else
{
	$response['success']='0';
	$response['details']="Required field missing";
}	
echo json_encode($response);
?>