<?
$kelas = "w3-blue-gray w3-small";
?>
<script>
	   $("#datakpi").flexigrid({
                url : 'response.php',
                dataType : 'json',
				        method: 'POST',
                colModel :
								[
									{display:'NO', name:'nomor', width:80, align:'center', class:'<?=$kelas?>'},
									{display:'OPTION', name:'tomb', width:150, align:'center', class:'<?=$kelas?>'},
									{display:'KODE', name:'kode',width:100,sortable:true, class:'<?=$kelas?>'},
									{display:'KPI', name:'kpi', width:200, sortable:true, class:'<?=$kelas?>'},
									{display:'POLA', name:'pola', width:200, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'DESCRIPTION', name:'des', width:300, sortable:true, align:'left', class:'<?=$kelas?>' },
									{display:'SATUAN', name:'sat', width:150, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'FOKUS', name:'fok', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'AREA', name:'area', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'KODE JABATAN', name:'kodejab', width:100, sortable:true, align:'left', class:'<?=$kelas?>'}

								],
								buttons :
								[
                  {separator:true}
                ],
                searchitems :
								[
                  {display:'KODE', name:'kode'},
									{display:'KPI', name:'kpi', isdefault:false},
                  {display:'POLA', name:'pola', isdefault:false},
									{display:'DESCRIPTION', name:'des', isdefault : false},
									{display:'SATUAN', name:'sat', isdefault : false},
									{display:'FOKUS', name:'fok', isdefault : false},
									{display:'AREA', name:'area', isdefault : false},
									{display:'KODE JABATAN', name:'kodejab', isdefault : false},
               	],
                sortname:"id",
                sortorder:"asc",
                usepager:true,
                title:'DATA KPI',
                useRp:true,
                rp:500,
                showTableToggleBtn:true,
								//height:'600',
								striped:true,
                width:'auto'
            });


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

function cetak(){
	//document.getElementById('pil1').selected.value='KODE';
	kol1 = document.getElementById('kol1').value;
	kol2 = document.getElementById('kol2').value;
	isi1 = document.getElementById('isi1').value;
	isi2 = document.getElementById('isi2').value;
	rangkai = "kol1="+kol1+"&kol2="+kol2+"&isi1="+isi1+"&isi2="+isi2;
	//location.href="tess.php?"+rangkai+"target='_blank'";
	window.open('tess.php?'+rangkai, '_blank');
}

function hapuskan(x,n){
	var r = confirm("APAKAH DATA KPI DENGAN KODE : "+n+" 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');
}
</script>
