<?php
 	session_start(); 

	if(!isset($_SESSION['tulsilogin']))
	{
		header('Location: index.php');
		return;
	}

date_default_timezone_set("Asia/Kolkata");
	$mdate1= date('Y-m-d H:i:s');
	

$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
include("mylibrary.php");
	$umid = $_SESSION['umid'];
	//$tmdocument=$_POST['tmdocument'];
	
	
	$countrymid = $_POST['countrymid'];
	$visatmid = $_POST['visatmid'];
	$subservicemid = $_POST['subservicemid'];
	$branchmid = $_POST['branchmid'];
	$collegemid = $_POST['collegemid'];
	$purpose = checkvalidstring($_POST['purpose']);
	$dmdeadline =date("Y-m-d H:i:s" ,strtotime($_POST['dmdeadline']));
	$dmassignto = $_POST['dmassignto'];
	$dmname = checkvalidstring($_POST['dmname']);
	
	
	
		 $eve1 = "INSERT INTO res_dmdesign_master (countrymid,visatmid,requestedby,requestedon,subservicemid,branchmid,collegemid,purpose,dmdeadline,dmassignto,dmname) VALUES('$countrymid','$visatmid','$umid','$mdate1','$subservicemid','$branchmid','$collegemid','$purpose','$dmdeadline','$dmassignto','$dmname')";
		$re1 = mysqli_query($conn, $eve1);
		
		$_SESSION['msg'] = "Record saved successfully";
	header('Location: dmdesign.php');
	
	
	
			
	
			
	
?>