<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 API WA
                </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_whatsapp">
                <?php echo form_open_multipart('owner/database/sistem/whatsapp/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>Endpoint URL</label>
                    <input type="text" class="form-control" id="endpoint_url" name="endpoint_url"
                        placeholder="Masukkan Endpoint URL" required>
                    <input type="text" class="form-control" hidden id="wa_id" name="wa_id"
                        placeholder="Masukkan Nama Desa" required>
                </div>
                <div class="form-group">
                    <label>Api Key</label>
                    <input type="text" class="form-control" id="api_key" name="api_key" placeholder="Masukkan Api Key"
                        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>No Uji Coba</label>
                    <input type="text" class="form-control" id="uji_coba" name="uji_coba"
                        placeholder="Masukkan No Uji Coba" required>
                </div>
                <div class="form-group">
                    <label>Status API</label>
                    <select class="form-control" id="status" name="status" required>
                        <option value="AKTIF">AKTIF</option>
                        <option value="PASIF">PASIF</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Format WA</label>
                    <select class="form-control" id="format_wa" name="format_wa" required>
                        <option value="TEXT">TEXT</option>
                        <option value="MEDIA">MEDIA</option>
                        <option value="ANY">ANY</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Keterangan API</label>
                    <textarea type="text" cols="30" rows="5" class="form-control" id="ket_wa" name="ket_wa"
                        placeholder="Keterangan Keterangan API WA" 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 wa_id = $(this).data('wa_id');
    var endpoint_url = $(this).data('endpoint_url');
    var api_key = $(this).data('api_key');
    var status = $(this).data('status');
    var no_hp = $(this).data('no_hp');
    var uji_coba = $(this).data('uji_coba');
    var format_wa = $(this).data('format_wa');
    var ket_wa = $(this).data('ket_wa');
    $(".modal-body#detail_body_whatsapp #wa_id").val(wa_id);
    $(".modal-body#detail_body_whatsapp #endpoint_url").val(endpoint_url);
    $(".modal-body#detail_body_whatsapp #api_key").val(api_key);
    $(".modal-body#detail_body_whatsapp #status").val(status);
    $(".modal-body#detail_body_whatsapp #no_hp").val(no_hp);
    $(".modal-body#detail_body_whatsapp #uji_coba").val(uji_coba);
    $(".modal-body#detail_body_whatsapp #format_wa").val(format_wa);
    $(".modal-body#detail_body_whatsapp #ket_wa").val(ket_wa);
})
</script>