<?php
 session_start(); 

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}
	
	include("connect.php");
	date_default_timezone_set("Asia/Kolkata");
	$mdate= date('Y-m-d H:i:s');
	
	
	
	
	
	$fremarks=$_POST['fremarks'];
	$imid=$_POST['imid1'];
	$ifstatus=$_POST['ifstatus'];
	$ifaddedby=$_SESSION['umid'];
	$ifaddedtype=$_SESSION['utype'];
	$iftype=$_POST['iftype'];
	
	  $stiqmid=$_POST['stiqmid'];
	  $ufmid=$_POST['ufmid'];
	
	
	
	 $eve2 = "insert into res_inquiryfollowup_detail (imid,  fremarks,ifstatus,ifaddedby,ifaddedtype,ifaddedon,ifstatusnew,iftype,stiqmid) values ($imid,'$fremarks','$ifstatus',$ifaddedby,'$ifaddedtype','$mdate','Open','$iftype','$stiqmid')";
	
	
	if ($conn->query($eve2) === TRUE)
	{
		$last_id = $conn->insert_id;
		
		
		$eve3 = "update res_upcomingfollowup_master set ustatus=1 where  ufmid='$ufmid' ";
		$re3 = mysqli_query($conn, $eve3);
		
		
		$_SESSION['msg'] = "Record has been added successfully";
	}
	else
	{
		$_SESSION['msg1'] = "Error";
	}
	
	if($_SESSION['frompage']=='followupadd')
	{
		header("Location: followup.php");
	}
	else
	{
		header("Location: inquirydetail.php?id=$imid#student_inquires");
	}
?>	