<?php 
include "koneksi.php";
if (!isset($_SESSION["UserID"]))
{
	header("location:login.php?p=3");
}
$idPr = $_GET['id'];
?>
<!DOCTYPE html>
<link rel="stylesheet" type="text/css" href="style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery.mask/1.14.15/jquery.mask.min.js"></script>
<html>
  <head>
	<title> PT MULTI HYDRACHROM 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:100px" class="container">
	
			<div ">
            <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 HIDRACHROM BALIKPAPAN</h1>
                </center>
            </div>
            <div>
                <center>
                    <h4>PROFESIONAL INFORMATION SYSTEM</h4>
                </center>
            </div>
        </div>
					
				
		<div >
			 <h3 align="center">TAHAP PROSES PURCHASING REQUEST</h3>
			 
			 <?php
				if (isset($_GET["p"]))
				{
					$p=mysqli_real_escape_string($conn,$_GET["p"]);
					if ($p=="1")
					{
						?>
							<div class="alert alert-primary" role="alert">
							  PR Berhasil Ditambah!
							</div>
						<?php
					}
					else if ($p=="2")
					{
						?>
							<div class="alert alert-danger" role="alert">
								sistem gagal!
							</div>
						<?php
					}
					else if ($p=="3")
					{
						?>
							<div class="alert alert-danger" role="alert">
								gagal, isi dengan berurut!
							</div>
						<?php
					}
				}

				if (isset($_GET['pesan'])) {
					if ($_GET['pesan'] == "berhasilInput") {
						echo "<div class='alert alert-success' role='alert'> Berhasil Input DB. </div>";
					}
					// if ($_GET['pesan'] == "berhasilInput") {
					// 	echo "<div class='alert alert-danger' role='alert'> Berhasil Input DB. </div>";
					// }
				}
				?>
			 <form method="POST" action="simpanPrProsesHarga.php?id=<?php echo $idPr; ?>">
			 
			 <div class="form-group" align="center">
				  <h5 align="center" color="rgb(239, 255, 255)" >"memproses data barang yang diajukan dengan memilih harga dan vendor"</h5>
				  
				  <?php
				   echo "PO Date / ".date('d - m - Y');
				   $tanggal = date('d - m - Y');
				  ?>
				  
				  <p>
				  </p>
				  <p>
				  </p>
				  <h3 align="center">DATA USER</h3>
				    <P>
					</P>
		
					<?php
					    
					
					    $q="SELECT * FROM data_purchasing_requisition WHERE id='". $_GET["id"] ."'";
						$res=mysqli_query($conn,$q);
						$dataUser=mysqli_fetch_assoc($res);
					
						$nik = $dataUser["user_request"];
						echo "NIK :".$nik;
						
					?>
					<p>
					<p>
					<?php
					    $d="SELECT * FROM data_karyawan WHERE nik=".$nik;
						$resi=mysqli_query($conn,$d);
						$dataUser1=mysqli_fetch_assoc($resi);				
						$nama = $dataUser1["nama_karyawan"];
						$departement = $dataUser1["departement"];
						
						$pr_no = $dataUser["pr_no"];
						$type_of_material = $dataUser["type_of_material"];
						$purchase_request_type = $dataUser["purchase_request_type"];
						$description = $dataUser["description"];
						$part_no = $dataUser["part_no"];
						$quantity = $dataUser["quantity"];
						$unit = $dataUser["unit"];
						$due_date = $dataUser["acc_code"];
						$no_wo = $dataUser["matr_master"];
						$consumable;
						if ($type_of_material == 1)
						{
							$consumable = "Consumable";
						}
						else if ($type_of_material == 2)
						{
							$consumable = "Non - Consumable";
						}
						
						$normal;
						if ($purchase_request_type == 1)
						{
							$normal = "Normal";
						}
						else if ($purchase_request_type == 2)
						{
							$normal = "Urgent";
						}
						else if ($purchase_request_type == 3)
						{
							$normal = "TOP Urgent";
						}
						
						echo "NAMA :".$nama."<br>";
						echo "DEPARTEMENT :".$departement;
						
					?>
							 
					
					
					<P>
					</P>
					 <h3 align="center">DATA PR</h3>
					 <label for="exampleInputPassword1">Document No.</label>
					<input readonly type="text/css" class="form-control" name="document_no" placeholder="MHB-FR-PRC-001-01">
					<P>
					</P>
					<label for="exampleInputPassword1">PR No.</label>
					<input type="text/css" readonly class="form-control" name="pr_no" placeholder=<?php echo $pr_no; ?> >
					<P>
					</P>
					<label for="exampleInputPassword1">No.WO</label>
					<input type="text/css" readonly class="form-control" name="no_wo" placeholder=<?php echo $no_wo; ?> >
					<P>
					</P>
					<label for="exampleInputPassword1">TYPE OF MATERIAL</label>
					<input type="text/css" readonly class="form-control" name="type_of_material" placeholder=<?php echo $consumable; ?> >
					<P>
					</P>
					<label for="exampleInputPassword1">PURCHASE REQUEST TYPE</label>
					<input type="text/css" readonly class="form-control" name="purchase_request_type" placeholder=<?php echo $normal; ?> >
					<P>
					</P>
					<label for="exampleInputPassword1">QUOTE No.</label>
					<input type="text/css" class="form-control" name="quote" placeholder='' >
					<P>
					</P>
					<label for="exampleInputPassword1">DUE DATE USER</label>
					<input type="text/css" readonly class="form-control" name="due_date" placeholder=<?php echo $due_date; ?> >
					<P>
					</P>
					<label for="exampleInputPassword1">DELIFERY PO DATE</label>
					<input type="date" class="form-control" name="dpo" placeholder='' >
					<P>
					</P>
					
					<P>
					</P>
				    <h3 color="yellow" align="center">PILIH SUPLIER</h3>
					<select class="form-control" name="suplier">
							<?php

							$b = "SELECT *
							FROM data_suplier";

							$res = mysqli_query($conn, $b);
							while ($row = mysqli_fetch_assoc($res)) 
							{
								$selected = "";
							?>
								<option <?php echo $selected; ?> value="<?php echo $row["id"]; ?>">
									<?php
									echo $row["nama_suplier"];
									?>
								</option>
							<?php
							}
							?>
						</select>
						<p>
						</p>
						<html>
  
  <label for="exampleInputPassword1">DISCONT %</label>
  <input type="text" class="form-control" name="discont" placeholder="0" >
  <body>
     <form action="" method="post">
	 <label for="exampleInputPassword1">PPN 10% :</label>
        <input name="ppnya" type="checkbox" value="1" /> YA
		<input name="ppntidak" type="checkbox" value="0" /> TIDAK
     </form>
  </body>
</html>


						<br>
						
						<h3 color="yellow" align="center">NO. PURCHASE ORDER</h3>
						<input style="resize:none;width:100px;height:20px;" type="text/css" class="form-control" name="no_po" placeholder="No.">
				
					<P>
					</P>
				  <h3 color="yellow" align="center">DATA BARANG</h3>
				  <input style="resize:none;width:20px;height:20px;" readonly type="text/css" class="form-control" name="nomor1" placeholder="1."> <input style="resize:none;width:250px;height:20px;" type="text/css" readonly class="form-control" name="description1" placeholder="<?php echo $description; ?>">  	<input style="resize:none;width:120px;height:20px;" type="text/css" readonly class="form-control" name="part_no1" placeholder="<?php echo $part_no; ?>">  	<input style="resize:none;width:40px;height:20px;" type="text/css" readonly class="form-control" name="qty1" placeholder="<?php echo $quantity; ?>">  	<input style="resize:none;width:70px;height:20px;" type="text/css" readonly class="form-control" name="unit1" placeholder="<?php echo $unit; ?>">  	<input style="resize:none;width:200px;height:20px;" type="text/css" class="form-control" name="harga" placeholder="Rp.">     
				  <p>
				  </p>
				  
					
					
			
				 <br>
				 </br>
					
				 <br>
				 </br>
				  <button type="submit" class="btn btn-warning">Simpan</button> 
				  <a href="prDiterimaPrc.php" class="btn btn-danger">Kembali</a>
				
				</form>
				<br>
				 </br>
				 <br>
				 </br>
				 <br>
				 </br>
			
		<center><h5 class="form-signin">Copyright &copy; <a href="#" data-toggle="modal" data-target="#contact">SatrioPringgondani</a></h5></center>  
	</div>	  
  </body>
</html>



