<?php 
	include "../koneksi.php" ;
	$foto = $_FILES['foto']['name'];
	$file_tmp = $_FILES['foto']['tmp_name'] ;
	$lot = $_POST['lot'] ;
	$prod = $_POST['prod'] ;
	move_uploaded_file($file_tmp, '../../file/'.$foto) ;
	$query = "insert INTO coa_bb SET MaterialID = '$prod',
										Lot = '$lot',
										File = '$foto'";
	mysqli_query($koneksi, $query) 
	or die("SQL Error " .mysqli_error());
	header('Location:../index.php?switch=coa_bb');
?>