<?php
session_start();

	if(!isset($_SESSION['linkarisecrm']))
	{
		header('Location: index.php');
		return;
	}
	date_default_timezone_set("Asia/Singapore");
	 $mdate1= date('Y-m-d');
	 $mdatetime= date('Y-m-d H:i:s');
	 $cdatetime= date('Y-m-d H:i:s');

	
	$umid = $_SESSION['linkariseumid'];


	include("connect.php");

	 
	 $jobworkdid=$_POST['jobworkdid'];
	  $itemmid=$_POST['itemmid'];
    $itemname=$_POST['itemname'];
    $itemdetail=$_POST['itemdetail'];
    $itemqty=$_POST['itemqty'];
	
		 $eve1 = "INSERT INTO res_jobworkitem_detail (jobworkdid,itemid, itemname, itemdetail, itemqty) VALUES ('$jobworkdid','$itemmid', '$itemname', '$itemdetail', '$itemqty')";
		 if ($conn->query($eve1) === TRUE)
		{
			$last_id = $conn->insert_id;
				
			$_SESSION['msg'] = "Item Addded";
			

		}
		else
		{
			$_SESSION['msg1'] = "Item Not Addded";
			
		}
	
	
	 
	header("Location: jobworkadd.php"); 

?>
