<table class="table table-sm table-bordered">
    <thead>
        <tr>
            <th>#</th>
            <th width="50px">Sku</th>
            <th>Nama Barang</th>
            <th width="50px">Tanggal</th>
            <th width="70px">Shift</th>
            <th>No Mesin</th>
            <th width="80px">Jml FG</th>
            <th width="50px">Barcode</th>
            <th>Tranfer ke gudang</th>
            <th>Doc Number</th>
        </tr>
    </thead>
    <tbody>
        <?php
        $i = 1;
        foreach ($resultlot as $l) {
            echo "<tr>";
            echo "<td>" . $i . "</td>";
            echo "<td>" . $l['sku'] . "</td>";
            echo "<td>" . $l['barang'] . "</td>";
            echo "<td>" . $l['tanggal'] . "</td>";
            echo "<td>" . $l['shift'] . "</td>";
            echo "<td>" . $l['mesin'] . "</td>";
            echo "<td>" . $l['nomor'] . "</td>";
            echo "<td><button type='button' class='btn btn-warning btn-sm' onclick='cetaklot(" . $l['id'] . ",\"" . $l['sku'] . "\"," . $l['nomor'] . ")'><i class='bi bi-receipt-cutoff'></i></button></td>";
            if ($l['cari_gudang'] == 0) {
                if ($akses['dml'] == 1) {
                    /*
                    echo "<td>";
                    echo "<button type='button' class='btn btn-info btn-sm' onclick='tflot(" . $l['id'] . ",\"" . $l['sku'] . "\"," . $l['nomor'] . ")'><i class='bi bi-box-arrow-right'></i></button>";
                    echo "<button type='button' class='btn btn-info btn-sm' onclick='tflot(" . $l['id'] . ",\"" . $l['sku'] . "\"," . $l['nomor'] . ")'><i class='bi bi-box-arrow-right'></i></button>";
                    echo "</td>";
                    */
                    echo '<td><div class="btn-group" role="group" aria-label="Basic outlined example">';
                    echo "<button data-bs-toggle='modal' data-bs-target='#f_update_lot' onclick='edit_lot(" . $l['id'] . ",\"" . $l['sku'] . "\"," . $l['shift'] . "," . $l['kd_mesin'] . ")' type='button' class='btn btn-outline-primary btn-sm'><i class='bi bi-pencil'></i></button>";
                    echo "<button onclick='tflot(" . $l['id'] . ",\"" . $l['sku'] . "\"," . $l['nomor'] . ")' type='button' class='btn btn-outline-primary btn-sm'><i class='bi bi-box-arrow-right'></i></button>";
                    echo '</div></td>';
                    echo "<td></td>";
                } else {
                    echo "<td></td>";
                }
            } else {
                echo "<td>" . $l['tgl_transfer'] . "</td>";
                echo "<td>" . $l['doc_tf'] . "</td>";
            }
            echo "</tr>";
            $i++;
        }
        ?>
    </tbody>
    <?php
    if ($akses['dml'] == 1) {
    ?>
        <tfoot>
            <tr>
                <th colspan="10">Input data nomor lot FG</th>
            </tr>
            <tr>
                <th colspan="3">SKU</th>
                <th>Tgl</th>
                <th>Shift</th>
                <th>Mesin</th>
                <th>Jml FG</th>
                <th colspan="3"></th>
            </tr>
            <tr>
                <th colspan="3"><select class="form-control" id="brglot">
                        <?php
                        foreach ($brglot as $b) {
                            echo "<option value='" . $b['sku'] . "'>" . $b['barang'] . "</option>";
                        }
                        ?>
                    </select></th>
                <th><input type="date" id="tgllot" class="form-control"></th>
                <th><select class="form-control" id="shiftlot">
                        <option value="1">Shift 1</option>
                        <option value="2">Shift 2</option>
                        <option value="3">Shift 3</option>
                    </select></th>
                <th><select class="form-control" id="mesinlot">
                        <?php
                        foreach ($resultmesin as $m) {
                            echo "<option value='" . $m['kd_mesin'] . "'>" . $m['mesin'] . "</option>";
                        }
                        ?>
                    </select></th>
                <th><input type="number" id="qtylot" class="form-control"></th>
                <th colspan="3"><button type="button" onclick="simpanlot()" class="btn btn-primary btn-sm">simpan</button></th>
            </tr>
        </tfoot>
    <?php
    }
    ?>
</table>