<div id="content" class="main-content">
    <div class="layout-px-spacing">
        <br>
        <?= $this->session->flashdata('pesan_berhasil'); ?>
        <?= $this->session->flashdata('pesan_gagal'); ?>
        <div class="row layout-top-spacing">
            <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">Target Tagihan</h4>
                        <h2 class="card-text"><?= $jml_aktif ?> Anggota</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">Sudah Bayar</h4>
                        <h2 class="card-text"><?= $jml_aktif - $blm_bayar ?> Anggota</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">Belum Bayar</h4>
                        <h2 class="card-text"><?= $blm_bayar ?> Anggota</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">Dana Masuk</h4>
                        <h2 class="card-text">
                            <?= number_format((($jml_aktif - $blm_bayar) * $data_arisan['tagihan_iuran']), 0, ',', '.') ?>,-
                        </h2>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-lg-12">
                <blockquote class="blockquote media-object">
                    <div class="media">
                        <div class="media-body align-self-center">
                            <?php if ($jadwal_arisan['status_undian'] == 'BELUM') : ?>
                            <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="#jadwal_detail">Notifikasi</a>
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#bayarTagihan">Bayar Individu</a>
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#bayarTagihanKeluarga">Bayar Keluarga</a>
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#jadwal_detail">Cetak
                                        Invoice</a>
                                    <a href="javascript:void(0);" class="dropdown-item" data-toggle="modal"
                                        data-target="#undian_detail">Mulai
                                        Undian</a>
                                </div>
                            </div>
                            <?php elseif ($jadwal_arisan['status_undian'] == 'PROSES') : ?>
                            <a style="float: right;" class="btn btn-primary btn-sm" href="javascript:void(0);"
                                data-toggle="modal" data-target="#laporan_detail" style="color: white;">Laporan</a>
                            <?php else : ?>
                            <?php endif; ?>
                            <p class="d-inline">
                                <?php if ($data_arisan['id_kategori'] == 21) : ?>
                                Kelompok Arisan Heboh Ke-<?= $data_arisan['nm_kelompok'] ?><br>
                                Undian Ke <?= $jadwal_arisan['undian_ke'] ?> -
                                <?php else : ?>
                                Kelompok Arisan <?= $data_arisan['ket_arisan'] ?> ke-<?= $data_arisan['nm_kelompok'] ?>
                                Undian Ke <?= $jadwal_arisan['undian_ke'] ?> - <?= $jadwal_arisan['status_undian'] ?> -
                                <?php endif; ?>
                                <?php if ($jadwal_arisan['status_undian'] == 'BELUM') : ?>
                                <span class="badge badge-dark"> Belum Mulai </span>
                                <?php elseif ($jadwal_arisan['status_undian'] == 'PROSES') : ?>
                                <span class="badge badge-primary"> Proses Undian </span>
                                <?php else : ?>
                                <span class="badge badge-success"> Selesai </span>
                                <?php endif; ?>
                            </p>
                        </div>
                    </div>
                    <small class="text-right">Undian : <cite
                            title="Source Title"><?= $this->mycustom->hariIndo(date('l', strtotime($jadwal_arisan['tgl_undian']))) ?>,
                            <?= $this->mycustom->bulanIndo(date('m', strtotime($jadwal_arisan['tgl_undian'])))  ?>
                            <?= date('Y', strtotime($jadwal_arisan['tgl_undian']))  ?></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">
                        <h4 class="">( <?= $blm_bayar ?> ) Anggota Belum Bayar</h4>
                        <table id="style-3" class="table style-3  table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center">Undian</th>
                                    <th class="text-center">Identitas</th>
                                    <th class="text-center">No HP</th>
                                    <th class="text-center">Alamat</th>
                                    <th class="text-center">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($anggota_belum_bayar as $Belum_bayar) : ?>
                                <tr>
                                    <td class="text-center">
                                        <?= $Belum_bayar->no_arisan ?>
                                    </td>
                                    <td class="text-left">
                                        No Regist : <?= $Belum_bayar->no_regist ?><br>
                                        NIK : <?= $Belum_bayar->nik ?><br>
                                        Nama : <?= $Belum_bayar->nm_anggota ?>
                                    </td>
                                    <td class="text-center">
                                        <?= $Belum_bayar->no_hp ?>
                                    </td>
                                    <td class="text-left">
                                        <?= $Belum_bayar->alamat_lengkap ?><br>
                                        RT. <?= $Belum_bayar->nm_rt ?> RW. <?= $Belum_bayar->nm_rw ?><br>
                                        Dk. <?= $Belum_bayar->nm_desa ?>, Kec.
                                        <?= $Belum_bayar->nm_kecamatan ?><br>
                                        <?= $Belum_bayar->kot_kab ?> - <?= $Belum_bayar->prov ?>
                                    </td>
                                    <td class="text-center">
                                        <a class="btn btn-primary btn-sm"
                                            href="<?= base_url('arisan/aktifitas/tagihan/undian/' . $this->encrypt->encode($Belum_bayar->no_regist)) ?>"
                                            style="color: white;">Bayar</a>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </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">
                        <h4 class="">( <?= $jml_aktif - $blm_bayar ?> ) Anggota Sudah Bayar</h4>
                        <table id="style-4" class="table style-4  table-hover">
                            <thead>
                                <tr>
                                    <th class="text-center">Undian</th>
                                    <th class="text-center">Identitas</th>
                                    <th class="text-center">No HP</th>
                                    <th class="text-center">Alamat</th>
                                    <th class="text-center">Status Bayar</th>
                                    <th class="text-center">Invoice</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php foreach ($anggota_bayar as $Sudah_bayar) : ?>
                                <tr>
                                    <td class="text-center">
                                        <?= $Sudah_bayar->no_arisan ?>
                                    </td>
                                    <td class="text-left">
                                        No Regist : <?= $Sudah_bayar->no_regist ?><br>
                                        NIK : <?= $Sudah_bayar->nik ?><br>
                                        Nama : <?= $Sudah_bayar->nm_anggota ?>
                                    </td>
                                    <td class="text-center">
                                        <?= $Sudah_bayar->no_hp ?>
                                    </td>
                                    <td class="text-left">
                                        <?= $Sudah_bayar->alamat_lengkap ?><br>
                                        RT. <?= $Sudah_bayar->nm_rt ?> RW. <?= $Sudah_bayar->nm_rw ?><br>
                                        Dk. <?= $Sudah_bayar->nm_desa ?>, Kec.
                                        <?= $Sudah_bayar->nm_kecamatan ?><br>
                                        Kab. Kudus, Kode Pos : <?= $Sudah_bayar->kd_pos ?>
                                    </td>
                                    <td class="text-center">
                                        <?php
                                            if ($Sudah_bayar->status_bayar == 'VERIFIKASI') : ?>
                                        <span class="shadow-none badge badge-primary">VERIFIKASI</span>
                                        <?php else : ?>
                                        <span class="shadow-none badge badge-success">LUNAS</span>
                                        <?php endif;
                                            ?>
                                    </td>
                                    <td class="text-center">
                                        <div class="btn-group mr-2 sm" style="float: right;">
                                            <button class="btn btn-primary btn-sm dropdown-toggle" type="button"
                                                data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
                                                Invoice <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="<?= base_url('arisan/aktifitas/tagihan/invoice_cetak/' . $this->encrypt->encode($Sudah_bayar->kd_tagihan)) ?>"
                                                    class="dropdown-item">Cetak</a>
                                                <a href="<?= base_url('arisan/aktifitas/tagihan/invoice_kirim/' . $this->encrypt->encode($Sudah_bayar->kd_tagihan)) ?>"
                                                    class="dropdown-item">Kirim</a>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('arisan/aktifitas/undian/modal'); ?>