<div class="row layout-spacing">
    <div class="col-lg-12">
        <div class="statbox widget box box-shadow">
            <div class="widget-content widget-content-area">
                <h4 class="">Transaksi Angsuran</h4>
                <table id="style-4" class="table style-4  table-hover">
                    <thead>
                        <tr>
                            <th class="text-center">No</th>
                            <th class="text-center">Identitas</th>
                            <th class="text-center">Alamat</th>
                            <th class="text-center">Angsuran</th>
                            <th class="text-center">Aksi</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $no = 1; ?>
                        <?php foreach ($data_transaksi as $Data_pinjaman) : ?>
                            <tr>
                                <td>
                                    <center><?= $no ?></center>
                                </td>
                                <td class="text-left">
                                    Kontrak : <?= $Data_pinjaman->kontrak_id ?><br>
                                    Nama : <?= $Data_pinjaman->nik ?><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 ?><br>
                                    <?= $Data_pinjaman->prov ?>
                                </td>
                                <td class="text-left">
                                    Tempo : <?= $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>
                                    Bayar : <?= $this->mycustom->hariIndo(date('l', strtotime($Data_pinjaman->tgl_tempo))) ?>,
                                    <?= date('d', strtotime($Data_pinjaman->tgl_bayar)) ?>
                                    <?= $this->mycustom->bulanIndo(date('m', strtotime($Data_pinjaman->tgl_bayar))) ?>
                                    <?= date('Y', strtotime($Data_pinjaman->tgl_bayar)) ?><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>
                                <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">
                                            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('kasir/invoice_kirim/anggota/' . $this->encrypt->encode($Data_pinjaman->invoice_pdf)) ?>" class="dropdown-item">Kirim Invoice</a>
                                            <?php if ($Data_pinjaman->produk_id == 121) : ?>
                                                <a href="<?= base_url('assets/invoice/koperasi_mingguan/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php elseif ($Data_pinjaman->produk_id == 122) : ?>
                                                <a href="<?= base_url('assets/invoice/koperasi_dua_mingguan/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php elseif ($Data_pinjaman->produk_id == 123) : ?>
                                                <a href="<?= base_url('assets/invoice/koperasi_bulanan/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php elseif ($Data_pinjaman->produk_id == 124) : ?>
                                                <a href="<?= base_url('assets/invoice/koperasi_musiman/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php elseif ($Data_pinjaman->produk_id == 125) : ?>
                                                <a href="<?= base_url('assets/invoice/anggota_bulanan/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php elseif ($Data_pinjaman->produk_id == 126) : ?>
                                                <a href="<?= base_url('assets/invoice/karyawan_bulanan/' . date('Y', strtotime($Data_pinjaman->tgl_bayar)) . '/' . date('m', strtotime($Data_pinjaman->tgl_bayar)) . '/' . $Data_pinjaman->invoice_pdf) ?>" class="dropdown-item" target="_blank">Download Invoice</a>
                                            <?php endif; ?>
                                        </div>
                                    </div>
                                </td>
                            </tr>
                            <?php $no++; ?>
                        <?php endforeach; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>