<div class="modal-detail">
    <div class="card shadow-sm p-3">
        <div class="row">
            <div class="col">
                <table class="table w-100 dt-responsive nowrap">
                    <tbody>
                        <tr>
                            <td width="30%">
                                Id Barang Masuk
                            </td>
                            <td>
                                <?= $brg['id_barang_keluar'] ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Tanggal
                            </td>
                            <td>
                                <?= $brg['tanggal_keluar'] ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Nama Cabang
                            </td>
                            <td>
                                <?= $brg['nama_cabang'] ?>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                Petugas
                            </td>
                            <td>
                                <?= $brg['nm_user'] ?>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped w-100 dt-responsive nowrap" id="dataTable">
                <thead>
                    <tr>
                        <th>No. </th>
                        <th>Pemilik Aset</th>
                        <th>ID Barang</th>
                        <th>Nama Barang</th>

                        <th>Stok</th>


                    </tr>
                </thead>
                <tbody>
                    <?php
                    $no = 1;
                    if ($d_brg) :
                        foreach ($d_brg as $b) :
                    ?>
                            <tr>
                                <td><?= $no++; ?></td>
                                <td><?= $b['nm_user_pemilik']; ?></td>
                                <td><?= $b['id_barang']; ?></td>
                                <td><?= $b['nama_barang']; ?></td>
                                <td><?= $b['jumlah'] . ' ' . $b['nama_satuan']; ?></td>
                            </tr>
                        <?php endforeach; ?>
                    <?php else : ?>
                        <tr>
                            <td colspan="6" class="text-center">
                                Data Kosong
                            </td>
                        </tr>
                    <?php endif; ?>
                </tbody>
            </table>
        </div>

        <div class="row">
            <div class="col">
                <table class="table w-100 dt-responsive nowrap">
                    <tbody>
                        <tr>
                            <td width="30%">
                                Keterangan
                            </td>
                            <td>
                                <?= $brg['ket'] ?>
                            </td>
                        </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div class="modal-footer">
    <?php if($dt_user['nama'] == $brg['nm_user']) { ?>
        <a href="<?= base_url('barangkeluar/edit/') . $brg['id_barang_keluar'] ?>" class="btn btn-warning btn-circle"><i class="fa fa-pen"></i></a>
        <a onclick="return confirm('Yakin ingin hapus?')" href="<?= base_url('barangkeluar/delete/') . $brg['id_barang_keluar'] ?>" class="btn btn-danger btn-circle"><i class="fa fa-trash"></i></a>
    <?php } ?>
    <a href="<?= base_url('barangkeluar/cetak_bkluar/'.$brg['id_barang_keluar'])?>" type="button" target="_blank" class="btn btn-primary"><i class="fa fa-print"></i> Cetak</a>
    <button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
</div>