<?php
$msg='';

include("include/settings.php");
include("checksession.php");

if(isset($_POST['lead_id']) && isset($_POST['executive_id']))
{
	$memberdetailmaster=$mysqli->prepare("select * from rishta_leadmaster where lead_id=?");
	$memberdetailmaster->bind_param("i",$_POST['lead_id']);
	$memberdetailmaster->execute();
	$memberdetailresult=$memberdetailmaster->get_result();

	if(mysqli_num_rows($memberdetailresult)>0)
	{
		$lead_id=$_POST['lead_id'];
		
		$usermaster=$mysqli->prepare("update rishta_leadmaster set lead_allocated_to=? where lead_id=?");
		$usermaster->bind_param("ii",$_POST['executive_id'],$lead_id);
		$usermaster->execute();
		$usermaster->close();	
	}
	else
	{
		header("location:home.php");
	}	
}
else
{
	header("location:home.php");
}
?>