<?php include "../koneksi.php"; ?>
<table class="table table-bordered">
		<tr>
		<th width="30%">
				LOT
			</th>
			<th width="20%">
				BAG
			</th>
			<th width="20%">
				Date
			</th>
			<th width="5%" >
				#
			</th>
			
		</tr>
			<?php 
				$data1 = mysqli_query ($koneksi, " SELECT * from plan where PlanID='$_GET[id]'");
				$row1 = mysqli_fetch_array($data1);
				$data = mysqli_query ($koneksi, " SELECT pbb.PBB_ID,
														pbb.PlanID,
														pbb.Lot,
														pbb.Bag,
														incoming.MaterialID,
														incoming.Date_Inc
											FROM pbb
											INNER JOIN incoming
											ON pbb.IncomingID=incoming.IncomingID
											INNER JOIN material
											ON incoming.MaterialID=material.MaterialID
											WHERE pbb.NoPBB_ID='$row1[NoPBB_ID2]'
                                			Order by incoming.Date_Inc, pbb.Bag, pbb.Lot ASC");
	

				while($row = mysqli_fetch_array ($data)): ?>
		<tr>
			
		<td width="30%">
				<?php echo $row['Lot']; ?>
			</td>
			<td width="20%">
				<?php echo $row['Bag']; ?>
			</td>
			<td width="20%">
				<?php echo date ("d-m-Y", strtotime($row['Date_Inc'])); ?>
			</td>
			<td width="5%" >
				<a href="in.php?id=<?php echo $row['PBB_ID']; ?>&plan_id=<?php echo $_GET['id']; ?>&mat=<?php echo $row['MaterialID']; ?>" style="color: black;" ><i class="bi bi-arrow-right-square-fill"></i></a>
			</td>
		</tr>
			<?php endwhile; ?>
	</table>