<div id="content" class="main-content">
    <div class="layout-px-spacing">
        <?= $this->session->flashdata('pesan_berhasil'); ?>
        <?= $this->session->flashdata('pesan_gagal'); ?>
        <div class="row layout-top-spacing" style="padding-bottom: 1px;">
            <div class="col-xl-6 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h4 class="card-text">Total Saldo Masuk<br>
                            <?= $this->mycustom->bulanIndo($bulan)  ?>
                            <?= $tahun  ?></h4>
                        <h2 class="card-text">
                            <?= number_format(($masuk_bulanan['saldo']), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-6 col-lg-12 col-md-12 col-sm-12 col-12 layout-spacing">
                <div class="card component-card_7" style="width: auto;">
                    <div class="card-body">
                        <h4 class="card-text">Total Saldo Keluar<br>
                            <?= $this->mycustom->bulanIndo($bulan)  ?>
                            <?= $tahun  ?></h4>
                        <h2 class="card-text">
                            <?= number_format(($keluar_bulanan['saldo']), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="row layout-spacing" style="padding-bottom: 10px;">
            <div class="col-lg-12">
                <blockquote class="blockquote media-object">
                    <div class="media">
                        <div class="media-body align-self-center">
                            <a class="btn btn-primary btn-sm" style="float: right;" href="<?= base_url('kasir/kas') ?>">Reset</a>
                            <p class="d-inline">
                                Arus Kas Koperasi
                            </p>
                        </div>
                    </div>
                    <small class="text-left"><cite title="Source Title"><?= $this->mycustom->hariIndo(date('l', strtotime(date('Y-m-d')))) ?>,
                            <?= date('d', strtotime(date('Y-m-d')))  ?>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></cite></small>
                </blockquote>
            </div>
        </div>
        <div class="row layout-spacing">
            <div class="col-lg-12">
                <div class="statbox widget box box-shadow">
                    <div class="widget-content widget-content-area">
                        <table id="style-3" class="table style-3  table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center">Tanggal</th>
                                    <th class="text-center">Debit</th>
                                    <th class="text-center">Kredit</th>
                                    <th class="text-center" style="width: 120px;">Keterangan</th>
                                    <th class="text-center">Bukti Transaksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($arus_kas as $Data_arus_kas) : ?>
                                    <tr>
                                        <td class="text-center">
                                            <?= date('d', strtotime($Data_arus_kas->tgl_pembayaran)) ?>
                                            <?= $this->mycustom->bulanIndo(date('m', strtotime($Data_arus_kas->tgl_pembayaran))) ?>
                                            <?= date('Y', strtotime($Data_arus_kas->tgl_pembayaran)) ?>
                                        </td>
                                        <td class="text-right">
                                            <?php if ($Data_arus_kas->status_kas == 'MASUK') : ?>
                                                <?= number_format($Data_arus_kas->ttl_bayar, 0, ',', '.') ?>,-
                                            <?php endif; ?>
                                            <?php if ($Data_arus_kas->status_kas == 'OMSET') : ?>
                                                <?= number_format($Data_arus_kas->ttl_bayar, 0, ',', '.') ?>,-
                                            <?php endif; ?>
                                        </td>
                                        <td class="text-right">
                                            <?php if ($Data_arus_kas->status_kas == 'KELUAR') : ?>
                                                <?= number_format($Data_arus_kas->ttl_bayar, 0, ',', '.') ?>,-
                                            <?php endif; ?>
                                            <?php if ($Data_arus_kas->status_kas == 'OPERASIONAL') : ?>
                                                <?= number_format($Data_arus_kas->ttl_bayar, 0, ',', '.') ?>,-
                                            <?php endif; ?>
                                        </td>
                                        <td style="width: 120px;">
                                            <?= $Data_arus_kas->ket_nota ?>
                                        </td>
                                        <td class="text-center">
                                            <a class="btn btn-primary btn-sm" target="_blank" href="<?= base_url('assets/invoice/kas_umum/' . date('Y', strtotime($Data_arus_kas->tgl_pembayaran)) . '/' . date('m', strtotime($Data_arus_kas->tgl_pembayaran)) . '/' . $Data_arus_kas->invoice_pdf) ?>" style="color: white;">Download</a>
                                        </td>
                                    </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>