<div class="modal fade" id="konten_detail" tabindex="-1" role="dialog" aria-labelledby="konten_detailTitle"
    aria-hidden="true">
    <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="konten_detailTitle">
                    Detail Nota
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="detail_body_nota">
                <?php echo form_open_multipart('owner/database/koperasi/angsuran/crud'); ?>
                <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>"
                    value="<?= $this->security->get_csrf_hash(); ?>" style="display: none">
                <div class="form-group">
                    <label>Kontrak ID</label>
                    <input type="number" class="form-control" id="kontrak_id" name="kontrak_id"
                        placeholder="Masukkan Nama Desa" required readonly>
                </div>
                <div class="form-group">
                    <label>Angsuran ID</label>
                    <input type="number" class="form-control" hidden id="angsuran_id" name="angsuran_id"
                        placeholder="Masukkan Qty Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Angsuran Ke-</label>
                    <input type="number" class="form-control" id="angs_ke" name="angs_ke"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Tanggal Angsuran</label>
                    <input type="date" class="form-control" id="tgl_tempo" name="tgl_tempo"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Tanggal Bayar</label>
                    <input type="date" class="form-control" id="tgl_bayar" name="tgl_bayar"
                        placeholder="Masukkan Total Pembayaran">
                </div>
                <div class="form-group">
                    <label>Besar Angsuran</label>
                    <input type="number" class="form-control" id="bsr_bayar" name="bsr_bayar"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Besar Pokok Angsuran</label>
                    <input type="number" class="form-control" id="bsr_pokok" name="bsr_pokok"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Besar Simpanan Angsuran</label>
                    <input type="number" class="form-control" id="bsr_simpanan" name="bsr_simpanan"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Besar Jasa Angsuran</label>
                    <input type="number" class="form-control" id="bsr_jasa" name="bsr_jasa"
                        placeholder="Masukkan Total Pembayaran" required>
                </div>
                <div class="form-group">
                    <label>Status Angsuran?</label>
                    <select class="form-control" id="status_angsuran" name="status_angsuran" required>
                        <option value="BELUM">BELUM</option>
                        <option value="LUNAS_LANCAR">LUNAS_LANCAR</option>
                        <option value="MACET">MACET</option>
                        <option value="LUNAS_MACET">LUNAS_MACET</option>
                        <option value="PROSES">PROSES</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="deleteDatabaseTerbaru" name="deleteDatabaseTerbaru"
                    class="btn btn-danger">Hapus</button>
                <button type="submit" id="updateDatabaseTerbaru" name="updateDatabaseTerbaru"
                    class="btn btn-warning">Update</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
$(document).on("click", "#detail_konten", function() {
    var kontrak_id = $(this).data('kontrak_id');
    var angsuran_id = $(this).data('angsuran_id');
    var angs_ke = $(this).data('angs_ke');
    var tgl_tempo = $(this).data('tgl_tempo');
    var tgl_bayar = $(this).data('tgl_bayar');
    var bsr_bayar = $(this).data('bsr_bayar');
    var bsr_pokok = $(this).data('bsr_pokok');
    var bsr_simpanan = $(this).data('bsr_simpanan');
    var bsr_jasa = $(this).data('bsr_jasa');
    var status_angsuran = $(this).data('status_angsuran');
    $(".modal-body#detail_body_nota #kontrak_id").val(kontrak_id);
    $(".modal-body#detail_body_nota #angsuran_id").val(angsuran_id);
    $(".modal-body#detail_body_nota #angs_ke").val(angs_ke);
    $(".modal-body#detail_body_nota #tgl_tempo").val(tgl_tempo);
    $(".modal-body#detail_body_nota #tgl_bayar").val(tgl_bayar);
    $(".modal-body#detail_body_nota #bsr_bayar").val(bsr_bayar);
    $(".modal-body#detail_body_nota #bsr_pokok").val(bsr_pokok);
    $(".modal-body#detail_body_nota #bsr_simpanan").val(bsr_simpanan);
    $(".modal-body#detail_body_nota #bsr_jasa").val(bsr_jasa);
    $(".modal-body#detail_body_nota #status_angsuran").val(status_angsuran);
})
</script>