<?
$kelas = "w3-blue-gray w3-small";
?>
<script>
	   $("#piutang").flexigrid({
                url : 'response.php',
                dataType : 'json',
				        method: 'POST',
                colModel :
								[
									{display:'NO', name:'nomor', width:80, align:'center', class:'<?=$kelas?>'},
									//{display:'ID', name:'id', width:200, sortable:true, align:'center'},
									{display:'KPI', name:'kpi',width:100,sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'KODE', name:'kode', width:100, sortable:true, align:'center', class:'<?=$kelas?>'},
									{display:'POLARISASI', name:'pola', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'DESCRIPTION', name:'des', width:350, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'SATUAN', name:'sat', width:80, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'FOKUS', name:'fok', width:200, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'AREA', name:'area', width:200, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'KODE JABATAN', name:'kodejab', width:200, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'OPTION', name:'tomb', width:300, sortable:true, align:'left', class:'<?=$kelas?>'}
								],
								buttons :
								[
									//{name:'TAMBAH DATA KPI BARU', bclass:'w3-button w3-blue w3-card-4', onpress:tambahkan},
                  {separator:true}
                ],
                searchitems :
								[
                  {display:'KPI', name:'kpi'},
									{display:'KODE', name:'kode', isdefault:false},
                  {display:'POLARISASI', name:'pola', isdefault:false},
									{display:'DESCRIPTION', name:'des', isdefault : false},
									{display:'SATUAN', name:'sat', isdefault : false},
									{display:'FOKUS', name:'fok', isdefault : false},
									{display:'KODE JABATAN', name:'kodejab', isdefault : false},
									{display:'AREA', name:'area', isdefault : false}
               	],
                sortname:"id",
                sortorder:"asc",
                usepager:true,
                title:'<b>DATA KPI',
                useRp:true,
                rp:100,
                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 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";
	//alert();
}

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>
