<?php
	include "koneksi.php";
	
	$mhb_id=mysqli_real_escape_string($conn,$_GET["id"]);
    echo "ini mhb id :".$mhb_id."<br>";	
    $tanggal_periksa_kelengkapan_cylinder = date('d / M / y');
    $cuci=$_POST['cuci'];
    echo "<br>".$cuci;
  
	if ($cuci == 1)//sudah dicuci
	{
		$query = "UPDATE fom_dissasembly_checklist SET status_cuci = '$cuci' WHERE no_mhb_barang_job =".$mhb_id;
		$result = mysqli_query($conn, $query);
		
		$query2 = "UPDATE barang_job SET status = '3' WHERE no_mhb_barang_job =".$mhb_id; //status = 3 adalah untuk cleaning
		$result = mysqli_query($conn, $query2);
		if($result && $result2)
	    {
			echo "berhasil".$query;
			header("location:cleaningAndDat.php?p=1");
	    }
	    else
	    {
			echo "gagal".$query;
			header("location:cleaningAndDat.php?p=6");
			echo "<br>"."query1".$query;
			echo "<br>"."query2".$query2;
	    }
	}
    else if ($cuci == 2)
	{
		//kembali ke cleaning and dat tanpa proses
		header("location:cleaningAndDat.php?p=6");
	}	
    
?>