<?php session_start();
date_default_timezone_set("Asia/Calcutta");   //India time (GMT+5:30)
include "conn.php";

if ($_POST['comments'] && $_POST['status']) 
{
    $v_code = $_SESSION['v_code'];
    
    $code = $_POST['code'];
	$comments = $_POST['comments'];
	$status = $_POST['status'];
	$next_followup_date=$_POST['next_date'];
	
	$time=date('d-m-Y H:i:s');
	$query = "INSERT INTO `tbl_follow_up` (`lead_id`,`v_code`,`date`,`comments`,`status`,next_date) VALUES ('$code','$v_code','$time','$comments','$status','$next_followup_date')";

	$smt = mysqli_query($conn, $query);
	if ($smt) {
		echo "Follow-up added successfully ";
	} else {
		echo ("Failed ! Error Description: " . mysqli_error($conn));
	}
} 
else 
{
	echo ("Enter all * Marked Fields. " . mysqli_error($conn));
}

?>