<?php
include "koneksi.php";
if (!isset($_SESSION["UserID"])) {
    header("location:login.php?p=3");
}
$idKaryawan = $_GET['id'];
//echo "<br>idkaryawan : . $idKaryawan;</br>";
?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<html>

<head>
    <title> PT. MULTI HIDRACHROME BALIKPAPAN </title>
	<?php        include "part/menu2.php";
	?>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <?php
    include "part/jss.php";
    ?>


</head>

<body>
    <div style="width:1280px; height:220px" class="container" >

			
				<div class="alert alert-info" style='background-color:#F8F8FF' href="#">
				<div style="display: block; margin-left: auto; margin-right: auto; width: 1000px;  height:100px;"><img style="width: 1000px;  height:180px;" src="images/hd.jpg"></div>
				<div>
                <center>
                    <h1>PT. MULTI HYDRACHROM BALIKPAPAN</h1>
                </center>
            </div>
            <div>
                <center>
                    <h4>PROFESIONAL INFORMATION SYSTEM</h4>
                </center>
            </div>
        </div>

        <?php


        $q = "SELECT * FROM barang_job WHERE id = $idKaryawan";
			
        $res = mysqli_query($conn, $q);
		while ($row = mysqli_fetch_array($res)) 
		{


        ?>

            <div class="alert alert-info" align='center'>
                <h3>DETAIL BARANG MASUK</h3>
                <table class="table table-hover" align='center'>
                    <tbody>
                        <tr>
                            <td>NO WO</td>
                            <td><?php echo $row["no_wo"]; ?></td>
                        </tr>
						<tr>
                            <td>NAMA CUSTOMER</td>
							
							<?php
					        //$d="SELECT * FROM data_karyawan WHERE nik=".$row["user_request"];
						    //$resi=mysqli_query($conn,$d);
						    //$dataUser1=mysqli_fetch_assoc($resi);				
						    //$nama = $dataUser1["nama_karyawan"];
					        ?>
							<td><?php echo $row["nama_customer"];?> </td>
                        </tr>
						<tr>
                            <td>NO MHB ID  </td>
                            <td><?php echo $row["no_mhb_id"]; ?></td>
                        </tr>
                        <tr>
                            <td>NAMA KOMPONEN  </td>
                            <td><?php echo $row["nama_komponen"]; ?></td>
                        </tr>
						
						<tr>
                            <td>MODEL KOMPONEN</td>
                            <?php 
							//$row["type_of_material"];
                            //if ($row["type_of_material"] == 1)
							//{
								//$material = 'Consumable';
							//}
                            //else
							//{
								//$material = 'Non - Consumable';
							//}			
                             //$material;		
							?>	
							<td><?php echo $row["model_komponen"]; ?></td>
                        </tr>
						<tr>
                            <td>PART NUMBER</td>
                            <td><?php echo $row["part_number"]; ?></td>
                        </tr>
						<tr>
                            <td>NOMOR SURAT JALAN CUSTOMER</td>
                            <td><?php echo $row["no_surat_jalan_customer"]; ?></td>
                        </tr>
						<tr>
                            <td>FOTO BARANG DATANG</td>
                            <td><?php echo $row["foto_barang_datang"]; ?></td>
                        </tr>
						<tr>
                            <td>FOTO BARANG KELUAR</td>
                            <td><?php echo $row["foto_barang_keluar"]; ?></td>
                        </tr>
						<tr>
                            <td>TANGGAL RECEIVING</td>
                            <td><?php echo $row["tanggal_receiving"]; ?></td>
                        </tr>
						<tr>
                            <td>JENIS BARANG</td>
                            <td><?php echo $row["jenis_barang"]; ?></td>
                        </tr>
						<tr>
                            <td>TESTING</td>
                            <td><?php echo $row["testing"]; ?></td>
                        </tr>
						<tr>
                            <td>STATUS</td>
                            <td><?php echo $row["status"]; ?></td>
                        </tr>
						<tr>
                            <td>TANGGAL PART IDENTIFICATION</td>
                            <td><?php echo $row["tanggal_part_identification"]; ?></td>
                        </tr>
						
		                    <td >
                                <h4 align = "center">FORM MHB-FR-PROD-001-01</h4>
                            </td>
                        <tr>
                            <td>NO. WO</td>
                            <td><?php echo $row["matr_master"]; ?></td>
                        </tr>
						<tr>
                            <td>DESCRIPTION</td>
                            <td><?php echo $row["description"]; ?></td>
                        </tr>
						<tr>
                            <td>PART NOMOR</td>
                            <td><?php echo $row["part_no"]; ?></td>
                        </tr>
						<tr>
                            <td>QUANTITY</td>
							<td><?php echo $row["quantity"]; ?></td>
                        </tr>
						<tr>
                            <td>UNIT</td>
                            <td><?php echo $row["unit"]; ?></td>
                        </tr>
						<tr>
                            <td>JUSTIFICATION</td>
                            <td><?php echo $row["justification"]; ?></td>
                        </tr>
						<tr>
                            <td>ACC CODE</td>
                            <td><?php echo $row["acc_code"]; ?></td>
                        </tr>
						<tr>
                            <td>NOTE</td>
                            <td><?php echo $row["note"]; ?></td>
                        </tr>
						<tr>
                            <td>STATUS PR</td>
                            <td><?php echo $row["status_pr"]; ?></td>
                        </tr>
						<tr>
                            <td>STATUS SPV</td>
							<td>
							<?php
										$row["status_spv"];
											if ($row["status_spv"] == 0)
										{
										   	echo "Belum disetujui";
										}
										else if ($row["status_spv"] == 2)
										{
											echo "Disetujui". "/ TGL ".$row["tgl_disetujui_spv"];
										}
										else if ($row["status_spv"] == 1)
										{
											echo "Ditolak". "/ TGL ".$row["tgl_ditolak_spv"];
										}
							?>
							</td>
                        </tr>
						<tr>
                            <td>STATUS HC&GA </td>
							<td>
							<?php
										$row["status_hcga"];
											if ($row["status_hcga"] == 0)
										{
										   	echo "Belum disetujui";
										}
										else if ($row["status_hcga"] == 2)
										{
											echo "Disetujui". "/ TGL ".$row["tgl_disetujui_hcga"];
										}
										else if ($row["status_hcga"] == 1)
										{
											echo "Ditolak". "/ TGL ".$row["tgl_ditolak_hcga"];
										}
							?>
							</td>
                        </tr>
						<tr>
                            <td>STATUS DIREKTUR</td>
							<td>
							<?php
										$row["status_direktur"];
											if ($row["status_direktur"] == 0)
										{
										   	echo "Belum disetujui";
										}
										else if ($row["status_direktur"] == 2)
										{
											echo "Disetujui" . "/ TGL ".$row["tgl_disetujui_direktur"];
										}
										else if ($row["status_direktur"] == 1)
										{
											echo "Ditolak". "/ TGL ".$row["tgl_ditolak_direktur"];
										}
							?>
							</td>
                        </tr>
                    </tbody>
                </table>
            </div>


        <?php
        }
        ?>


</body>

</html>