<?php
 	session_start();

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
date_default_timezone_set("Asia/Kolkata");
		$mdate= date('Y-m-d');
		$mdatetime= date('Y-m-d H:i:s');
		$cdatetime= date('Y-m-d H:i:s');
	$brmid = $_SESSION['linkarisebranchid'];
	$umid = $_SESSION['linkariseumid'];
$cmpmid = $_SESSION['linkarisecmpmid'];
	include("connect.php");

	//$salesmid=$_SESSION['salesmid'];
	$qmid=$_POST['qmid'];
	$partymid=$_POST['partymid'];
	//$rmid=$_SESSION['rmid'];
	$fdate=date("Y-m-d", strtotime($_POST['fdate']));  
	$remarks=$_POST['remarks'];

	
	 $evefup = "INSERT INTO res_followup_detail (partymid, ftype,fdate, qmid, fremarks, fstatus, cmpmid, faddedby, fupdatedby, faddedon, fupdatedon) VALUES ('$partymid','Quotation','$fdate', '$qmid', '$remarks', 'Open', $cmpmid, '$umid', '$umid', '$cdatetime', '$cdatetime')";
	
	if ($conn->query($evefup) === TRUE)
	{
		$last_id = $conn->insert_id;
		 $eve3 = "update res_quotation_master set followup='Yes',followdate='$fdate',followremarks='$remarks' where qmid='$qmid'";
		$re3 = mysqli_query($conn, $eve3);
		

		$_SESSION['msg'] = "Follow-Up Addded";

	}else
	{

		$_SESSION['msg'] = "";
}

	header("Location: quotationfollowup.php");


?>
