<?php
	include "koneksi.php";
	$id = mysqli_real_escape_string($conn, $_GET["id"]);
    $q = "SELECT * FROM data_karyawan WHERE id='$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
	$aChromeCoatingSurviceID=$_POST["aChromeCoatingSurviceID"];
	$bChromeCoatingSurviceID=$_POST["bChromeCoatingSurviceID"];
	$cChromeCoatingSurviceID=$_POST["cChromeCoatingSurviceID"];
	$dChromeCoatingSurviceID=$_POST["dChromeCoatingSurviceID"];
	$eChromeCoatingSurviceID=$_POST["eChromeCoatingSurviceID"];
	
	//roughness (ra) in
	$roughnessSurfaceID1=$_POST["roughnessSurfaceID1"];
	$roughnessSurfaceID2=$_POST["roughnessSurfaceID2"];
	$roughnessSurfaceID3=$_POST["roughnessSurfaceID3"];
	
	//welding joint
	$roughnessSurfaceID1=$_POST["roughnessSurfaceID1"];
	
	//spec inside run out tube
	$aSpecInsideRunSurfaceID=$_POST["aSpecInsideRunSurfaceID"];
	$bSpecInsideRunSurfaceID=$_POST["bSpecInsideRunSurfaceID"];
	
	//spec inside concentricity between tube and head end
	$cSpecInsideConcentricitySurfaceID=$_POST["cSpecInsideConcentricitySurfaceID"];
	$dSpecInsideConcentricitySurfaceID=$_POST["dSpecInsideConcentricitySurfaceID"];
	$eSpecInsideConcentricitySurfaceID=$_POST["eSpecInsideConcentricitySurfaceID"];
	
	//long hone
	$lengthHoneSurfaceID=$_POST["lengthHoneSurfaceID"];
	//hardness mat'l 
	$roughnessSurfaceID1=$_POST["roughnessSurfaceID1"];
	$lengthHoneHardnessMatSurfaceID1=$_POST["lengthHoneHardnessMatSurfaceID1"];
	$lengthHoneHardnessMatSurfaceID2=$_POST["lengthHoneHardnessMatSurfaceID2"];
	$lengthHoneHardnessMatSurfaceID3=$_POST["lengthHoneHardnessMatSurfaceID3"];
	
	//total length
	$totalLengthSurfaceID=$_POST["totalLengthSurfaceID"];
	//hardness mat'l 
	$totalLengthHardnessSurvaceID1=$_POST["totalLengthHardnessSurvaceID1"];
	$totalLengthHardnessSurvaceID2=$_POST["totalLengthHardnessSurvaceID2"];
	$totalLengthHardnessSurvaceID3=$_POST["totalLengthHardnessSurvaceID3"];	
	
	
	//diameterOdTube
	$diameterOdTube=$_POST["diameterOdTube"];
	
	// recomendation repar
	$recommendationRepairSurfaceID=$_POST["recommendationRepairSurfaceID"];
	
	//surface id head end (h8/oem)
	$xSurviceIDHeadEnd1=$_POST["xSurviceIDHeadEnd1"];
	$ySurviceIDHeadEnd1=$_POST["ySurviceIDHeadEnd1"];
	$zSurviceIDHeadEnd1=$_POST["zSurviceIDHeadEnd1"];
	$xSurviceIDHeadEnd2=$_POST["xSurviceIDHeadEnd2"];
	$ySurviceIDHeadEnd2=$_POST["ySurviceIDHeadEnd2"];
	$zSurviceIDHeadEnd2=$_POST["zSurviceIDHeadEnd2"];
	$xSurviceIDHeadEnd3=$_POST["xSurviceIDHeadEnd3"];
	$ySurviceIDHeadEnd3=$_POST["ySurviceIDHeadEnd3"];
	$zSurviceIDHeadEnd3=$_POST["zSurviceIDHeadEnd3"];
	$xSurviceIDHeadEnd4=$_POST["xSurviceIDHeadEnd4"];
	$ySurviceIDHeadEnd4=$_POST["ySurviceIDHeadEnd4"];
	$zSurviceIDHeadEnd4=$_POST["zSurviceIDHeadEnd4"];
	$xSurviceIDHeadEnd5=$_POST["xSurviceIDHeadEnd5"];
	$ySurviceIDHeadEnd5=$_POST["ySurviceIDHeadEnd5"];
	$zSurviceIDHeadEnd5=$_POST["zSurviceIDHeadEnd5"];
	
	//condition 
	$ConditionSurfaceIdHeadEnd=$_POST["ConditionSurfaceIdHeadEnd"];	
	//recomendation repair
	$recommendationRepairSurfaceIHeadEnd=$_POST["recommendationRepairSurfaceIHeadEnd"];
	
	//face bottom condition
	$faceButtomConditionSurfaceIHeadEnd=$_POST["faceButtomConditionSurfaceIHeadEnd"];
	//recomendation repair
	$recommendationRepairFaceBottomSurfaceIHeadEnd=$_POST["recommendationRepairFaceBottomSurfaceIHeadEnd"];
	
	//hole thread or thread on head end
	$holeThreadSurfaceID=$_POST["holeThreadSurfaceID"];
	//recomendation repair
	$RecommendationHoleThreadSurfaceID=$_POST["RecommendationHoleThreadSurfaceID"];
	
	//bracket condition
	$brackketConditionSurfaceID=$_POST["brackketConditionSurfaceID"];
	//recomendation repair
	$recommendationRepairBrackketConditionSurfaceID=$_POST["recommendationRepairBrackketConditionSurfaceID"];
	
	//oil port 
	$oilPortSurfaceID=$_POST["oilPortSurfaceID"];
    //recomendation repair	
	$recommendationRepairOilPortSurfaceID=$_POST["recommendationRepairOilPortSurfaceID"];
	
	//foto
	$nama_file = $_FILES['gambar']['name'];
    $ukuran_file = $_FILES['gambar']['size'];
    $tipe_file = $_FILES['gambar']['type'];
    $tmp_file = $_FILES['gambar']['tmp_name'];
	
	
	
	
	/////////////////////////////////////////////////Assy / Parsial///////////////////////////////////////////////////////////////
	
	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>";
	
	echo "aChromeCoatingSurviceID = ".$aChromeCoatingSurviceID."<br>";
	echo "bChromeCoatingSurviceID = ".$bChromeCoatingSurviceID."<br>";
	echo "cChromeCoatingSurviceID = ".$cChromeCoatingSurviceID."<br>";
	echo "cChromeCoatingSurviceID = ".$dChromeCoatingSurviceID."<br>";
	echo "eChromeCoatingSurviceID = ".$eChromeCoatingSurviceID."<br>";
	
	echo "roughnessSurfaceID1 = ".$roughnessSurfaceID1."<br>";
	echo "roughnessSurfaceID2 = ".$roughnessSurfaceID2."<br>";
	echo "roughnessSurfaceID3 = ".$roughnessSurfaceID3."<br>";
	
	echo "aSpecInsideRunSurfaceID = ".$aSpecInsideRunSurfaceID."<br>";
	echo "bSpecInsideRunSurfaceID = ".$bSpecInsideRunSurfaceID."<br>";
	
	echo "cSpecInsideConcentricitySurfaceID = ".$cSpecInsideConcentricitySurfaceID."<br>";
	echo "dSpecInsideConcentricitySurfaceID = ".$dSpecInsideConcentricitySurfaceID."<br>";
	echo "eSpecInsideConcentricitySurfaceID = ".$eSpecInsideConcentricitySurfaceID."<br>";
	
	echo "lengthHoneSurfaceID = ".$lengthHoneSurfaceID."<br>";
	
	echo "lengthHoneHardnessMatSurfaceID1 = ".$lengthHoneHardnessMatSurfaceID1."<br>";
	echo "lengthHoneHardnessMatSurfaceID2 = ".$lengthHoneHardnessMatSurfaceID2."<br>";
	echo "lengthHoneHardnessMatSurfaceID3 = ".$lengthHoneHardnessMatSurfaceID3."<br>";
	
	echo "totalLengthSurfaceID = ".$totalLengthSurfaceID."<br>";
	
	echo "totalLengthHardnessSurvaceID1 = ".$totalLengthHardnessSurvaceID1."<br>";
	echo "totalLengthHardnessSurvaceID2 = ".$totalLengthHardnessSurvaceID2."<br>";
	echo "totalLengthHardnessSurvaceID3 = ".$totalLengthHardnessSurvaceID3."<br>";
	
	echo "diameterOdTube = ".$diameterOdTube."<br>";
	
	echo "recommendationRepairSurfaceID = ".$recommendationRepairSurfaceID."<br>";
	
	echo "xSurviceIDHeadEnd1 = ".$xSurviceIDHeadEnd1."<br>";
	echo "ySurviceIDHeadEnd1 = ".$ySurviceIDHeadEnd1."<br>";
	echo "zSurviceIDHeadEnd1 = ".$zSurviceIDHeadEnd1."<br>";
	
	echo "xSurviceIDHeadEnd2 = ".$xSurviceIDHeadEnd2."<br>";
	echo "ySurviceIDHeadEnd2 = ".$ySurviceIDHeadEnd2."<br>";
	echo "zSurviceIDHeadEnd2 = ".$zSurviceIDHeadEnd2."<br>";
	
	echo "xSurviceIDHeadEnd3 = ".$xSurviceIDHeadEnd3."<br>";
	echo "ySurviceIDHeadEnd3 = ".$ySurviceIDHeadEnd3."<br>";
	echo "zSurviceIDHeadEnd3 = ".$zSurviceIDHeadEnd3."<br>";
	
	echo "xSurviceIDHeadEnd4 = ".$xSurviceIDHeadEnd4."<br>";
	echo "ySurviceIDHeadEnd4 = ".$ySurviceIDHeadEnd4."<br>";
	echo "zSurviceIDHeadEnd4 = ".$zSurviceIDHeadEnd4."<br>";
	
	echo "xSurviceIDHeadEnd5 = ".$xSurviceIDHeadEnd5."<br>";
	echo "ySurviceIDHeadEnd5 = ".$ySurviceIDHeadEnd5."<br>";
	echo "zSurviceIDHeadEnd5 = ".$zSurviceIDHeadEnd5."<br>";
	
	echo "ConditionSurfaceIdHeadEnd = ".$ConditionSurfaceIdHeadEnd."<br>";
	echo "recommendationRepairSurfaceIHeadEnd = ".$recommendationRepairSurfaceIHeadEnd."<br>";
	echo "faceButtomConditionSurfaceIHeadEnd = ".$faceButtomConditionSurfaceIHeadEnd."<br>";
	echo "recommendationRepairFaceBottomSurfaceIHeadEnd = ".$recommendationRepairFaceBottomSurfaceIHeadEnd."<br>";
	echo "holeThreadSurfaceID = ".$holeThreadSurfaceID."<br>";
	echo "RecommendationHoleThreadSurfaceID = ".$RecommendationHoleThreadSurfaceID."<br>";
	echo "brackketConditionSurfaceID = ".$brackketConditionSurfaceID."<br>";
	echo "recommendationRepairBrackketConditionSurfaceID = ".$recommendationRepairBrackketConditionSurfaceID."<br>";
	echo "oilPortSurfaceID = ".$oilPortSurfaceID."<br>";
	echo "recommendationRepairOilPortSurfaceID = ".$recommendationRepairOilPortSurfaceID."<br>";
	
	echo "foto : = ".$nama_file."<br>";
	
	if ($nama_file == NULL) //foto kosong
	{
		echo "Foto kosong";
		
	}
	else
	{
		echo "Foto terisi";
	}
		
	$result = mysqli_query($conn, $q);
	$row = mysqli_fetch_array($result);
	$cutiBesar = $row['sisa_cuti_besar'];
	$cutipernikahan = $row['cuti_pernikahan'];
	
	
	
	
	//$s = "SELECT * FROM jenis_cuti WHERE id=" .$jeniscuti;
      //                              $resi = mysqli_query($conn,$s);
        //                            $rowi = mysqli_fetch_array($resi);
			//						echo $rowi["batas_cuti"];
				//					$batas = $rowi["batas_cuti"];
	//$jumlah = $sisa_cuti_tahun - $cutiberapahari;
	
	
	//echo "namanya : " . $id;
	//echo "jumlahh.... : " . $jumlah;
	
	
	//$query = "INSERT INTO cuti_karyawan (id_data_karyawan,
	  //                                   alamat,
		//								 id_jenis_cuti,
			///							 sisa_cuti,
				//						 tanggal_awal_cuti,
					//					 tanggal_pengajuan_cuti,
						//				 alasan_cuti,
							//			 tanggal_akhir_cuti,
								//		 tanggal_lapor_cuti,
									//	 status)
							
							       //VALUE
							         //    ('$id',
										//  '$alamatcuti',
										  //'$jeniscuti',
										//  '$jumlah',
										  //'$mulaicutitanggal',
										  //'$tanggalpengajuancuti',
										  //'$alasan',
										  //'$masukkembalitanggal',
										  //'$tanggallapor',
										  //'1')";
	
	
	//$query2 = "UPDATE data_karyawan SET sisa_cuti_tahun='$jumlah' WHERE id=$id";
	////$query2 = "INSERT INTO data_pasangan (nama,jenis_kelamin,tempat_lahir,tanggal_lahir,nik_pasangan)
		////					VALUE ('$namapasangan','$jeniskelamin','$tempatlahir','$tanggallahirpasangan','$nikpasangan','$nikpasangan')";
	//$result = mysqli_query($conn, $query);
	//$result2 = mysqli_query($conn, $query2);
	

	//echo "query = " . $query . "</br>";
	//echo "query2 = " . $query2 . "</br>";
?>