<div class="modal fade" id="tempo_detail" tabindex="-1" role="dialog" aria-labelledby="tempo_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="tempo_detailTitle">
                    Ubah Data Angsuran
                </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="body_tempo">
                <?php echo form_open_multipart('manager/koperasi/set_libur/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>Tanggal Tempo</label>
                    <input type="date" class="form-control" min="<?= date('Y-m-d') ?>" id="tgl_tempo" name="tgl_tempo"
                        placeholder="Tanggal Tempo" required>
                    <input type="text" class="form-control" hidden id="angs_id" name="angs_id" placeholder="Angsuran ID"
                        required>
                    <input type="text" class="form-control" hidden id="kontrak_id" name="kontrak_id"
                        placeholder="Angsuran ID" required>
                </div>
                <div class="form-group">
                    <label>Jenis Kegiatan</label>
                    <select class="form-control" id="jenis_kegiatan" name="jenis_kegiatan" required>
                        <option value="6">Libur Angsuran</option>
                        <option value="1">Mengubah Tanggal Tempo</option>
                        <option value="2">Status Lunas Lancar</option>
                        <option value="3">Status Lunas Macet</option>
                        <option value="4">Status Macet</option>
                        <option value="5">Menghapus Angsuran</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="simpanDataAngsuran" name="simpanDataAngsuran"
                    class="btn btn-success">Simpan</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_tempo", function() {
        var kontrak_id = $(this).data('kontrak_id');
        var angs_id = $(this).data('angs_id');
        var tgl_tempo = $(this).data('tgl_tempo');
        $(".modal-body#body_tempo #kontrak_id").val(kontrak_id);
        $(".modal-body#body_tempo #angs_id").val(angs_id);
        $(".modal-body#body_tempo #tgl_tempo").val(tgl_tempo);
    })
</script>