<table id="example1" class="table table-striped table-bordered">
    <thead>
        <tr>
            <th width="100px">Kode</th>
            <th width="500px">Deskripsi</th>
            <th width="50px">Jumlah</th>
            <th width="100px">Satuan</th>
            <th width="50px">Jumlah Stok</th>
            <th width="650px">Keterangan</th>
            <th width="150px">Departement</th>
            <th width="100px">Tanggal dibutuhkan</th>
            <th width="250px">Gambar</th>
            <th width="120px">Option</th>
        </tr>
    </thead>
    <tbody>
        <?php
        ob_start();
        include_once("../../../../../lib/function.php");
        include_once("../../../../../lib/konfig.php");
        $MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
        $i = 0;
        $query = "SELECT  ITEM.strKdItem,
                        ITEM.strDeskripsi, 
                        DEPT.strNmDept, 
                        D_LPBJ.ID, 
                        D_LPBJ.strNmFile, 
                        D_LPBJ.item_strUnit AS strUnit, 
                        D_LPBJ.iJumlah, 
                        D_LPBJ.iJumlahStok, 
                        D_LPBJ.strKeteranganREQ, 
                        D_LPBJ.dtDibutuhkan,
                        DATE_FORMAT(D_LPBJ.dtDibutuhkan, '%d %b %Y') as tglbutuh,
                        D_LPBJ.dept_ID
                FROM tpc_d_lpbj AS D_LPBJ 
                LEFT JOIN tpc_h_lpbj AS H_LPBJ ON D_LPBJ.h_lpbj_ID = H_LPBJ.ID 
                LEFT JOIN item AS ITEM ON D_LPBJ.item_ID=ITEM.ID 
                LEFT JOIN tpc_dept AS DEPT ON D_LPBJ.dept_ID=DEPT.ID 
                WHERE (D_LPBJ.stsAktif BETWEEN 1 AND 2) AND 
                        (H_LPBJ.stsAktif BETWEEN 1 AND 2) AND 
                        H_LPBJ.strKdLPBJ='" . $_GET['lpbj'] . "' 
                ORDER BY D_LPBJ.ID ASC
                ";
        $result = $MySQLi->query($query);
        while ($row = $result->fetch_array()) {
            $i++;
            $img = "";
            if ($row['strNmFile'] <> "")
                $img = "<img src='assets/images/lpbj_pic/thumb_{$row['strNmFile']}' width='50px' height='50px' class='thumbnail' data-image='assets/images/lpbj_pic/{$row['strNmFile']}'>";
            /*
            echo "<tr>
                    <td>" . $row['strKdItem'] . "</td>
                    <td>" . $row['strDeskripsi'] . "</td>
                    <td>" . $row['iJumlah'] . "</td>
                    <td>" . $row['strUnit'] . "</td>
                    <td>" . $row['iJumlahStok'] . "</td>
                    <td>" . $row['strKeteranganREQ'] . "</td>
                    <td>" . $row['strNmDept'] . "</td>
                    <td>" . $row['dtDibutuhkan'] . "</td>
                    <td>" . $img . "</td>
                    <td>
                        <p class='text-left'>
                        <a href='transaksi/persediaan/pemesanan/simpan.tambah.pesan.barang.php?data=" . $row['ID'] . "' class='btn btn-space btn-secondary'>-</a>
                        <a href='?menu=edit-lpbj-item&lpbj=" . $_GET['lpbj'] . "&id=" . $row['ID'] . "' class='btn btn-space btn-secondary'>Edit</a>
                        </p>
                    </td>
                </tr>";
        }
                */
            echo "<tr>
                    <td>" . $row['strKdItem'] . "</td>
                    <td width='500px'>" . $row['strDeskripsi'] . "</td>
                    <td>" . $row['iJumlah'] . "</td>
                    <td>" . $row['strUnit'] . "</td>
                    <td>" . $row['iJumlahStok'] . "</td>
                    <td>" . $row['strKeteranganREQ'] . "</td>
                    <td>" . $row['strNmDept'] . "</td>
                    <td>" . $row['tglbutuh'] . "</td>
                    <td>" . $img . "</td>
                    <td>                    
                    <div class='btn-group' role='group' aria-label='Basic outlined example'>                        
                        <button type='button' class='btn btn-outline-primary btn-sm' data-bs-toggle='modal' data-bs-target='#f_update' onclick='editbrg(" . $row['ID'] . ",\"" . $row['strDeskripsi'] . "\"," . $row['iJumlah'] . ",\"" . $row['strUnit'] . "\"," . $row['iJumlahStok'] . "," . $row['dept_ID'] . ",\"" . $row['dtDibutuhkan'] . "\",\"" . $row['strKeteranganREQ'] . "\")'><i class='bi bi-pencil'></i>&nbsp;Edit</button>
                        <button type='button' class='btn btn-outline-danger btn-sm' onclick='hapusbrg(" . $row['ID'] . ")'><i class='bi bi-trash'></i>&nbsp;Hapus</button>
                    </div>
                    </td>
                </tr>";
        }
        ?>
    </tbody>
</table>