<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 Sistem Alamat
                </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_rolelevel">
                <?php echo form_open_multipart('owner/database/sistem/alamat/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>Nama Desa</label>
                    <input type="text" class="form-control" id="nm_desa" name="nm_desa" placeholder="Masukkan Nama Desa"
                        required>
                    <input type="text" class="form-control" hidden id="alamat_id" name="alamat_id"
                        placeholder="Masukkan Nama Desa" required>
                </div>
                <div class="form-group">
                    <label>Nama Kecamatan</label>
                    <input type="text" class="form-control" id="nm_kecamatan" name="nm_kecamatan"
                        placeholder="Masukkan Nama Kecamatan" required>
                </div>
                <div class="form-group">
                    <label>Nama Kabupaten / Kota</label>
                    <input type="text" class="form-control" id="kot_kab" name="kot_kab"
                        placeholder="Masukkan Nama Kabupaten / Kota" required>
                </div>
                <div class="form-group">
                    <label>Nama Provinsi</label>
                    <input type="text" class="form-control" id="prov" name="prov" placeholder="Masukkan Nama Provinsi"
                        required>
                </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">Simpan</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 alamat_id = $(this).data('alamat_id');
    var nm_desa = $(this).data('nm_desa');
    var nm_kecamatan = $(this).data('nm_kecamatan');
    var kot_kab = $(this).data('kot_kab');
    var prov = $(this).data('prov');
    $(".modal-body#detail_body_rolelevel #alamat_id").val(alamat_id);
    $(".modal-body#detail_body_rolelevel #nm_desa").val(nm_desa);
    $(".modal-body#detail_body_rolelevel #nm_kecamatan").val(nm_kecamatan);
    $(".modal-body#detail_body_rolelevel #kot_kab").val(kot_kab);
    $(".modal-body#detail_body_rolelevel #prov").val(prov);
})
</script>