<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">Aksi</th>
                            <th class="text-center">Identitas</th>
                            <th class="text-center">Alamat</th>
                            <th class="text-center">Pinjaman</th>
                            <th class="text-center">Kontrak</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($data_pengajuan as $Data_pengajuan) : ?>
                        <tr>
                            <td class="text-left">
                                <?= $no ?>
                            </td>
                            <td class="text-center">
                                <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">
                                        <?php if ($Data_pengajuan->jaminan == 'Y') : ?>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_jaminan"
                                            data-target="#jaminan_detail" class="bs-tooltip" data-toggle="modal"
                                            data-kontrak_id="<?= $Data_pengajuan->kontrak_id ?>">Jaminan</a>
                                        <?php endif; ?>
                                        <?php if ($Data_pengajuan->status_kontrak == 'SURVEY') : ?>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_penerimaan"
                                            data-target="#terima_detail" class="bs-tooltip" data-toggle="modal"
                                            data-kontrak_id="<?= $Data_pengajuan->kontrak_id ?>">Terima</a>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_penolakan"
                                            data-target="#tolak_detail" class="bs-tooltip" data-toggle="modal"
                                            data-kontrak_id="<?= $Data_pengajuan->kontrak_id ?>">Tolak</a>
                                        <?php else: ?>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_identitas"
                                            data-target="#identitas_detail" class="bs-tooltip" data-toggle="modal"
                                            data-anggota_id="<?= $Data_pengajuan->anggota_id ?>"
                                            data-nik="<?= $Data_pengajuan->nik ?>"
                                            data-nm_anggota="<?= $Data_pengajuan->nm_anggota ?>"
                                            data-jk="<?= $Data_pengajuan->jk ?>"
                                            data-tempat_lahir="<?= $Data_pengajuan->tempat_lahir ?>"
                                            data-no_hp="<?= $Data_pengajuan->no_hp ?>"
                                            data-nomor_kk="<?= $Data_pengajuan->kk_id ?>"
                                            data-pekerjaan="<?= $Data_pengajuan->pekerjaan ?>"
                                            data-suami_istri="<?= $Data_pengajuan->suami_istri ?>"
                                            data-foto_ktp="<?= $Data_pengajuan->foto_ktp ?>"
                                            data-foto_kk="<?= $Data_pengajuan->foto_kk ?>"
                                            data-tgl_lahir="<?= $Data_pengajuan->tgl_lahir ?>">Identitas</a>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_alamat"
                                            data-target="#alamat_detail" class="bs-tooltip" data-toggle="modal"
                                            data-anggota_id="<?= $Data_pengajuan->anggota_id ?>"
                                            data-nik="<?= $Data_pengajuan->nik ?>"
                                            data-alamat_lengkap="<?= $Data_pengajuan->alamat_lengkap ?>"
                                            data-nm_rt="<?= $Data_pengajuan->nm_rt ?>"
                                            data-nm_rw="<?= $Data_pengajuan->nm_rw ?>"
                                            data-id_alamat="<?= $Data_pengajuan->id_alamat ?>"
                                            data-nm_desa="<?= $Data_pengajuan->nm_desa ?>"
                                            data-nm_kec="<?= $Data_pengajuan->nm_kecamatan ?>"
                                            data-kot_kab="<?= $Data_pengajuan->kot_kab ?>"
                                            data-provinsi="<?= $Data_pengajuan->prov ?>">Alamat</a>
                                        <a href="javascript:void(0);" class="dropdown-item" id="detail_kontrak"
                                            data-target="#kontrak_detail" class="bs-tooltip" data-toggle="modal"
                                            data-anggota_id="<?= $Data_pengajuan->anggota_id ?>"
                                            data-nik="<?= $Data_pengajuan->nik ?>"
                                            data-kontrak_id="<?= $Data_pengajuan->kontrak_id ?>"
                                            data-pokok_pinjaman="<?= $Data_pengajuan->pokok_pinjaman ?>"
                                            data-produk_id="<?= $Data_pengajuan->produk_id ?>">Kontrak</a>
                                        <a class="dropdown-item"
                                            href="<?= base_url('marketing/identitas/anggota/' . $this->encrypt->encode($Data_pengajuan->anggota_id)) ?>">Detail</a>
                                        <?php endif; ?>
                                    </div>
                                </div>
                            </td>
                            <td class="text-left">
                                NIK : <?= $Data_pengajuan->nik ?><br>
                                Nama : <?= $Data_pengajuan->nm_anggota ?><br>
                                TTL : <?= $Data_pengajuan->tempat_lahir ?>,
                                <?= date('d', strtotime($Data_pengajuan->tgl_lahir)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_pengajuan->tgl_lahir))) . ' ' .  date('Y', strtotime($Data_pengajuan->tgl_lahir))  ?><br>
                                No HP : <?= $Data_pengajuan->no_hp ?>
                            </td>
                            <td class="text-left">
                                <?= $Data_pengajuan->alamat_lengkap ?><br>
                                RT. <?= $Data_pengajuan->nm_rt ?> / RW. <?= $Data_pengajuan->nm_rw ?>, Ds.
                                <?= $Data_pengajuan->nm_desa ?><br>
                                Kec. <?= $Data_pengajuan->nm_kecamatan ?>, <?= $Data_pengajuan->kot_kab ?>,<br>
                                <?= $Data_pengajuan->prov ?><br>
                            </td>
                            <td class="text-left">
                                Pinjaman : Rp <?= number_format($Data_pengajuan->pokok_pinjaman, 0, ',', '.') ?>,- <br>
                                Tempo :
                                <?php if ($Data_pengajuan->aturan_id == 2) :
                                        echo '8X - Dua Mingguan';
                                    else :
                                        echo '12X - Mingguan';
                                    endif ?>
                                <br>
                                Angsuran : Rp <?= number_format($Data_pengajuan->bsr_angsuran, 0, ',', '.') ?>,- <br>
                                Pengajuan :
                                <?= date('d', strtotime($Data_pengajuan->tgl_pengajuan)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_pengajuan->tgl_pengajuan))) . ' ' .  date('Y', strtotime($Data_pengajuan->tgl_pengajuan))  ?>
                            </td>
                            <td class="text-left">
                                Pot. Admin : Rp <?= number_format($Data_pengajuan->bsr_admin, 0, ',', '.') ?>,- <br>
                                Pot. RK : Rp <?= number_format($Data_pengajuan->bsr_rk, 0, ',', '.') ?>,- <br>
                                Simp/Angsuran : Rp <?= number_format($Data_pengajuan->bsr_simpanan, 0, ',', '.') ?>,-
                                <br>
                                Jasa/Angsuran : Rp <?= number_format($Data_pengajuan->bsr_jasa, 0, ',', '.') ?>,- <br>
                            </td>
                        </tr>
                        <?php $no++; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_identitas'); ?>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_alamat'); ?>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_kontrak'); ?>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_jaminan'); ?>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_terima'); ?>
<?php $this->load->view('marketing/kegiatan/pengajuan/mod_tolak'); ?>