	   $("#piutang").flexigrid({
                url : 'response.php',
                dataType : 'json',
				        method: 'POST',
                colModel :
								[
									{display:'<b class="w3-small">NO</b>', name:'nomor', width:80, align:'center'},
									{display:'<b class="w3-small">SEMESTER</b>', name:'kode', width:200, sortable:true, align:'center'},
									{display:'<b class="w3-small">NAMA</b>', name:'nama', width:200, sortable:true, align:'center'},
									{display:'<b class="w3-small">OPTION</b>', name:'tomb', width:300, sortable:true, align:'left'}
								],
								buttons :
								[
									{name:'TAMBAH KPI', bclass:'w3-button w3-blue w3-card-4', onpress:tambahkan},
                  {separator:true}
                ],
                searchitems :
								[
                  {display:'KODE', name:'kode'}
									//{display:'DEBITUR', name:'deb', isdefault:false},
                  //{display:'PEKERJAAN', name:'job', isdefault:false},
									//{display:'PRIHAL', name:'pri', isdefault : false}
               	],
                sortname:"kode",
                sortorder:"asc",
                usepager:true,
                title:'<b>LIST KPI</b>',
                useRp:true,
                rp:50,
                showTableToggleBtn:true,
								//height:'600',
								striped:true,
                width:'auto'
            });

function editkan(x){
	document.getElementById('id01').style.display='block';
	document.getElementById('rangka').src="formeditkpi.php?kode="+x;
}

function hapuskan(x){
	var r = confirm("APAKAH DATA KPI DENGAN KODE : "+x+" AKAN DIHAPUS ?...");
	if(r == true){
		document.getElementById('rangka').src="hapuskan.php?id="+x;
	}
}

function tambahkan(){
	document.getElementById('id01').style.display='block';
	document.getElementById('rangka').src="tambahdatakpi.php";
}

function keluar(){
	document.getElementById('id01').style.display='none';
	document.getElementById('rangka').src="hapusrec.php";
}

function kembalikan(){
	$("#piutang").flexReload();
}

function tambah(){
	document.getElementById('ipack').src="tes.php";
}

function uploadkan(){
	document.getElementById('formdoc').submit();
	document.getElementById('keluar').click();
						  //alert('uploadkan');
}
