<?php
include_once("../../lib/konfig.php");
session_start();
$mulai = $_GET['mulai'];
$hingga = $_GET['hingga'];
$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);

$lot = "select A.kode_fg,A.id_produksi,A.sku,B.barang,
date_format(A.tgl_transfer,'%d %b %Y') as tgl_kirim,A.tgl_diterima,
date_format(A.tgl_diterima,'%d %b %Y') as tgl_scan
from tb_fg_gudang A
Left join tb_fg B on B.sku = A.sku 
where date_format(A.tgl_transfer,'%Y-%m-%d') between '$mulai' and '$hingga';";

$resultlot = $MySQLi->query($lot);

?>
<table class="table table-sm table-bordered">
    <thead>
        <tr>
            <th>#</th>
            <th>No Lot</th>
            <th>Sku</th>
            <th>Nama Barang</th>
            <th>Tgl Kirim</th>
            <th>Tgl Diterima</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $i = 1;
        foreach ($resultlot as $l) {
            echo "<tr>";
            echo "<td>" . $i . "</td>";
            echo "<td>" . $l['kode_fg'] . "</td>";
            echo "<td>" . $l['sku'] . "</td>";
            echo "<td>" . $l['barang'] . "</td>";
            echo "<td>" . $l['tgl_kirim'] . "</td>";
            echo "<td>" . $l['tgl_scan'] . "</td>";
            echo "</tr>";
            $i++;
        }
        ?>
    </tbody>

</table>