<div class="row layout-spacing" style="padding-bottom: 0px;">
    <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 btn-sm 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="<?= base_url('marketing/kegiatan/pengajuan_pinjaman') ?>" class="dropdown-item">Pengajuan</a>
                            <a href="<?= base_url('marketing/kegiatan/pinjaman_aktif') ?>" class="dropdown-item">Pembayaran</a>
                        </div>
                    </div>
                    <p class="d-inline">
                        Rencana Kerja Penagihan
                    </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">Aksi</th>
                            <th class="text-center">Identitas</th>
                            <th class="text-center">Alamat</th>
                            <th class="text-center">Angsuran</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($data_pinjaman as $Data_pinjaman) : ?>
                            <?php if ($Data_pinjaman->login_id == $data_id_login) : ?>
                                <tr>
                                    <td>
                                        <center><?= $no ?></center>
                                    </td>
                                    <td class="text-center">
                                        <?php if ($Data_pinjaman->status_angsuran == 'BELUM') : ?>
                                            <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">
                                                    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="<?php
                                                                $cek_nomor = substr($Data_pinjaman->no_hp, 0, 1);
                                                                if ($cek_nomor == 0) :
                                                                    $no_hp = '62' . substr($Data_pinjaman->no_hp, 1, 20);
                                                                else :
                                                                    $no_hp = $Data_pinjaman->no_hp;
                                                                endif;
                                                                echo 'https://wa.me/' . $no_hp;
                                                                ?>"
                                                        target="_blank" class="dropdown-item">Notifikasi</a>
                                                    <a href="<?= base_url('marketing/kegiatan/angsuran/bayar/' . $this->encrypt->encode($Data_pinjaman->angsuran_id)) ?>"
                                                        class="dropdown-item">Bayar</a>
                                                    <?php if ($Data_pinjaman->status_angsuran == 'BELUM') : ?>
                                                        <a href="<?= base_url('marketing/kegiatan/angsuran/macet/' . $this->encrypt->encode($Data_pinjaman->angsuran_id)) ?>"
                                                            class="dropdown-item">Macet</a>
                                                    <?php endif; ?>
                                                </div>
                                            </div>
                                        <?php elseif ($Data_pinjaman->status_angsuran == 'MACET') : ?>
                                            <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">
                                                    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="<?php
                                                                $cek_nomor = substr($Data_pinjaman->no_hp, 0, 1);
                                                                if ($cek_nomor == 0) :
                                                                    $no_hp = '62' . substr($Data_pinjaman->no_hp, 1, 20);
                                                                else :
                                                                    $no_hp = $Data_pinjaman->no_hp;
                                                                endif;
                                                                echo 'https://wa.me/' . $no_hp;
                                                                ?>"
                                                        target="_blank" class="dropdown-item">Notifikasi</a>
                                                    <a href="<?= base_url('marketing/kegiatan/angsuran/bayar/' . $this->encrypt->encode($Data_pinjaman->angsuran_id)) ?>"
                                                        class="dropdown-item">Bayar</a>
                                                </div>
                                            </div>
                                        <?php endif; ?>
                                    </td>
                                    <td class="text-left">
                                        Kontrak : <?= $Data_pinjaman->kontrak_id ?><br>
                                        Nama : <?= $Data_pinjaman->nm_anggota ?><br>
                                        No Hp : <?= $Data_pinjaman->no_hp ?>
                                    </td>
                                    <td class="text-left">
                                        <?= $Data_pinjaman->alamat_lengkap ?>,<br>
                                        RT. <?= $Data_pinjaman->nm_rt ?> / RW. <?= $Data_pinjaman->nm_rw ?>, Ds.
                                        <?= $Data_pinjaman->nm_desa ?><br>
                                        Kec. <?= $Data_pinjaman->nm_kecamatan ?>, <?= $Data_pinjaman->kot_kab ?> -
                                        <?= $Data_pinjaman->prov ?>
                                    </td>
                                    <td class="text-left">
                                        <?= $this->mycustom->hariIndo(date('l', strtotime($Data_pinjaman->tgl_tempo))) ?>,
                                        <?= date('d', strtotime($Data_pinjaman->tgl_tempo)) ?>
                                        <?= $this->mycustom->bulanIndo(date('m', strtotime($Data_pinjaman->tgl_tempo))) ?>
                                        <?= date('Y', strtotime($Data_pinjaman->tgl_tempo)) ?><br>
                                        Angs : <?= $Data_pinjaman->angs_ke ?>/<?= $Data_pinjaman->tempo ?>
                                        @<?php if ($Data_pinjaman->produk_id == 121) : echo 'Mingguan';
                                            elseif ($Data_pinjaman->produk_id == 122) : echo 'Dua Mingguan';
                                            elseif ($Data_pinjaman->produk_id == 123) : echo 'Bulanan';
                                            elseif ($Data_pinjaman->produk_id == 124) : echo 'Musiman';
                                            elseif ($Data_pinjaman->produk_id == 123) : echo 'Bulanan Anggota';
                                            elseif ($Data_pinjaman->produk_id == 123) : echo 'Bulanan Karyawan';
                                            endif; ?><br>
                                        Bayar : <?= number_format($Data_pinjaman->bsr_bayar, 0, ',', '.') ?>,-
                                    </td>
                                </tr>
                                <?php $no++; ?>
                            <?php endif; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>