<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 Login
                </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_login">
                <?php echo form_open_multipart('owner/database/sistem/login/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>Role Level</label>
                    <select class="form-control" id="role_id" name="role_id" required>
                        <?php
                        foreach ($role_level as $Role_level) : ?>
                        <option value="<?= $Role_level->id ?>"><?= $Role_level->role_level ?></option>
                        <?php endforeach;
                        ?>
                    </select>
                </div>
                <div class="form-group">
                    <label>Email</label>
                    <input type="text" class="form-control" id="email" name="email" placeholder="Masukkan Email"
                        required>
                    <input type="text" class="form-control" hidden id="login_id" name="login_id"
                        placeholder="Masukkan Nama Desa" required>
                </div>
                <div class="form-group">
                    <label>Username</label>
                    <input type="text" class="form-control" id="username" name="username"
                        placeholder="Masukkan Username" required>
                </div>
                <div class="form-group">
                    <label>No HP</label>
                    <input type="text" class="form-control" id="no_hp" name="no_hp" placeholder="Masukkan No HP"
                        required>
                </div>
                <div class="form-group">
                    <label>Nama Panggilan</label>
                    <input type="text" class="form-control" id="nm_panggilan" name="nm_panggilan"
                        placeholder="Masukkan Nama Panggilan" required>
                </div>
                <div class="form-group">
                    <label>Status Akun</label>
                    <select class="form-control" id="status_akun" name="status_akun" required>
                        <option value="AKTIF">AKTIF</option>
                        <option value="BLOKIR">BLOKIR</option>
                        <option value="PASIF">PASIF</option>
                        <option value="HAPUS">HAPUS</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Gambar Profile</label>
                    <textarea type="text" cols="30" rows="5" class="form-control" id="gambar_profil"
                        name="gambar_profil" placeholder="Masukkan Link Gambar Profile" 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="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 login_id = $(this).data('login_id');
    var role_id = $(this).data('role_id');
    var email = $(this).data('email');
    var username = $(this).data('username');
    var no_hp = $(this).data('no_hp');
    var nm_panggilan = $(this).data('nm_panggilan');
    var status_akun = $(this).data('status_akun');
    var gambar_profil = $(this).data('gambar_profil');
    $(".modal-body#detail_body_login #login_id").val(login_id);
    $(".modal-body#detail_body_login #role_id").val(role_id);
    $(".modal-body#detail_body_login #email").val(email);
    $(".modal-body#detail_body_login #username").val(username);
    $(".modal-body#detail_body_login #no_hp").val(no_hp);
    $(".modal-body#detail_body_login #nm_panggilan").val(nm_panggilan);
    $(".modal-body#detail_body_login #status_akun").val(status_akun);
    $(".modal-body#detail_body_login #gambar_profil").val(gambar_profil);
})
</script>