<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" 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 style="float: right;" class="btn btn-primary btn-sm" href="javascript:void(0);"
                                data-toggle="modal" data-target="#tambahAnggotaMotor" style="color: white;">Ajukan
                                Anggota</a>
                            <p class="d-inline">
                                Arisan Motor Bina Artha Prima
                            </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">Anggota</th>
                                    <th class="text-center">Pembayaran</th>
                                    <th class="text-center">Status</th>
                                    <th class="text-center">Aksi</th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $no = 1; ?>
                                <?php foreach ($data_arisan_motor as $Data_arisan_motor) : ?>
                                <tr>
                                    <td>
                                        <center><?= $no ?></center>
                                    </td>
                                    <td class="text-left">
                                        Arisan Motor <?= $Data_arisan_motor->ket_arisan ?><br>Kelompok Ke-
                                        <?= $Data_arisan_motor->nm_kelompok ?> <br>
                                        Registrasi : <?= $Data_arisan_motor->regist_arisan ?>
                                    </td>
                                    <td class="text-left">
                                        Anggota : <?= $Data_arisan_motor->target_anggota ?><br>
                                        <?php foreach ($jml_anggota as $Jml_anggota) :
                                                if ($Data_arisan_motor->regist_arisan == $Jml_anggota->regist_arisan) :
                                                    $total = $Jml_anggota->anggota;
                                                    echo 'Antrian : ' . $total . ' Anggota <br>';
                                                endif;
                                            endforeach;
                                            ?>
                                        <?php foreach ($anggota_menang as $Anggota_menang) :
                                                if ($Data_arisan_motor->regist_arisan == $Anggota_menang->regist_arisan) :
                                                    $total = $Anggota_menang->anggota;
                                                    echo 'Menang : ' . $total . ' Anggota <br>';
                                                endif;
                                            endforeach;
                                            ?>
                                        <?php foreach ($anggota_mundur as $Anggota_mundur) :
                                                if ($Data_arisan_motor->regist_arisan == $Anggota_mundur->regist_arisan) :
                                                    $total = $Anggota_mundur->anggota;
                                                    echo 'Mundur : ' . $total . ' Anggota <br>';
                                                endif;
                                            endforeach;
                                            ?>
                                    </td>
                                    <td class="text-left">
                                        Iuran /Bulan : Rp
                                        <?= number_format($Data_arisan_motor->tagihan_iuran, 0, ',', '.') ?> ,-
                                        @<?= $Data_arisan_motor->tempo ?> Bulan<br>
                                        Administrasi : Rp
                                        <?= number_format($Data_arisan_motor->admin_arisan, 0, ',', '.') ?>
                                        ,-<br>
                                        Dana Kehilangan : Rp
                                        <?= number_format($Data_arisan_motor->dana_kehilangan, 0, ',', '.') ?> ,-<br>
                                    </td>
                                    <td class="text-center">
                                        <?php
                                            if ($Data_arisan_motor->status_arisan == 'PROSES') : ?>
                                        <span
                                            class="shadow-none badge badge-primary"><?= $Data_arisan_motor->status_arisan ?></span>
                                        <?php elseif ($Data_arisan_motor->status_arisan == 'AKTIF') : ?>
                                        <span
                                            class="shadow-none badge badge-success"><?= $Data_arisan_motor->status_arisan ?></span>
                                        <?php elseif ($Data_arisan_motor->status_arisan == 'SELESAI') : ?>
                                        <span
                                            class="shadow-none badge badge-secondary"><?= $Data_arisan_motor->status_arisan ?></span>
                                        <?php else : ?>
                                        <span
                                            class="shadow-none badge badge-danger"><?= $Data_arisan_motor->status_arisan ?></span>
                                        <?php endif;
                                            ?>
                                    </td>
                                    <td class="text-center">
                                        <a class="btn btn-primary btn-sm"
                                            href="<?= base_url('keuangan/laporan_arisan/kelompok_motor/detail/' . $this->encrypt->encode($Data_arisan_motor->regist_arisan)) ?>"
                                            style="color: white;">Detail
                                            <?php if ($Data_arisan_motor->regist_arisan == $laporan_verif['regist_arisan']) : ?>
                                            <span class="badge badge-danger counter"
                                                style="position: static;"><?= $laporan_verif['ttl_laporan'] ?></span><?php endif; ?></a>
                                    </td>
                                </tr>
                                <?php $no++; ?>
                                <?php endforeach; ?>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('keuangan/laporan/arisan/motor/m_tam'); ?>