$(document).ready(function() { tampil_data_mhs(); $('#table_mbkm_outbound').DataTable(); function tampil_data_mhs() { var user = $('#user').text(); var sub = $('#sub').text(); // console.log(user); // console.log(sub); $.ajax({ type: 'ajax', url: window.location.origin + '/mbkm/staffmbkmoutbound/get_mahasiswa_outbound/', async: false, dataType: 'json', success: function (data) { console.log(data); var html = ''; for (var i = 0; i < data.length; i++) { html += '' + '' + (i + 1) + '' + '' + data[i].nim + '' + '' + data[i].universitas_tujuan + '' + '' + data[i].nama_kegiatan + '' + '' + data[i].sks + '' + // '' + data[i].bukti + '' + // '' + '">ok' + '' + '' + ''+ data[i].bukti +'' + '' + // '' + // '' + // '' + ''; } $('#show_data').html(html); } }); } $('#show_data').on('click', '.tombol-input-hasil', function () { var id = $(this).attr('data-id'); // console.log(nim); $.ajax({ type: 'GET', url: window.location.origin + '/mbkm/staffmbkmoutbound/get_mahasiswa_outboundbyNIM/', dataType: 'json', data: { id: id, }, success: function (data) { // console.log(data); $.each(data, function() { var base_url = window.location.origin; $('#modal-input-mbkm').modal('show'); $('.form-input-hasil').attr('action', base_url + '/mbkm/staffmbkmoutbound/edit_nilai/' + data.id); $('#nama_kegiatan').val(data.nama_kegiatan); $('#nim').val(data.nim); $('#sks').val(data.sks); }); } }); return false; }); $('#create-user').on('click', function() { $('#modal-input').modal('show'); $('.form-input').attr('action', ''); $('.form-input').trigger("reset"); }); }); var coll = document.getElementsByClassName("collapsible"); var i; for (i = 0; i < coll.length; i++) { coll[i].addEventListener("click", function() { this.classList.toggle("activee"); var content = this.nextElementSibling; if (content.style.maxHeight){ content.style.maxHeight = null; } else { content.style.maxHeight = content.scrollHeight + "px"; } }); }