
<?php
	 include('../conn.php');
if(isset($_POST['submit'])){

  
  $name=$_POST['name'];
   $qty=$_POST['qty'];
  $id=$_POST['id'];
  $location=$_POST['location'];
  $date=$_POST['date'];
  $time=$_POST['time'];
  $by=$_POST['by'];



  
    // Image db insert sql
    $sql = "INSERT INTO `bar_inventory`(`item_id`, `name`,`quantity` , `uploadby`,`date`,`time`) VALUES ('$id','$name','$qty','$by','$date','$time')";
    if(mysqli_query($conn,$sql)){
     echo"<script>alert('Item added succesfully'); window.location.href='../bar'</script>";
 
    }
    else{
      echo 'Error: '.mysqli_error($conn);
    }
  }
  



?>