<?php

 	session_start(); 

	include("connect.php");

	if(!isset($_SESSION['tulsilogin']))

	{

		header('Location: index.php');

		return;

	}



	date_default_timezone_set("Asia/Kolkata");

	$mdate1= date('Y-m-d H:i:s');

	$mdate2= date('Y-m-d');



	

	$imid=$_POST['imid1'];

	

	$cdmsg=$_POST['cdmsg'];

	$cdaddedby=$_SESSION['umid'];

	$ctype='Staff';

	

	 $eve1 = "INSERT INTO res_chat_detail (cdmsg,caddedon,ctype,imid,cdaddedby) VALUES('$cdmsg','$mdate1','$ctype',$imid,$cdaddedby)";

	 $re1 = mysqli_query($conn, $eve1);

		

	

	

	

	

	

			
if($_SESSION['frompage']=='aplicationInquirydetailpage')
			{
				$stiqmid = $_POST['stiqmid'];
				header("Location: applicationinquirydetail.php?id=$stiqmid&chat=yes");
			}else{
	header("Location: inquirydetail.php?id=$imid&chat=yes");
			}
	

	

?>