<div class="content-wrapper">

    <?php require('./layout/headerpage.php'); ?>

    <div class="container col-12 mb-4 pb-5">
        <div class="row">
            <div class="col-12">
                <div class="col-12">
                    <div class="card  mx-3">
                        <div class="timeline-header bg-primary  py-2 pl-2">
                            <b class="text-light judul"><span class="bi bi-list-columns-reverse"></span> Daftar Transaksi</b>
                        </div>
                        <!-- /.card-header -->
                        <div class="card-body my-4 mx-4">
                            <form action="" method="post">
                                <div class="div d-inline">
                                    <a <?php echo $link->page('transaksi/transaksi_create_step1'); ?> class="btn btn-primary btn-xs mb-2 btn-rounded small px-2"> <i class="bi bi-file-earmark-plus"></i> REKAM TRANSAKSI</a>
                                    <button type="submit" name="submit" class="btn btn-primary btn-xs mb-2 btn-rounded small px-2"> <i class="bi bi-trash"></i> HAPUS</button>
                                    <?php echo $link->exportXlsx('transaksi/transaksi_export', $tb_transaksi); ?>
                                </div>
                                <table id="example3" class="table table-bordered table-sm mb-4">
                                    <thead>
                                        <tr>
                                            <th><input type="checkbox" class="small check_all"></th>
                                            <th>Edit</th>
                                            <th>No. Bukti</th>
                                            <th>Tanggal</th>
                                            <th>Uraian</th>
                                            <th width="150">Debet</th>
                                            <th width="150">Kredit</th>
                                            <th>Jns Transaksi</th>
                                            <th>Akun</th>
                                            <th>Kuitansi</th>

                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php
                                        $class = new simakom_transaksi();
                                        $showList = $class->list_transaksi($tb_transaksi, $tb_detail);
                                        ?>
                                    </tbody>
                                </table>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        </section>
    </div>
</div>
<!-- /.content-wrapper -->
<script type="text/javascript">
    $(function() {
        $('.check_all').click(function() {
            $('.chk_boxes1').prop('checked', this.checked);
        });
    });
</script>

<?php
if (isset($_POST['submit'])) {
    foreach ($_POST['id_trans'] as $id) {
        $class = new crudData();
        $delete = $class->deleteData($tb_transaksi, 'no', $id);
    };

    $direct = new toast();
    echo  $direct->redirect('toast', 'delete', 'transaksi/transaksi_read');
} else {
    echo '';
}



?>