<?php
	include "koneksi.php";
	$id = mysqli_real_escape_string($conn, $_GET["id"]);
    $q = "SELECT * FROM data_karyawan WHERE id='$id'";

	$no_mhb_barang_job=mysqli_real_escape_string($conn,$_GET["id"]);
	
	$form=$_POST["form"];
	
	$ukuranSurfaceID=$_POST["ukuranSurfaceID"];
	$sizeSurviceID=$_POST["sizeSurviceID"];
	$upperSurviceID=$_POST["upperSurviceID"];
	$lowerSurviceID=$_POST["lowerSurviceID"];
	$x1SurviceID=$_POST["x1SurviceID"];
	$y1SurviceID=$_POST["y1SurviceID"];
	$z1SurviceID=$_POST["z1SurviceID"];
	
	$x2SurviceID=$_POST["x2SurviceID"];
	$y2SurviceID=$_POST["y2SurviceID"];
	$z2SurviceID=$_POST["z2SurviceID"];
	
	$x3SurviceID=$_POST["x3SurviceID"];
	$y3SurviceID=$_POST["y3SurviceID"];
	$z3SurviceID=$_POST["z3SurviceID"];
	
	$x4SurviceID=$_POST["x4SurviceID"];
	$y4SurviceID=$_POST["y4SurviceID"];
	$z4SurviceID=$_POST["z4SurviceID"];
	
	$x5SurviceID=$_POST["x5SurviceID"];
	$y5SurviceID=$_POST["y5SurviceID"];
	$z5SurviceID=$_POST["z5SurviceID"];
	
	$x6SurviceID=$_POST["x6SurviceID"];
	$y6SurviceID=$_POST["y6SurviceID"];
	$z6SurviceID=$_POST["z6SurviceID"];
	
	$x7SurviceID=$_POST["x7SurviceID"];
	$y7SurviceID=$_POST["y7SurviceID"];
	$z7SurviceID=$_POST["z7SurviceID"];
	
	$x8SurviceID=$_POST["x8SurviceID"];
	$y8SurviceID=$_POST["y8SurviceID"];
	$z8SurviceID=$_POST["z8SurviceID"];
	
	//survace id condition
	$conditionSurviceID=$_POST["conditionSurviceID"];
	
	//thickness min 50
	$aThicknessMinSurviceID=$_POST["aThicknessMinSurviceID"];
	$bThicknessMinSurviceID=$_POST["bThicknessMinSurviceID"];
	$cThicknessMinSurviceID=$_POST["cThicknessMinSurviceID"];
	$dThicknessMinSurviceID=$_POST["dThicknessMinSurviceID"];
	$eThicknessMinSurviceID=$_POST["eThicknessMinSurviceID"];
	
	//roughness (ra) in
	$roughnessSurfaceID1=$_POST["roughnessSurfaceID1"];
	$roughnessSurfaceID2=$_POST["roughnessSurfaceID2"];
	$roughnessSurfaceID3=$_POST["roughnessSurfaceID3"];
	
	//spec bending max
	$aSpecBendingSurfaceID=$_POST["aSpecBendingSurfaceID"];
	$bSpecBendingSurfaceID=$_POST["bSpecBendingSurfaceID"];
	$cSpecBendingSurfaceID=$_POST["cSpecBendingSurfaceID"];
	$dSpecBendingSurfaceID=$_POST["dSpecBendingSurfaceID"];
	$eSpecBendingSurfaceID=$_POST["eSpecBendingSurfaceID"];
	
	//welding joint
	$weldingJointSurficeID=$_POST["weldingJointSurficeID"];
	
	//kelurusan 
	$kelurusanSurficeID=$_POST["kelurusanSurficeID"];
	
	//kebocoran
	$kebocoranSurficeID=$_POST["kebocoranSurficeID"];
	
	//total length
	$totalLength=$_POST["totalLength"];
	
	//chrome length
	$chromeLength=$_POST["chromeLength"];
	
	//hardnes in HRC
	$minSurfaceID=$_POST["minSurfaceID"];
	$maxLengthSurfaceID=$_POST["maxLengthSurfaceID"];
	$aveLengthSurfaceID=$_POST["aveLengthSurfaceID"];
	
	// recomendation repar
	$recommendationRepairSurfaceOD=$_POST["recommendationRepairSurfaceOD"];
	
	
	//end rod 1
	$i1xEndRod=$_POST["i1xEndRod"];	
	$i1yEndRod=$_POST["i1yEndRod"];
	$ii1xEndRod=$_POST["ii1xEndRod"];
	$ii1yEndRod=$_POST["ii1yEndRod"];
	$iii1xEndRod=$_POST["iii1xEndRod"];
	$iii1yEndRod=$_POST["iii1yEndRod"];
	
	//end rod 2
	$i2xEndRod=$_POST["i2xEndRod"];	
	$i2yEndRod=$_POST["i2yEndRod"];
	$ii2xEndRod=$_POST["ii2xEndRod"];
	$ii2yEndRod=$_POST["ii2yEndRod"];
	$iii2xEndRod=$_POST["iii2xEndRod"];
	$iii2yEndRod=$_POST["iii2yEndRod"];
	
	//thread condition
	$threadConditionEndRod=$_POST["threadConditionEndRod"];
	
	//recomendation repair
	$recommendationRepairSurfaceOD2=$_POST["recommendationRepairSurfaceOD2"];
	
	//condition rod
	$conditionEndRod=$_POST["conditionEndRod"];
	
	//spec bend end rod max
	$aSpecBendEndRod=$_POST["aSpecBendEndRod"];
	$bSpecBendEndRod=$_POST["bSpecBendEndRod"];
	$cSpecBendEndRod=$_POST["cSpecBendEndRod"];
	$dSpecBendEndRod=$_POST["dSpecBendEndRod"];
	$eSpecBendEndRod=$_POST["eSpecBendEndRod"];
	
	//recomendation repair
	$recommendationRepairSurfaceOD3=$_POST["recommendationRepairSurfaceOD3"];
	
	//bracket Condition 
	$brackketConditionEndRod=$_POST["brackketConditionEndRod"];
	
    //hole thread	
	$holeThreadEndRod=$_POST["holeThreadEndRod"];
	
	 //hole thread	
	$recommendationRepairBracketConditionEndRod=$_POST["recommendationRepairBracketConditionEndRod"];
	
	 //hole thread	
	$recommendationRepairHoleThreadEndRod=$_POST["recommendationRepairHoleThreadEndRod"];
	
	//foto
	$nama_file = $_FILES['gambar']['name'];
    $ukuran_file = $_FILES['gambar']['size'];
    $tipe_file = $_FILES['gambar']['type'];
    $tmp_file = $_FILES['gambar']['tmp_name'];
	
	
	
	
	/////////////////////////////////////////////////Assy / Parsial dan Single Non Testing//////////////////////////////////////////////////////
	
	echo "form = ".$form."<br>";
	
	echo "ukuranSurfaceID = ".$ukuranSurfaceID."<br>";
	echo "sizeSurviceID = ".$sizeSurviceID."<br>";
	echo "upperSurviceID = ".$upperSurviceID."<br>";
	echo "lowerSurviceID = ".$lowerSurviceID."<br>";
	
	echo "x1SurviceID = ".$x1SurviceID."<br>";
	echo "y1SurviceID = ".$y1SurviceID."<br>";
	echo "z1SurviceID = ".$z1SurviceID."<br>";
	
	echo "x2SurviceID = ".$x2SurviceID."<br>";
	echo "y2SurviceID = ".$y2SurviceID."<br>";
	echo "z2SurviceID = ".$z2SurviceID."<br>";
	
	echo "x3SurviceID = ".$x3SurviceID."<br>";
	echo "y3SurviceID = ".$y3SurviceID."<br>";
	echo "z3SurviceID = ".$z3SurviceID."<br>";
	
	echo "x4SurviceID = ".$x4SurviceID."<br>";
	echo "y4SurviceID = ".$y4SurviceID."<br>";
	echo "z4SurviceID = ".$z4SurviceID."<br>";
	
	echo "x5SurviceID = ".$x5SurviceID."<br>";
	echo "y5SurviceID = ".$y5SurviceID."<br>";
	echo "z5SurviceID = ".$z5SurviceID."<br>";
	
	echo "x6SurviceID = ".$x6SurviceID."<br>";
	echo "y6SurviceID = ".$y6SurviceID."<br>";
	echo "z6SurviceID = ".$z6SurviceID."<br>";
	
	echo "x7SurviceID = ".$x7SurviceID."<br>";
	echo "y7SurviceID = ".$y7SurviceID."<br>";
	echo "z7SurviceID = ".$z7SurviceID."<br>";
	
	echo "x8SurviceID = ".$x8SurviceID."<br>";
	echo "y8SurviceID = ".$y8SurviceID."<br>";
	echo "z8SurviceID = ".$z8SurviceID."<br>";
	
	echo "conditionSurviceID = ".$conditionSurviceID."<br>";
	
	//thickness min 50
	echo "aThicknessMinSurviceID = ".$aThicknessMinSurviceID."<br>";
	echo "bThicknessMinSurviceID = ".$bThicknessMinSurviceID."<br>";
	echo "cThicknessMinSurviceID = ".$cThicknessMinSurviceID."<br>";
	echo "dThicknessMinSurviceID = ".$dThicknessMinSurviceID."<br>";
	echo "eThicknessMinSurviceID = ".$eThicknessMinSurviceID."<br>";
	
	//roughness (ra) in
	echo "roughnessSurfaceID1 = ".$roughnessSurfaceID1."<br>";
	echo "roughnessSurfaceID2 = ".$roughnessSurfaceID2."<br>";
	echo "roughnessSurfaceID3 = ".$roughnessSurfaceID3."<br>";
	
	//Spec Bending Max
	echo "aSpecBendingSurfaceID = ".$aSpecBendingSurfaceID."<br>";
	echo "bSpecBendingSurfaceID = ".$bSpecBendingSurfaceID."<br>";
	echo "cSpecBendingSurfaceID = ".$cSpecBendingSurfaceID."<br>";
	echo "dSpecBendingSurfaceID = ".$dSpecBendingSurfaceID."<br>";
	echo "eSpecBendingSurfaceID = ".$eSpecBendingSurfaceID."<br>";
	
	//welding joint
	echo "weldingJointSurficeID = ".$weldingJointSurficeID."<br>";
	
	//kelurusan 
	echo "kelurusanSurficeID = ".$kelurusanSurficeID."<br>";
	
	//kebocoran
	echo "kebocoranSurficeID = ".$kebocoranSurficeID."<br>";
	
	//total length
	echo "totalLength = ".$totalLength."<br>";
	
	//chrome length
	echo "chromeLength = ".$chromeLength."<br>";
	
	//hardnes in HRC
	echo "minSurfaceID = ".$minSurfaceID."<br>";
	echo "maxLengthSurfaceID = ".$maxLengthSurfaceID."<br>";
	echo "aveLengthSurfaceID = ".$aveLengthSurfaceID."<br>";

	// recomendation repar
	echo "recommendationRepairSurfaceOD = ".$recommendationRepairSurfaceOD."<br>";
	
	
	//end rod 1
	echo "i1xEndRod = ".$i1xEndRod."<br>";
	echo "i1yEndRod = ".$i1yEndRod."<br>";
	echo "ii1xEndRod = ".$ii1xEndRod."<br>";
	echo "ii1yEndRod = ".$ii1yEndRod."<br>";
	echo "iii1xEndRod = ".$iii1xEndRod."<br>";
	echo "iii1yEndRod = ".$iii1yEndRod."<br>";
	
	//end rod 2
	echo "i2xEndRod = ".$i2xEndRod."<br>";
	echo "i2yEndRod = ".$i2yEndRod."<br>";
	echo "ii2xEndRod = ".$ii2xEndRod."<br>";
	echo "ii2yEndRod = ".$ii2yEndRod."<br>";
	echo "iii2xEndRod = ".$iii2xEndRod."<br>";
	echo "iii2yEndRod = ".$iii2yEndRod."<br>";
	
	
	//thread condition
	echo "threadConditionEndRod = ".$threadConditionEndRod."<br>";
	
	//recomendation repair
	echo "recommendationRepairSurfaceOD2 = ".$recommendationRepairSurfaceOD2."<br>";
	
	//condition rod
	echo "conditionEndRod = ".$conditionEndRod."<br>";
	
	//spec bend end rod max
	echo "aSpecBendEndRod = ".$aSpecBendEndRod."<br>";
	echo "bSpecBendEndRod = ".$bSpecBendEndRod."<br>";
	echo "cSpecBendEndRod = ".$cSpecBendEndRod."<br>";
	echo "dSpecBendEndRod = ".$dSpecBendEndRod."<br>";
	echo "eSpecBendEndRod = ".$eSpecBendEndRod."<br>";
	
	//recomendation repair
	echo "recommendationRepairSurfaceOD3 = ".$recommendationRepairSurfaceOD3."<br>";
	
	//bracket Condition 
	echo "brackketConditionEndRod = ".$brackketConditionEndRod."<br>";
	
    //hole thread
    echo "holeThreadEndRod = ".$holeThreadEndRod."<br>";	
	
	 //hole thread
    echo "recommendationRepairBracketConditionEndRod = ".$recommendationRepairBracketConditionEndRod."<br>";	 
	
	 //hole thread	
	  echo "recommendationRepairHoleThreadEndRod = ".$recommendationRepairHoleThreadEndRod."<br>";
	
	
	echo "foto : = ".$nama_file."<br>";
	$tanggal_periksa_form = date('m-d-Y');
	if ($nama_file == NULL) //foto kosong
	{
		echo "Foto kosong";
		$query = "INSERT INTO form_mhb_fr_qc_001_02 (
										no_mhb_barang_job,
										 tanggal_periksa_form,
										 form,
										 ukuranSurfaceID,
										 sizeSurviceID,
										 upperSurviceID,
										 lowerSurviceID,
										 x1SurviceID,
										 y1SurviceID,
										 z1SurviceID,
										 x2SurviceID,
										 y2SurviceID,
										 z2SurviceID,
										 x3SurviceID,
										 y3SurviceID,
										 z3SurviceID,
										 x4SurviceID,
										 y4SurviceID,
										 z4SurviceID,
										 x5SurviceID,
										 y5SurviceID,
										 z5SurviceID,
										 x6SurviceID,
										 y6SurviceID,
										 z6SurviceID,
										 x7SurviceID,
										 y7SurviceID,
										 z7SurviceID,
										 x8SurviceID,
										 y8SurviceID,
										 z8SurviceID,
										 conditionSurviceID,
										 aThicknessMinSurviceID,
										 bThicknessMinSurviceID,
										 cThicknessMinSurviceID,
										 dThicknessMinSurviceID,
										 eThicknessMinSurviceID,
										 roughnessSurfaceID1,
										 roughnessSurfaceID2,
										 roughnessSurfaceID3,
										 aSpecBendingSurfaceID,
										 bSpecBendingSurfaceID,
										 cSpecBendingSurfaceID,
										 dSpecBendingSurfaceID,
										 eSpecBendingSurfaceID,
										 weldingJointSurficeID,
										 kelurusanSurficeID,
										 kebocoranSurficeID,
										 totalLength,
										 chromeLength,
										 minSurfaceID,
										 maxLengthSurfaceID,
										 aveLengthSurfaceID,
										 recommendationRepairSurfaceOD,
										 i1xEndRod,
										 i1yEndRod,
										 ii1xEndRod,
										 ii1yEndRod,
										 iii1xEndRod,
										 iii1yEndRod,
										 i2xEndRod,
										 i2yEndRod,
										 ii2xEndRod,
										 ii2yEndRod,
										 iii2xEndRod,
										 iii2yEndRod,
										 threadConditionEndRod,
										 recommendationRepairSurfaceOD2,
										 conditionEndRod,
										 aSpecBendEndRod,
										 bSpecBendEndRod,
										 cSpecBendEndRod,
										 dSpecBendEndRod,
										 eSpecBendEndRod,
										 recommendationRepairSurfaceOD3,
										 brackketConditionEndRod,
										 holeThreadEndRod,
										 recommendationRepairBracketConditionEndRod,
										 recommendationRepairHoleThreadEndRod)
							
							       VALUE
							             ('$no_mhb_barang_job',
										 '$tanggal_periksa_form',
										 '$form',
										 '$ukuranSurfaceID',
										 '$sizeSurviceID',
										 '$upperSurviceID',
										 '$lowerSurviceID',
										 '$x1SurviceID',
										 '$y1SurviceID',
										 '$z1SurviceID',
										 '$x2SurviceID',
										 '$y2SurviceID',
										 '$z2SurviceID',
										 '$x3SurviceID',
										 '$y3SurviceID',
										 '$z3SurviceID',
										 '$x4SurviceID',
										 '$y4SurviceID',
										 '$z4SurviceID',
										 '$x5SurviceID',
										 '$y5SurviceID',
										 '$z5SurviceID',
										 '$x6SurviceID',
										 '$y6SurviceID',
										 '$z6SurviceID',
										 '$x7SurviceID',
										 '$y7SurviceID',
										 '$z7SurviceID',
										 '$x8SurviceID',
										 '$y8SurviceID',
										 '$z8SurviceID',
										 '$conditionSurviceID',
										 '$aThicknessMinSurviceID',
										 '$bThicknessMinSurviceID',
										 '$cThicknessMinSurviceID',
										 '$dThicknessMinSurviceID',
										 '$eThicknessMinSurviceID',
										 '$roughnessSurfaceID1',
										 '$roughnessSurfaceID2',
										 '$roughnessSurfaceID3',
										 '$aSpecBendingSurfaceID',
										 '$bSpecBendingSurfaceID',
										 '$cSpecBendingSurfaceID',
										 '$dSpecBendingSurfaceID',
										 '$eSpecBendingSurfaceID',
										 '$weldingJointSurficeID',
										 '$kelurusanSurficeID',
										 '$kebocoranSurficeID',
										 '$totalLength',
										 '$chromeLength',
										 '$minSurfaceID',
										 '$maxLengthSurfaceID',
										 '$aveLengthSurfaceID',
										 '$recommendationRepairSurfaceOD',
										 '$i1xEndRod',
										 '$i1yEndRod',
										 '$ii1xEndRod',
										 '$ii1yEndRod',
										 '$iii1xEndRod',
										 '$iii1yEndRod',
										 '$i2xEndRod',
										 '$i2yEndRod',
										 '$ii2xEndRod',
										 '$ii2yEndRod',
										 '$iii2xEndRod',
										 '$iii2yEndRod',
										 '$threadConditionEndRod',
										 '$recommendationRepairSurfaceOD2',
										 '$conditionEndRod',
										 '$aSpecBendEndRod',
										 '$bSpecBendEndRod',
										 '$cSpecBendEndRod',
										 '$dSpecBendEndRod',
										 '$eSpecBendEndRod',
										 '$recommendationRepairSurfaceOD3',
										 '$brackketConditionEndRod',
										 '$holeThreadEndRod',
										 '$recommendationRepairBracketConditionEndRod',
										 '$recommendationRepairHoleThreadEndRod')";
										 
			$resultInsert = mysqli_query($conn, $query);
			if($resultInsert)
			{
				echo "Data periode berhasil masuk";
				//header("location:inputFormMhbFrQc00103.php?p=$no_mhb_barang_job");
				header("location:inputToleransi3.php?mhb_id=$no_mhb_barang_job");
			}
			else
			{
				header("location:inputFormMhbFrQc00102.php?p=2");
				
				echo "error";
			}
	}
	else
	{
		// Set path folder tempat menyimpan gambarnya
		$path = "fotoFormMHB-FR-QC-001-02/".$nama_file;
		if($tipe_file == "image/jpeg" || $tipe_file == "image/png")
		{ // Cek apakah tipe file yang diupload adalah JPG / JPEG / PNG
		  // Jika tipe file yang diupload JPG / JPEG / PNG, lakukan :
		  if($ukuran_file <= 1000000){ // Cek apakah ukuran file yang diupload kurang dari sama dengan 1MB
			// Jika ukuran file kurang dari sama dengan 1MB, lakukan :
			// Proses upload
			if(move_uploaded_file($tmp_file, $path)){ // Cek apakah gambar berhasil diupload atau tidak
			  // Jika gambar berhasil diupload, Lakukan :  
			  // Proses simpan ke Database
			  if (isset($_SESSION["UserID"]))
			{
		echo "Foto terisi";
		$query = "INSERT INTO form_mhb_fr_qc_001_02 (
										no_mhb_barang_job,
										 tanggal_periksa_form,
										 form,
										 ukuranSurfaceID,
										 sizeSurviceID,
										 upperSurviceID,
										 lowerSurviceID,
										 x1SurviceID,
										 y1SurviceID,
										 z1SurviceID,
										 x2SurviceID,
										 y2SurviceID,
										 z2SurviceID,
										 x3SurviceID,
										 y3SurviceID,
										 z3SurviceID,
										 x4SurviceID,
										 y4SurviceID,
										 z4SurviceID,
										 x5SurviceID,
										 y5SurviceID,
										 z5SurviceID,
										 x6SurviceID,
										 y6SurviceID,
										 z6SurviceID,
										 x7SurviceID,
										 y7SurviceID,
										 z7SurviceID,
										 x8SurviceID,
										 y8SurviceID,
										 z8SurviceID,
										 conditionSurviceID,
										 aThicknessMinSurviceID,
										 bThicknessMinSurviceID,
										 cThicknessMinSurviceID,
										 dThicknessMinSurviceID,
										 eThicknessMinSurviceID,
										 roughnessSurfaceID1,
										 roughnessSurfaceID2,
										 roughnessSurfaceID3,
										 aSpecBendingSurfaceID,
										 bSpecBendingSurfaceID,
										 cSpecBendingSurfaceID,
										 dSpecBendingSurfaceID,
										 eSpecBendingSurfaceID,
										 weldingJointSurficeID,
										 kelurusanSurficeID,
										 kebocoranSurficeID,
										 totalLength,
										 chromeLength,
										 minSurfaceID,
										 maxLengthSurfaceID,
										 aveLengthSurfaceID,
										 recommendationRepairSurfaceOD,
										 i1xEndRod,
										 i1yEndRod,
										 ii1xEndRod,
										 ii1yEndRod,
										 iii1xEndRod,
										 iii1yEndRod,
										 i2xEndRod,
										 i2yEndRod,
										 ii2xEndRod,
										 ii2yEndRod,
										 iii2xEndRod,
										 iii2yEndRod,
										 threadConditionEndRod,
										 recommendationRepairSurfaceOD2,
										 conditionEndRod,
										 aSpecBendEndRod,
										 bSpecBendEndRod,
										 cSpecBendEndRod,
										 dSpecBendEndRod,
										 eSpecBendEndRod,
										 recommendationRepairSurfaceOD3,
										 brackketConditionEndRod,
										 holeThreadEndRod,
										 recommendationRepairBracketConditionEndRod,
										 recommendationRepairHoleThreadEndRod,
										 foto_dokumen)
							
							       VALUE
							             ('$no_mhb_barang_job',
										 '$tanggal_periksa_form',
										 '$form',
										 '$ukuranSurfaceID',
										 '$sizeSurviceID',
										 '$upperSurviceID',
										 '$lowerSurviceID',
										 '$x1SurviceID',
										 '$y1SurviceID',
										 '$z1SurviceID',
										 '$x2SurviceID',
										 '$y2SurviceID',
										 '$z2SurviceID',
										 '$x3SurviceID',
										 '$y3SurviceID',
										 '$z3SurviceID',
										 '$x4SurviceID',
										 '$y4SurviceID',
										 '$z4SurviceID',
										 '$x5SurviceID',
										 '$y5SurviceID',
										 '$z5SurviceID',
										 '$x6SurviceID',
										 '$y6SurviceID',
										 '$z6SurviceID',
										 '$x7SurviceID',
										 '$y7SurviceID',
										 '$z7SurviceID',
										 '$x8SurviceID',
										 '$y8SurviceID',
										 '$z8SurviceID',
										 '$conditionSurviceID',
										 '$aThicknessMinSurviceID',
										 '$bThicknessMinSurviceID',
										 '$cThicknessMinSurviceID',
										 '$dThicknessMinSurviceID',
										 '$eThicknessMinSurviceID',
										 '$roughnessSurfaceID1',
										 '$roughnessSurfaceID2',
										 '$roughnessSurfaceID3',
										 '$aSpecBendingSurfaceID',
										 '$bSpecBendingSurfaceID',
										 '$cSpecBendingSurfaceID',
										 '$dSpecBendingSurfaceID',
										 '$eSpecBendingSurfaceID',
										 '$weldingJointSurficeID',
										 '$kelurusanSurficeID',
										 '$kebocoranSurficeID',
										 '$totalLength',
										 '$chromeLength',
										 '$minSurfaceID',
										 '$maxLengthSurfaceID',
										 '$aveLengthSurfaceID',
										 '$recommendationRepairSurfaceOD',
										 '$i1xEndRod',
										 '$i1yEndRod',
										 '$ii1xEndRod',
										 '$ii1yEndRod',
										 '$iii1xEndRod',
										 '$iii1yEndRod',
										 '$i2xEndRod',
										 '$i2yEndRod',
										 '$ii2xEndRod',
										 '$ii2yEndRod',
										 '$iii2xEndRod',
										 '$iii2yEndRod',
										 '$threadConditionEndRod',
										 '$recommendationRepairSurfaceOD2',
										 '$conditionEndRod',
										 '$aSpecBendEndRod',
										 '$bSpecBendEndRod',
										 '$cSpecBendEndRod',
										 '$dSpecBendEndRod',
										 '$eSpecBendEndRod',
										 '$recommendationRepairSurfaceOD3',
										 '$brackketConditionEndRod',
										 '$holeThreadEndRod',
										 '$recommendationRepairBracketConditionEndRod',
										 '$recommendationRepairHoleThreadEndRod',
										 '$foto_dokumen')";
										 
										 
			$resultInsert = mysqli_query($conn, $query);
			if($resultInsert)
			{
				echo "Data periode berhasil masuk";
				
				//header("location:inputFormMhbFrQc00103.php?p=$no_mhb_barang_job");
				header("location:inputToleransi3.php?mhb_id=$no_mhb_barang_job");
			}
			else
			{
				header("location:inputFormMhbFrQc00102.php?p=2");
			
				echo "error";
			}
			}
			else{
			  // Jika gambar gagal diupload, Lakukan :
		  
			  header("location:tambahDailyReport.php?p=3");
			}
		  }else{
			// Jika ukuran file lebih dari 1MB, lakukan :
		   
			header("location:tambahDailyReport.php?p=4");
			echo "<d>".$query;
		  }
		}
		else
		{
		  // Jika tipe file yang diupload bukan JPG / JPEG / PNG, lakukan :

		  header("location:tambahDailyReport.php?p=5");
		  echo "<d>".$query;
		}
		}

	}

	
?>