<div class="modal fade" id="aturan_detail" tabindex="-1" role="dialog" aria-labelledby="aturan_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="aturan_detailTitle">
                    Aturan Pinjaman Koperasi
                </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">
                <?php echo form_open_multipart('keuangan/sistem/aturan_pinjaman/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>Administrasi</label>
                    <input type="text" class="form-control" id="administrasi" name="administrasi" placeholder="Biaya Administrasi" required>
                    <input type="text" class="form-control" hidden id="produk_id" name="produk_id" placeholder="Nomor Induk Kependudukan ( NIK )" required>
                    <input type="text" class="form-control" hidden id="aturan_id" name="aturan_id" placeholder="Nomor Induk Kependudukan ( NIK )" required>
                </div>
                <div class="form-group">
                    <label>Resiko Kehilangan</label>
                    <input type="text" class="form-control" id="rk" name="rk" placeholder="Resiko Kehilangan" required>
                </div>
                <div class="form-group">
                    <label>Jasa Koperasi</label>
                    <input type="text" class="form-control" id="jasa" name="jasa" placeholder="Biaya Jasa Koperasi" required>
                </div>
                <div class="form-group">
                    <label>Simpanan</label>
                    <input type="text" class="form-control" id="simpanan" name="simpanan" placeholder="Biaya Simpanan Koperasi" required>
                </div>
                <div class="form-group">
                    <label>Tempo</label>
                    <input type="text" class="form-control" id="tempo" name="tempo" placeholder="Lama angsuran" required>
                    <small>*Angka 1 untuk sesuai kontrak</small>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="ubahAturanPinjaman" name="ubahAturanPinjaman" class="btn btn-success">Ubah</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<!-- Form Ajax Kategori Juri -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script type="text/javascript">
    $(document).on("click", "#detail_aturan", function() {
        var aturan_id = $(this).data('aturan_id');
        var produk_id = $(this).data('produk_id');
        var administrasi = $(this).data('administrasi');
        var rk = $(this).data('rk');
        var jasa = $(this).data('jasa');
        var simpanan = $(this).data('simpanan');
        var tempo = $(this).data('tempo');
        $(".modal-body#detail_body #aturan_id").val(aturan_id);
        $(".modal-body#detail_body #produk_id").val(produk_id);
        $(".modal-body#detail_body #administrasi").val(administrasi);
        $(".modal-body#detail_body #rk").val(rk);
        $(".modal-body#detail_body #jasa").val(jasa);
        $(".modal-body#detail_body #simpanan").val(simpanan);
        $(".modal-body#detail_body #tempo").val(tempo);
    })
</script>