<?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'];
	
	$testmid= $_POST['testmid'];
	$testname=checkvalidstring ($_POST['testname']);
	$testcenter=checkvalidstring ($_POST['testcenter']);
	$testdatetime= date("Y-m-d H:i:s",strtotime($_POST['testdatetime']));
	
	
		 $eve1 = "Update res_test_master set testname='$testname',testdatetime='$testdatetime',testcenter='$testcenter',subservicemid='$subservicemid',tupdatedon='$mdate1',tupdatedby='$umid1' where testmid=$testmid";
	
		$re1 = mysqli_query($conn, $eve1);
			
	$_SESSION['msg'] = "Record updated successfully";
	header('Location: test.php');
			
	
?>