<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">
            <div class="col-lg-12">
                <blockquote class="blockquote media-object">
                    <div class="media">
                        <div class="media-body align-self-center">
                            <!-- Jikas Status Undian TIdak Sama Dengan Proses -->
                            <!-- Jika Iya tidak sama -->
                            <button type="button" style="float: right;" class="btn btn-primary mb-2 mr-2 btn-rounded"
                                data-toggle="modal" data-target="#tambahDataArisan">
                                <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-edit">
                                    <path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path>
                                    <path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path>
                                </svg> Tambah
                            </button>
                            <p class="d-inline">
                                <!-- Jika Kategori menunjukkan 21 -->
                                Daftar Kelompok Arisan Heboh
                            </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">No</th>
                                    <th class="text-center">Kelompok</th>
                                    <th class="text-center">Detail</th>
                                    <th class="text-center">Status</th>
                                    <th class="text-center">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $no = 1; ?>
                                <?php foreach ($data_arisan_heboh as $Data_arisan_heboh) : ?>
                                <tr>
                                    <td>
                                        <center><?= $no ?></center>
                                    </td>
                                    <td class="text-left">
                                        Kelompok : <?= $Data_arisan_heboh->nm_kelompok ?><br>
                                        Regist : <?= $Data_arisan_heboh->regist_arisan ?><br>
                                        Target : <?= $Data_arisan_heboh->target_anggota ?><br>
                                        Anggota : <?php
                                                        foreach ($jml_anggota as $Jml_anggota) :
                                                            if ($Data_arisan_heboh->regist_arisan == $Jml_anggota->regist_arisan) :
                                                                $total = $Jml_anggota->anggota;
                                                                echo $total;
                                                            endif;
                                                        endforeach;
                                                        ?> Anggota <br>
                                    </td>
                                    <td class="text-left">
                                        Iuran /Bulan : Rp <?= $Data_arisan_heboh->tagihan_iuran ?> ,-
                                        /@<?= $Data_arisan_heboh->tempo ?> Bulan <br>
                                        Administrasi : Rp <?= $Data_arisan_heboh->admin_arisan ?> ,-<br>
                                        Potongan Awal : Rp <?= $Data_arisan_heboh->hg_standar ?> ,-<br>
                                        Saldo Anggota : Rp <?= $Data_arisan_heboh->hg_target ?> ,-<br>
                                    </td>
                                    <td class="text-center">
                                        <?php
                                            if ($Data_arisan_heboh->status_arisan == 'PROSES') : ?>
                                        <span
                                            class="shadow-none badge badge-primary"><?= $Data_arisan_heboh->status_arisan ?></span>
                                        <?php elseif ($Data_arisan_heboh->status_arisan == 'AKTIF') : ?>
                                        <span
                                            class="shadow-none badge badge-success"><?= $Data_arisan_heboh->status_arisan ?></span>
                                        <?php elseif ($Data_arisan_heboh->status_arisan == 'SELESAI') : ?>
                                        <span
                                            class="shadow-none badge badge-secondary"><?= $Data_arisan_heboh->status_arisan ?></span>
                                        <?php else : ?>
                                        <span
                                            class="shadow-none badge badge-danger"><?= $Data_arisan_heboh->status_arisan ?></span>
                                        <?php endif;
                                            ?>
                                    </td>
                                    <td class="text-center">
                                        <?php if ($Data_arisan_heboh->status_arisan == 'PROSES') : ?>
                                        <div class="btn-group mr-2">
                                            <button class="btn btn-primary btn-sm dropdown-toggle" style="width: 100px;"
                                                type="button" data-toggle="dropdown" aria-haspopup="true"
                                                aria-expanded="false">
                                                Pilih Aksi <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" id="detail_arisan"
                                                    data-target="#arisan_detail" class="bs-tooltip" data-toggle="modal"
                                                    data-regist_arisan="<?= $Data_arisan_heboh->regist_arisan ?>"
                                                    data-nm_kelompok="<?= $Data_arisan_heboh->nm_kelompok ?>"
                                                    data-ttl_anggota="<?= $Data_arisan_heboh->target_anggota ?>"
                                                    data-tagihan_iuran="<?= $Data_arisan_heboh->tagihan_iuran ?>"
                                                    data-tempo="<?= $Data_arisan_heboh->tempo ?>"
                                                    data-hg_modal="<?= $Data_arisan_heboh->hg_standar ?>"
                                                    data-fee_admin="<?= $Data_arisan_heboh->admin_arisan ?>"
                                                    data-hg_jual="<?= $Data_arisan_heboh->hg_target ?>">Update
                                                    Data</a>
                                                <a class="dropdown-item"
                                                    href="<?= base_url('arisan/data/kelompok_heboh/kelompok/' . $this->encrypt->encode($Data_arisan_heboh->regist_arisan)) ?>">Detail
                                                    Data</a>
                                            </div>
                                        </div>
                                        <?php else : ?>
                                        <a class="btn btn-primary btn-sm"
                                            href="<?= base_url('arisan/data/kelompok_heboh/kelompok/' . $this->encrypt->encode($Data_arisan_heboh->regist_arisan)) ?>">Detail</a>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                                <?php $no++; ?>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>

    </div>
</div>
<?php $this->load->view('arisan/keloladata/arisanheboh/tambah_arisan'); ?>
<?php $this->load->view('arisan/keloladata/arisanheboh/ubah_detail'); ?>