<?php	
	include "../koneksi.php";
	
	$data = mysqli_query ($koneksi, " select 
									  PO_ID
									  from 
									  po_tbl
									  where PO_ID = $_POST[id]");
	$row = mysqli_fetch_array ($data);
	
?>
<form role="form" id="form-tambah" method="post" action="rinciantambah.php">
	<div class="form-group">
		<input type="hidden" name="po_id" value="<?php echo $row['PO_ID'] ; ?>">
	</div>
	<?php $data = mysqli_query ($koneksi, " select 
											DetailPO_ID,
											PO_ID,
											ProductID,
											QtyPO
									  from 
									  detail_po 
									  where DetailPO_ID = $_POST[id]");
	$row = mysqli_fetch_array ($data); ?>														
	<div class="form-group">
		<label>Product</label>
		<select class="form-control" id="product_id" name="product_id">
			<option selected></option>
			<?php 
			$data = mysqli_query ($koneksi, " select 
													ProductID,
													Material,
													ItemDescription,
													SLoc,
													QtyUnit,
													Folder
											from 
											product 
											order by ProductID DESC");
			while ($row = mysqli_fetch_array ($data))
			{
				?>
			<option value="<?php echo  $row['ProductID']; ?>">ID: <?php echo $row['ProductID']; ?> | <?php echo $row['Material']; ?> | <?php echo $row['ItemDescription']; ?> | <?php echo $row['SLoc']; ?>@<?php echo $row['QtyUnit']; ?>pcs</option>
			<?php } ?>
		</select>
		<p style="color:red" id="error_product_id"></p>
	</div>		
	<div class="form-group">
		<label>Quantity PO</label>
		<input class="form-control" id="qty_po" name="qty_po">
		<p style="color:red" id="error_qty_po"></p>
	</div>
	<div class="form-check">
		<input type="checkbox" class="form-check-input" name="sample" id="sample" value="1">
		<label class="form-check-label" id="sample"> PO Sample</label>
	</div>
</form>
