<?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");
	
	//$batchname=$_POST['batchname'];
	$subservicemid= $_POST['subservicemid'];
	$umid= $_POST['umid'];
	$branchmid= $_POST['branchmid'];
	$batchmid= $_POST['batchmid'];
	$batchname=checkvalidstring ($_POST['batchname']);
	$batchtiming=checkvalidstring ($_POST['batchtiming']);
	$batchstartdate= date("Y-m-d",strtotime($_POST['batchstartdate']));
	$batchenddate= date("Y-m-d",strtotime($_POST['batchenddate']));
	
		$eve1 = "Update res_batch_master set batchname='$batchname,batchstartdate='$batchstartdate',batchenddate='$batchenddate',batchtiming='$batchtiming',subservicemid='$subservicemid',umid='$umid',bupdatedon='$mdate1',bupdatedby='$umid1',branchmid='$branchmid' where batchmid=$batchmid";
		$re1 = mysqli_query($conn, $eve1);
			
	$_SESSION['msg'] = "Record updated successfully";
	header('Location: batch.php');
			
	
?>