$(document).ready(function () { tampil_data_pengajuan(); $('#table_matkul').DataTable(); function tampil_data_pengajuan() { // var user = $('#asal_univ').html(); // var asal_univ = user.split('-'); console.log(asal_univ[1]); $.ajax({ type: 'ajax', url: window.location.origin + '/mbkm/staffmbkm/get_matkulpengajuan/', async: false, dataType: 'json', success: function (data) { console.log(data); var html = ''; var i; var p=0; for (i = 0; i < data.length; i++) { //pengecekan berdasar idmhs const string = data[i].kdprodi; const arr = string.split('-'); const split_idmhs = data[i].idmhs.split('-'); if (split_idmhs[0] == 'ext') { html += '' + '' + (p + 1) + '' + '' + split_idmhs[1] + '' + '' + split_idmhs[2] + '' + '' + data[i].kdmk + '' + '' + data[i].nmmkind + '' + '' + arr[1] + '' + '' + data[i].status + '' + '' + data[i].waktu_pengajuan + '' + '' + split_idmhs[3] + '' + ''; p++; } } $('#show_data').html(html); } }); } });