jQuery(function ($) { cekReqInfoTrack = function () { $("#tagformreqinfotrack").validate({ rules: { email: { required: true, email: true, }, nik: { required: true, }, }, messages: { email: { required: "We need your email address to contact you", email: "Your email address must be in the format of name@domain.com", }, nohp: { required: "We need your ID to track your information request", }, }, submitHandler: function (form) { utilsJS.showLoading(); let mappingData = {}; Object.keys(form).forEach((i) => { mappingData = { ...mappingData, [form[i].name]: form[i].value, }; }); $("#renTrackInfo").hide(500); $.ajax({ type: "POST", url: "https://ppid.sumbawabaratkab.go.id/en/reqinfotrack", data: mappingData, headers: { "X-CSRF-Token": document.getElementsByName("_token")[0].value, }, success: function (res) { $("#renTrackInfo").html(renderFormTrackInfo(res.data)); $("#renTrackInfo").show(500); utilsJS.closeLoading(); }, error: function () { utilsJS.closeModal(); utilsJS.showModal("Information", "Something went wrong", { showFooter: false, }); utilsJS.closeLoading(); }, }); }, }); return false; }; renderFormTrackInfo = function (datas) { let content = ""; if (!utilsJS.isNullOrEmpty(datas)) { let contentTable = ""; if (Array.isArray(datas)) { datas.forEach((data, i) => { let renReqInfoCodeLink = !utilsJS.isNullOrEmpty( data.req_info_code_link ) ? ` Lihat ` : ""; contentTable += `
| # | Nama Pemohon | Status | Skpd Tujuan | Jenis Info | Kategori Pemohon | Tanggal Upload | Kode Permintaan | Detail Info | Keterangan |
|---|