<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-3 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">Saldo Masuk <br>Kas Arisan<br>
                            <?= date('d', strtotime(date('Y-m-d')))  ?>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></h4>
                        <h2 class="card-text">
                            <?= number_format($kas_arisan_masuk, 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 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">Saldo Operasional <br> Arisan <br>
                            <?= date('d', strtotime(date('Y-m-d')))  ?>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></h4>

                        <h2 class="card-text">
                            <?= number_format($kas_arisan_keluar, 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 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>Kas Arisan<br>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></h4>
                        <h2 class="card-text">
                            <?= number_format($kas_arisan_masukbulanan, 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
            <div class="col-xl-3 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 Operasional <br> Arisan <br>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></h4>
                        <h2 class="card-text">
                            <?= number_format($kas_arisan_keluarbulanan, 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">
                            <div class="btn-group mr-2 sm" style="float: right;">
                                <button class="btn btn-primary dropdown-toggle" type="button" data-toggle="dropdown"
                                    aria-haspopup="true" aria-expanded="false">
                                    Pilihan <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24"
                                        viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"
                                        stroke-linecap="round" stroke-linejoin="round"
                                        class="feather feather-chevron-down">
                                        <polyline points="6 9 12 15 18 9"></polyline>
                                    </svg>
                                </button>
                                <div class="dropdown-menu">
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#tambahTransaksi">Tambah Transaksi</a>
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#filterTanggal">Tampilkan Tanggal</a>
                                </div>
                            </div>
                            <p class="d-inline">
                                Arus Kas Produk Arisan
                            </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">Kas</th>
                                    <th class="text-center" style="width: 120px;">Keterangan</th>
                                    <th class="text-center">Tanggal</th>
                                    <th class="text-center">Debit</th>
                                    <th class="text-center">Kredit</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($kas_arus as $Data_arus_kas) : ?>
                                <tr>
                                    <td class="text-center">
                                        <?php if ($Data_arus_kas->produk_id == '21') : ?>
                                        <span class="badge badge-primary"> Arisan Heboh </span>
                                        <?php else : ?>
                                        <span class="badge badge-secondary"> Arisan Motor </span>
                                        <?php endif; ?>
                                    </td>
                                    <td style="width: 120px;">
                                        <?php if ($Data_arus_kas->status_kas == 'MASUK') : ?>
                                        Iuran Kas Bulanan <br><?php if ($Data_arus_kas->produk_id == '21') : ?>
                                        Arisan Heboh
                                        <?php else : ?>
                                        Arisan Motor
                                        <?php endif; ?>
                                        <?php elseif ($Data_arus_kas->status_kas == 'KELUAR') : ?>
                                        Biaya Operasional <br><?php if ($Data_arus_kas->produk_id == '21') : ?>
                                        Arisan Heboh
                                        <?php else : ?>
                                        Arisan Motor
                                        <?php endif; ?>
                                        <?php else : ?>
                                        <?= $Data_arus_kas->ket_nota ?>
                                        <?php endif; ?>
                                    </td>
                                    <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' or $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' or $Data_arus_kas->status_kas == 'OPERASIONAL') : ?>
                                        <?= number_format($Data_arus_kas->ttl_bayar, 0, ',', '.') ?>,-
                                        <?php endif; ?>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<?php $this->load->view('arisan/kas/transaksi'); ?>
<?php $this->load->view('arisan/kas/tanggal'); ?>