<section class="content-header">
    <div class="container-fluid">
        <div id="flash" data-flash="<?= $this->session->flashdata('success'); ?>"></div>
        <div class="row ">
            <div class="col-sm-12">
                <h1>LAP.KEUANGAN - Jurnal Harian </h1>
            </div>
        </div>
    </div>
</section>

<div id="flash" data-flash="<?= $this->session->flashdata('success'); ?>"></div>

<section class="content">

    <!-- start pencarian -->
    <div class="container-fluid">
        <form action="" method="get">
            <div class="row mb-3 ">
                <div class="col-12">
                    <?php if (isset($_GET['tgl'])) {
                        $tgl = $_GET['tgl'];
                    } else {
                        $tgl = null;
                    } ?>
                    <div class="input-group align-center">
                        <div class="input-group-prepend">
                            <span class="input-group-text"><i class="fas fa-warehouse"></i></span>
                        </div>
                        <input id="datepickerbulan" placeholder="Pilih Tanggal Arsip" name="tgl" type="text" class="form-control " value="<?= $tgl = $tgl ? $tgl : date('m / Y') ?>" autocomplete="off">

                        <div style="width: 100px" class="input-group-prepend">
                            <button type="submit" class="btn btn-outline-secondary w-100">Pilih</button>
                        </div>
                    </div>
                </div>
        </form>
    </div>
    <!-- ending pencarian -->

    <div class="row">
        <!-- Pendapatan Harian -->
        <div class="col-12 col-md-12 col-sm-12">
            <div class="card border-left-primary ">
                <div class="card-body">
                    <div class="row no-gutters align-items-center">
                        <div class="col mr-2">
                            <div class="text-xs font-weight-bold text-primary text-uppercase mb-1">Total Pendapatan (&nbsp;<?= $tgl ?>&nbsp;)</div>
                            <div class="h5 mb-0 font-weight-bold text-gray-800"><?= indo_currency($totpenga) ?>
                            </div>
                        </div>
                        <div class="col-auto">
                            <i class="fas fa-coins fa-2x text-gray-300"></i>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="input-group align-center">
        <div class="input-group-prepend">
            <span class="input-group-text mb-2">Invoice</span>
        </div>
        <input name="inov_lbbc" readonly="on" value="<?= $invoice_bbcb ?>" class=" mb-2 form-control form-control-lg" type="text">
    </div>

    <div class="row">
        <div class="col-12 col-md-12 col-sm-12 ">
            <div class="card card-outline card-secondary p-2">
                <form action="<?= base_url('lapkeucabjur/addlapbukubesarcab'); ?>" method="post">
                    <input name="bln_lbbc" readonly="on" value="<?php echo date('m / Y') ?>" class="form-control form-control-sm" type="hidden">
                    <input name="pen_lbbc" readonly="on" value="<?= $totpenga ?>" class="form-control w-50" type="hidden">
                    <input name="inov_lbbc" readonly="on" value="<?= $invoice_bbcb ?>" class=" mb-2 form-control form-control-lg" type="hidden">

                    <table class='table'>
                        <tr>
                            <th scope="row">No.</th>
                            <th scope="row">Tanggal</th>
                            <th scope="row">Invoice</th>
                            <th scope="row">Pendapatan</th>
                            <th scope="row">Peng.harian</th>
                            <th scope="row">Pemb.Part</th>
                            <th scope="row">Pend.Bersih</th>
                            <th scope="row">Admin</th>

                        </tr>
                        <?php $i = 1; ?>
                        <?php foreach ($bukubesarcab->result() as $am => $data) : ?>
                            <tbody>
                                <tr>
                                    <td scope="row"><?= $i; ?>.</td>
                                    <td><?= $data->tgl_jurhcab ?></td>
                                    <td><?= $data->inov_jurhcab ?></td>
                                    <td><?= $data->pen_jurhcab ?></td>
                                    <td><?= $data->peng_jurhcab ?></td>
                                    <td><?= $data->pemb_part ?></td>
                                    <td><?= $data->kasakhir_jurhcab  ?></td>
                                    <td><?= $data->id_user ?></td>

                                </tr>
                            </tbody>
                            <?php $i++; ?>
                        <?php endforeach ?>
                    </table>
                    <?= $tgl > 0 ? '
                    <button class="btn btn-lg btn-primary w-100  mt-2" type="submit">Simpan Laporan Buku Besar Bulanan</button>
                    '
                        :
                        null
                    ?>
                </form>
            </div>
        </div>
    </div>
</section>