Struktur ulang: memindahkan sistem ke folder public untuk Nginx
This commit is contained in:
@@ -0,0 +1,45 @@
|
||||
function search(){
|
||||
$("#loading").show(); // Tampilkan loadingnya
|
||||
|
||||
$.ajax({
|
||||
type: "POST", // Method pengiriman data bisa dengan GET atau POST
|
||||
url: baseurl + "formulir/search", // Isi dengan url/path file php yang dituju
|
||||
data: {no_pendaftaran : $("#no_pendaftaran").val()}, // data yang akan dikirim ke file proses
|
||||
dataType: "json",
|
||||
beforeSend: function(e) {
|
||||
if(e && e.overrideMimeType) {
|
||||
e.overrideMimeType("application/json;charset=UTF-8");
|
||||
}
|
||||
},
|
||||
success: function(response){ // Ketika proses pengiriman berhasil
|
||||
$("#loading").hide(); // Sembunyikan loadingnya
|
||||
|
||||
if(response.status == "success"){ // Jika isi dari array status adalah success
|
||||
$("#nama_lengkap").val(response.nama_lengkap); // set textbox
|
||||
$("#sekolah_asal").val(response.sekolah_asal); // set textbox
|
||||
$("#kd_kompetensi").val(response.kd_kompetensi); // set textbox
|
||||
$("#kompetensi").val(response.kompetensi); // set textbox
|
||||
|
||||
}else{ // Jika isi dari array status adalah failed
|
||||
alert("No. Pendaftaran Tidak Ditemukan / Sudah Menginput Data, Jika Ada Perubahan Silahkan ke Menu Edit");
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) { // Ketika ada error
|
||||
alert(xhr.responseText);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$(document).ready(function(){
|
||||
$("#loading").hide(); // Sembunyikan loadingnya
|
||||
|
||||
$("#btn-search").click(function(){ // Ketika user mengklik tombol Cari
|
||||
search(); // Panggil function search
|
||||
});
|
||||
|
||||
$("#no_pendaftaran").keyup(function(){ // Ketika user menekan tombol di keyboard
|
||||
if(event.keyCode == 13){ // Jika user menekan tombol ENTER
|
||||
search(); // Panggil function search
|
||||
}
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user