<?php
include "../koneksi.php";

$plan_id = $_POST['plan_id'];
$shift = $_POST['shift'];
$kode = $_POST['kode'];
$nolot = $_POST['nolot'];
$material = $_POST['material'];

if (empty($data['error'])) {
		$query = "insert INTO stpj SET
										PlanID = '$plan_id',
										Shift = '$shift',
										Kode = '$kode',
										NoLot = '$nolot',
										Material = '$material'
										";

		mysqli_query($koneksi, $query)
		or die ("Gagal Perintah SQL".mysql_error());
    $data['hasil'] = 'sukses';
    
} else {
    
    $data['hasil'] = 'gagal';
}

echo json_encode($data);
header('Location:lap_prod.php?id='.$plan_id.'&shift='.$shift);

?>