<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">Angsuran</th>
                            <th class="text-center">Aksi</th>
                            <th class="text-center">Jatuh Tempo</th>
                            <th class="text-center">Detail Angsuran</th>
                            <th class="text-center">Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($data_angsuran as $Data_angsuran) : ?>
                            <tr>
                                <td class="text-center">
                                    <?= $Data_angsuran->angs_ke ?>
                                </td>
                                <td class="text-center">
                                    <center>
                                        <?php if ($Data_angsuran->status_angsuran == 'BELUM') : ?>
                                            <a class="btn btn-success btn-sm"
                                                href="<?= base_url('marketing/kegiatan/kontrak/bayar_lunas/' . $this->encrypt->encode($Data_angsuran->angs_id)) ?>"
                                                style="color: white;">Bayar</a>
                                        <?php elseif ($Data_angsuran->status_angsuran == 'MACET') : ?>
                                            <a class="btn btn-danger btn-sm"
                                                href="<?= base_url('marketing/kegiatan/kontrak/bayar_macet/' . $this->encrypt->encode($Data_angsuran->angs_id)) ?>"
                                                style="color: white;">Bayar</a>
                                        <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_LANCAR') : ?>
                                            <?php if ($Data_angsuran->produk_id == 121) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_mingguan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 122) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_dua_mingguan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 123) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 124) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_musiman/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 125) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/anggota_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 126) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/karyawan_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php endif; ?>
                                        <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_MACET') : ?>
                                            <?php if ($Data_angsuran->produk_id == 121) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_mingguan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 122) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_dua_mingguan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 123) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 124) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/koperasi_musiman/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 125) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/anggota_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php elseif ($Data_angsuran->produk_id == 126) : ?>
                                                <a class="btn btn-primary btn-sm" target="_blank"
                                                    href="<?= base_url('assets/invoice/karyawan_bulanan/' . date('Y', strtotime($Data_angsuran->tgl_bayar)) . '/' . date('m', strtotime($Data_angsuran->tgl_bayar)) . '/' . $Data_angsuran->invoice_pdf) ?>"
                                                    style="color: white;">Invoice</a>
                                            <?php endif; ?>
                                        <?php endif; ?>
                                    </center>
                                </td>
                                <td class="text-left">
                                    Jatuh Tempo :
                                    <?= date('d', strtotime($Data_angsuran->tgl_tempo)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_angsuran->tgl_tempo))) . ' ' .  date('Y', strtotime($Data_angsuran->tgl_tempo))  ?><br>
                                    Tanggal Bayar : <?php if ($Data_angsuran->status_angsuran == 'BELUM') : ?>
                                        -
                                    <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_LANCAR') : ?>
                                        <?= date('d', strtotime($Data_angsuran->tgl_bayar)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_angsuran->tgl_bayar))) . ' ' .  date('Y', strtotime($Data_angsuran->tgl_bayar))  ?>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'MACET') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-danger">MACET</span>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_MACET') : ?>
                                        <?= date('d', strtotime($Data_angsuran->tgl_bayar)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_angsuran->tgl_bayar))) . ' ' .  date('Y', strtotime($Data_angsuran->tgl_bayar))  ?>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'PROSES') : ?>
                                        <?= date('d', strtotime($Data_angsuran->tgl_bayar)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_angsuran->tgl_bayar))) . ' ' .  date('Y', strtotime($Data_angsuran->tgl_bayar))  ?>
                                    <?php endif; ?>
                                </td>
                                <td class="text-left">
                                    Angs : <?= number_format($Data_angsuran->bsr_bayar, 0, ',', '.') ?>,-<br>
                                    Pokok : <?= number_format($Data_angsuran->bsr_pokok, 0, ',', '.') ?>,-<br>
                                    Jasa : <?= number_format($Data_angsuran->bsr_jasa, 0, ',', '.') ?>,-<br>
                                    Simp : <?= number_format($Data_angsuran->bsr_simpanan, 0, ',', '.') ?>,-
                                </td>
                                <td class="text-center">
                                    <?php if ($Data_angsuran->status_angsuran == 'BELUM') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-primary">BELUM BAYAR</span>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_LANCAR') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-success">LUNAS</span>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'MACET') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-danger">MACET</span>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_MACET') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-warning">LUNAS</span>
                                    <?php elseif ($Data_angsuran->status_angsuran == 'PROSES') : ?>
                                        <span style="float: center;" class="shadow-none badge badge-primary">VERIFIKASI</span>
                                    <?php endif; ?>
                                </td>
                            </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>