<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">Tempo</th>
                            <th class="text-center">Tanggungan</th>
                            <th class="text-center">Bayar</th>
                            <th class="text-center">Pokok</th>
                            <th class="text-center">Jasa</th>
                            <th class="text-center">Simpanan</th>
                            <th class="text-center">Status</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($angsuran as $Data_angsuran) : ?>
                        <tr>

                            <td class="text-center">
                                <?= $Data_angsuran->angs_ke ?>
                            </td>
                            <td class="text-left">
                                <?= $this->mycustom->hariIndo(date('l', strtotime($Data_angsuran->tgl_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>
                            </td>
                            <?php if ($Data_angsuran->tgl_bayar != null) : ?>
                            <td class="text-left">
                                <?= $this->mycustom->hariIndo(date('l', strtotime($Data_angsuran->tgl_bayar)))  ?>,
                                <?= date('d', strtotime($Data_angsuran->tgl_bayar)) . ' ' . $this->mycustom->bulanIndo(date('m', strtotime($Data_angsuran->tgl_bayar))) . ' ' .  date('Y', strtotime($Data_angsuran->tgl_bayar))  ?>
                            </td>
                            <?php else : ?>
                            <td class="text-center">
                                <span class="badge badge-primary"> Belum Bayar </span>
                            </td>
                            <?php endif; ?>
                            <td class="text-right">
                                <?= number_format($Data_angsuran->bsr_bayar, 0, ',', '.') ?>,-
                            </td>
                            <td class="text-right">
                                <?= number_format($Data_angsuran->bsr_pokok, 0, ',', '.') ?>,-
                            </td>
                            <td class="text-right">
                                <?= number_format($Data_angsuran->bsr_jasa, 0, ',', '.') ?>,-
                            </td>
                            <td class="text-right">
                                <?= number_format($Data_angsuran->bsr_simpanan, 0, ',', '.') ?>,-
                            </td>
                            <td class="text-center">
                                <?php if ($Data_angsuran->status_angsuran == 'BELUM') : ?>
                                <span class="badge badge-primary"> Belum Bayar </span>
                                <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_LANCAR') : ?>
                                <span class="badge badge-success"> Bayar </span>
                                <?php elseif ($Data_angsuran->status_angsuran == 'MACET') : ?>
                                <span class="badge badge-danger"> Macet </span>
                                <?php elseif ($Data_angsuran->status_angsuran == 'LUNAS_MACET') : ?>
                                <span class="badge badge-warning"> Bayar </span>
                                <?php elseif ($Data_angsuran->status_angsuran == 'PROSES') : ?>
                                <span class="badge badge-secondary"> Proses </span>
                                <?php endif; ?>
                            </td>
                        </tr>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>