<?php	
	include "../koneksi.php";
	
	$data = mysqli_query ($koneksi, " SELECT 
                                        stpj.STPJ_ID,
                                        plan.PlanID,
                                        stpj.Del_ID,
                                        product.ProductID,
                                        product.SLoc,
                                        product.QtyUnit,
                                        stpj.Kode,
                                        stpj.NoLot,
                                        stpj.Nick,
                                        stpj.Qty
                                FROM stpj 
                                INNER JOIN plan
                                ON stpj.PlanID=plan.PlanID
                                INNER JOIN product
                                ON plan.ProductID=product.ProductID
								where stpj.STPJ_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="stpj_id" value="<?php echo $row['STPJ_ID'] ; ?>">
		<input type="hidden" name="plan_id" value="<?php echo $row['PlanID'] ; ?>">
		<input type="hidden" name="del_id" value="<?php echo $row['Del_ID'] ; ?>">
		<input type="hidden" name="prod_id" value="<?php echo $row['ProductID'] ; ?>">
		<input type="hidden" name="kode" value="<?php echo $row['Kode'] ; ?>">
		<input type="hidden" name="nolot" value="<?php echo $row['NoLot'] ; ?>">
	</div>														
	<div class="form-group">
		<label>Quantity</label>
		<select class="form-control" id="qty" name="qty">
			<option value="<?php echo  $row['Qty']; ?>" selected><?php echo $row['Qty']; ?> <?php echo substr($row['SLoc'], 0, 3); ?> @ <?php echo $row['QtyUnit']*15; ?> PCS</option>
		<?php for ($i=1; $i <= 15 ; $i++) : ?>
			<option value="<?php echo  $i; ?>"><?php echo $i; ?> <?php echo substr($row['SLoc'], 0, 3); ?> @ <?php echo $row['QtyUnit']*$i; ?> PCS</option>
		<?php endfor; ?>
		</select>
		<p style="color:red" id="error_qty"></p>
	</div>
</form>
