<?
session_start();
if(strlen($user)<=0)
{
 print "<script> alert('You are not logged in') </script>";
 include("logout.php");
 return;
}

$entrydate=date("Y-m-d");
include("opendb.php");
$re=mysqli_query($db,"select * from jcarditemmaster where item='$item'");
 if(mysqli_num_rows($re)>0)
 {
  print "<script> alert('Item already exists'); history.back(1); </script>";
  return;
 }


$sql1="insert into jcarditemmaster (item,brcode,id,entrydate) values( '$item','$brcode','','$entrydate')";

mysqli_query($db,$sql1)or die('sq1 err'.mysqli_error($db));

echo "<meta http-equiv='refresh' content='.1;url=jobinvmaster.php'>";
?>