<?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));
	$umid1 = $_SESSION['umid'];
	
	include("connect.php");
include("mylibrary.php");
	
	//$testname=$_POST['testname'];
	$subservicemid= $_POST['subservicemid'];
	
	
	$testname=checkvalidstring ($_POST['testname']);
	$testcenter=checkvalidstring ($_POST['testcenter']);
	
	$testdatetime= date("Y-m-d H:i:s",strtotime($_POST['testdatetime']));
	
	
	
	
	
	$attechment="";
	/* if(empty($_FILES['attechment']['name']) == false  )
	{
		$attechment = date("YmdHis").$_FILES['attechment']['name'];
		$path = "docs/";
		move_uploaded_file( $_FILES['attechment']['tmp_name'], $path ."/". $attechment );
	
	}
	 */
	
	
		
		
		 $eve1 = "INSERT INTO res_test_master (testname,testdatetime,testcenter,subservicemid,taddedon,taddedby,tupdatedon,tupdatedby) VALUES('$testname','$testdatetime','$testcenter','$subservicemid','$mdate1','$umid1','$mdate1','$umid1')";
	
		$re1 = mysqli_query($conn, $eve1);
			
	$_SESSION['msg'] = "Record saved successfully";
	header('Location: test.php');
			
	
?>