<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- Profit Usaha <?= date('Y') ?></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="datepickerth" placeholder="Pilih Tanggal Arsip" name="tgl" type="text" class="form-control " value="<?= $tgl = $tgl ? $tgl : date('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 Tahun (&nbsp;<?= $tgl ?>&nbsp;)</div>
                            <div class="h5 mb-0 font-weight-bold text-gray-800"><?= indo_currency($getinvtot) ?>
                            </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="row">
        <div class="col-12 col-md-12 col-sm-12 ">
            <div class="card card-outline card-primary p-2">
                <table class='table'>
                    <tr>
                        <th scope="row">No.</th>
                        <th scope="row">Bulan</th>
                        <th scope="row">Invoice</th>
                        <th scope="row">Pendapatan</th>
                        <th scope="row">Biaya Gaji</th>
                        <th scope="row">Biaya Operasional</th>
                        <th scope="row">Pend.Bersih</th>

                    </tr>
                    <?php $i = 1; ?>
                    <?php foreach ($neraca->result() as $am => $data) : ?>
                        <tbody>
                            <tr>
                                <td scope="row"><?= $i; ?>.</td>
                                <td><?= $data->inv_bln ?></td>
                                <td><?= $data->invoice_inv ?></td>
                                <td><?= $data->inv_omset  ?></td>
                                <td><?= $data->inv_peng  ?></td>
                                <td><?= $data->inv_gaji  ?></td>
                                <td><?= $data->inv_tot  ?></td>

                            </tr>
                        </tbody>
                        <?php $i++; ?>
                    <?php endforeach ?>
                </table>
            </div>
        </div>
    </div>
</section>