<?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');
	
	
	
	$itemname=removespecialchar($_POST['itemname']);
	$itemdetail=removespecialchar($_POST['itemdetail']);

	$itemunit=$_POST['itemunit'];

	
	
	$eve1 = "INSERT INTO res_item_master (itemname,itemdetail,itemunit) 
	VALUES('$itemname','$itemdetail','$itemunit')";	
	if ($conn->query($eve1) === TRUE)
	{
		$last_id = $conn->insert_id;
		$_SESSION['msg'] = "Record has been added successfully";
	}
	else
	{
		$_SESSION['msg1'] = "Error";
	}
	
	header('Location: item.php');
?>