<?php
include("../connect.php"); 
$response = array();
if(isset($_POST['agent_id']) && isset($_POST['customer_id']) && isset($_POST['manager_id']) && isset($_POST['premium_amt']))
{
	$ver = $_POST['manager_id'];
	$agent_id=$_POST['agent_id'];
	$customer_id=$_POST['customer_id'];
	$pamt=$_POST['premium_amt'];
	$policy_no=$_POST['policy_no'];
	date_default_timezone_set('Asia/Calcutta');
	$cdate  = date("Y-m-d");
	$ctime = date('h:i:sa');
	$query = mysqli_query($con,"INSERT INTO `tbl_customer_premium`(`manager_id`,`agent_id`,`customer_id`,`premium_amt`,`transaction_date`,`transaction_time`,`status`,`policy_no`) VALUES ('$ver','$agent_id','$customer_id','$pamt','$cdate','$ctime','Pending','$policy_no')");	
	$response['success']='1';
	$response['details']="Assign Successful";			
}
else
{
	$response['success']='0';
	$response['details']="Required field missing";
}	
echo json_encode($response);
?>