<?php

session_start(); 
	

	if(!isset($_SESSION['linkarisesuloginsesion']))
	{
		header('Location: index.php');
		return;
	}
	
	include("connect.php");
	include("removespecial.php");
	
	date_default_timezone_set("Asia/Singapore");
	$mdate1= date('Y-m-d H:i:s');
	$mdate2= date('d-m-Y');
	
	
	$itemid=$_POST['itemid'];
	
	$itemname=removespecialchar($_POST['itemname']);
	$itemdetail=removespecialchar($_POST['itemdetail']);
	
	$itemunit=$_POST['itemunit'];
	
	 $eve = "update res_item_master set itemname='$itemname', itemdetail='$itemdetail',itemunit='$itemunit' where itemmid=$itemid";
	
	
	if ($conn->query($eve) === TRUE)
	{
			
		$_SESSION['msg'] = "Record has been updated successfully";	
	}
	else
	{
		$_SESSION['msg1'] = "Error";
	}
	header('Location: item.php');
?>