<div class="modal fade" id="tolak_detail" tabindex="-1" role="dialog" aria-labelledby="tolak_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="tolak_detailTitle">
                    Hasil Survey Pinjaman!
                </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_kontrak">
                <?php echo form_open_multipart('marketing/kegiatan/pengajuan_pinjaman/crud'); ?>
                <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>" style="display: none">
                <center>
                    <h3>Apakah yakin akan menolak pengajuan pinjaman?
                    </h3>
                    <input type="text" hidden class="form-control" id="kontrak_id" name="kontrak_id" required>
                </center>
                <div class="form-group">
                    <center>
                        <label>Alasan Penolakan</label>
                    </center>
                    <textarea class="form-control" name="alasan_tolak" id="alasan_tolak" cols="30" rows="2" placeholder="Alasan Penolakan Pengajuan Pinjaman" required></textarea>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="tolakPermintaanPinjaman" name="tolakPermintaanPinjaman" class="btn btn-danger">Tolak</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_penolakan", function() {
        var kontrak_id = $(this).data('kontrak_id');
        $(".modal-body#detail_body_kontrak #kontrak_id").val(kontrak_id);
    })
</script>