<table class="table table-bordered">
        <thead>
		<tr>
			<th width="12%">
				Tanggal
			</th>
			<th width="20%">
				Customer
			</th>
			<th width="18%">
				Product
			</th>
			<th width="10%">
				No.PO
			</th>
			<th width="10%">
				No.DN
			</th>
			<th width="10%">
				QtyKirim
			</th>
			<th width="10%">
				Opsi
			</th>
		</tr>
		</thead>
		<tbody>
			<?php 
				include"../koneksi.php";
				if( isset( $_GET['tgl'] )){
				//$tgl = preg_replace('/[^A-Za-z0-9]/', '', $_GET['tgl']);
				$no = 1;
				$data = mysqli_query ($koneksi, " select 
															deliverytbl.Del_ID,
															deliverytbl.DateKirim,
															deliverytbl.DetailPO_ID,
															detail_po.PO_ID,
															po_tbl.No_PO,
															po_tbl.CustomerID,
															customer.CustomerName,
															detail_po.ProductID,
															product.ItemDescription,
															product.SLoc,
															product.QtyUnit,
															deliverytbl.DetailEkspedisi_ID,
															detailekspedisi.EkspedisiID,
															ekspedisi.Ekspedisi,
															detailekspedisi.Sopir,
															deliverytbl.NoDN,		
															deliverytbl.QtyKirim		
											from 
											deliverytbl
											INNER JOIN detail_po
											ON deliverytbl.DetailPO_ID=detail_po.DetailPO_ID
											INNER JOIN po_tbl
											ON detail_po.PO_ID=po_tbl.PO_ID
											INNER JOIN customer
											ON po_tbl.CustomerID=customer.CustomerID
											INNER JOIN product
											ON detail_po.ProductID=product.ProductID
											INNER JOIN detailekspedisi
											ON deliverytbl.DetailEkspedisi_ID=detailekspedisi.DetailEkspedisi_ID
											INNER JOIN ekspedisi
											ON detailekspedisi.EkspedisiID=ekspedisi.EkspedisiID
											WHERE deliverytbl.DateKirim = '$_GET[tgl]'
											order by Del_ID DESC");
				} if( isset( $_GET['week'] )){
								$data = mysqli_query ($koneksi, " select 
								deliverytbl.Del_ID,
								deliverytbl.DateKirim,
								deliverytbl.DetailPO_ID,
								detail_po.PO_ID,
								po_tbl.No_PO,
								po_tbl.CustomerID,
								customer.CustomerName,
								detail_po.ProductID,
								product.ItemDescription,
								product.SLoc,
								product.QtyUnit,
								deliverytbl.DetailEkspedisi_ID,
								detailekspedisi.EkspedisiID,
								ekspedisi.Ekspedisi,
								detailekspedisi.Sopir,
								deliverytbl.NoDN,		
								deliverytbl.QtyKirim		
				from 
				deliverytbl
				INNER JOIN detail_po
				ON deliverytbl.DetailPO_ID=detail_po.DetailPO_ID
				INNER JOIN po_tbl
				ON detail_po.PO_ID=po_tbl.PO_ID
				INNER JOIN customer
				ON po_tbl.CustomerID=customer.CustomerID
				INNER JOIN product
				ON detail_po.ProductID=product.ProductID
				INNER JOIN detailekspedisi
				ON deliverytbl.DetailEkspedisi_ID=detailekspedisi.DetailEkspedisi_ID
				INNER JOIN ekspedisi
				ON detailekspedisi.EkspedisiID=ekspedisi.EkspedisiID
				WHERE deliverytbl.Week = '$_GET[week]'
				order by Del_ID DESC");
				}

				while($row = mysqli_fetch_array ($data)):
			?>
		<tr>
			<td width="12%">
				<?php 
				$tanggal = $row['DateKirim'];
				$day = date('D', strtotime($tanggal));
				$dayList = array(
					'Sun' => 'Minggu',
					'Mon' => 'Senin',
					'Tue' => 'Selasa',
					'Wed' => 'Rabu',
					'Thu' => 'Kamis',
					'Fri' => 'Jumat',
					'Sat' => 'Sabtu'
				);
				echo date ("d-m-Y", strtotime($tanggal)).' '.$dayList[$day]; ?>
			</td>
			<td width="20%">
				<?php echo $row['CustomerName']; ?>
			</td>
			<td width="18%">
				<?php echo $row['ItemDescription']; ?>
			</td>
			<td width="10%">
				<?php echo $row['No_PO']; ?>
			</td>
			<td width="10%">
				<?php echo $row['NoDN']; ?>
			</td>
			<td width="10%">
				<?php echo $row['QtyKirim']; ?>
				<?php echo substr($row['SLoc'], 0, 3); ?>
			</td>
			<td width="10%">
			    <a href="../delivery/plist.php?id=<?php echo $row['Del_ID']; ?>&prod=<?php echo $row['ProductID']; ?>" style="color: #00008B" ><i class="bi bi-clipboard-check"></i> Packing List</a>
			</td>
		</tr>
			<?php endwhile; ?>
		</tbody>
	</table>
	</div>
	