<?php
 	session_start(); 

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



$_SESSION['_token']=bin2hex(openssl_random_pseudo_bytes(16));
	
	
	include("connect.php");
include("mylibrary.php");
	$usermid = $_SESSION['umid'];
date_default_timezone_set("Asia/Kolkata");
	$mdate1= date('Y-m-d H:i:s');
	
	
	//$visatype=$_POST['visatype'];
	 $camdid=$_POST['camdid'];
	$camcondition=checkvalidstring($_POST['camcondition']);
	$camprocessdetail=checkvalidstring($_POST['camprocessdetail']);
	$camdocumentname=checkvalidstring($_POST['camdocumentname']);
	$collegemid=$_POST['collegemid'];
	$camstartdate=date("Y-m-d",strtotime($_POST['camstartdate']));
	$camdeadline=date("Y-m-d",strtotime($_POST['camdeadline']));
	
	$tt1 = "";
	if(empty($_FILES['camdocumnet']['name']) == false  )
	{
		$camdocumnet1 =checkvalidstring($_FILES['camdocumnet']['name']);
		$camdocumnet = date("YmdHis").$camdocumnet1;
		$path = "docs/";
		move_uploaded_file( $_FILES['camdocumnet']['tmp_name'], $path ."/". $camdocumnet );
		$tt1 = ",camdocumentname='$camdocumentname',camdocumnet='$camdocumnet'";
	
	}
	
	  $eve1 = "update res_collegeappmanagement_detail set  camcondition='$camcondition',camprocessdetail='$camprocessdetail',camstartdate='$camstartdate',camdeadline='$camdeadline' $tt1 where camdid=$camdid";
	
	
	if ($conn->query($eve1) === TRUE)

	{	
	
	}else{
		
	}
			
	$_SESSION['msg'] = "Record saved successfully";
	header('Location: collegedetail.php?id='.$collegemid);
			
	
?>