<table class="table table-sm table-bordered table-stripped">
    <thead>
        <th>#</th>
        <th>Kode</th>
        <th>Nama barang</th>
        <th>Jumlah</th>
        <th>Satuan</th>
        <th>Jml stok</th>
        <th>Keterangan</th>
        <th>Dept</th>
        <th>Tgl dibutuhkan</th>
        <th>Option</th>
    </thead>
    <tbody>
        <?php
        $i = 1;
        foreach ($data as $d) {
            echo "<tr>";
            echo "<td>" . $i . "</td>";
            echo "<td>" . $d['kd_brg'] . "</td>";
            echo "<td>" . $d['nama_brg'] . "</td>";
            echo "<td>" . $d['qty_req'] . "</td>";
            echo "<td>" . $d['uom'] . "</td>";
            echo "<td>" . $d['stok'] . "</td>";
            echo "<td>" . $d['keterangan'] . "</td>";
            echo "<td>" . $d['strNmDept'] . "</td>";
            echo "<td>" . $d['tanggal'] . "</td>";
            echo '<td style="text-align: right;"><div class="btn-group" role="group" aria-label="Basic outlined example">';
            if (!$d['gambar'] == "") {
                echo '<button type="button" data-bs-toggle="modal" data-bs-target="#f_view_brg" onclick="lihat(\'' . $d["gambar"] . '\')" class="btn btn-outline-primary btn-sm"><i class="bi bi-card-image"></i></button>';
            }
            if ($d['sts_lpbj'] == 1) {
                echo '<button onclick="edit_detail(\'' . $d["kd_brg"] . '\',\'' . $d["nama_brg"] . '\',' . $d['qty_req'] . ',\'' . $d["uom"] . '\',' . $d['stok'] . ',' . $d['dept'] . ',\'' . $d["tgl"] . '\',\'' . $d["keterangan"] . '\',\'' . $d["gambar"] . '\')" type="button" data-bs-toggle="modal" data-bs-target="#f_edit_brg" class="btn btn-outline-primary btn-sm"><i class="bi bi-pencil"></i></button>';
                echo '<button type="button" onclick="hapus_item(\'' . $d["kd_lpbj"] . '\',\'' . $d["kd_brg"] . '\',\'' . $d["gambar"] . '\')" class="btn btn-outline-primary btn-sm"><i class="bi bi-trash"></i></button>';
            }
            echo '</div></td>';
            echo "</tr>";
            $i++;
        }
        ?>
    </tbody>
</table>