<?
$kelas = "w3-blue-gray w3-small";
?>
<script>
	   $("#selaras").flexigrid({
                url : 'response.php',
                dataType : 'json',
				        method: 'POST',
                colModel :
								[
									{display:'NO', name:'nomor', width:80, align:'center', class:'<?=$kelas?>'},
									{display:'OPTION', name:'tomb', width:100, align:'center', class:'w3-light-gray w3-small'},
									{display:'ID', name:'idkar',width:100,sortable:true, class:'<?=$kelas?>'},
									{display:'NAMA', name:'nama',width:100,sortable:true, class:'<?=$kelas?>'},
									{display:'NIP', name:'nip', width:150, sortable:true, class:'<?=$kelas?>'},
									{display:'LOKASI', name:'lok', width:150, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'JABATAN', name:'jab', width:300, sortable:true, align:'left', class:'<?=$kelas?>' },
									{display:'UNIT', name:'unit', width:150, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'SEMESTER', name:'smt', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'KUANTITAS', name:'hasilkuan', width:100, sortable:true, align:'center', class:'<?=$kelas?>'},
									{display:'KUALITAS', name:'hasilkua', width:100, sortable:true, align:'center', class:'<?=$kelas?>'},
									{display:'NKO', name:'nko', width:100, sortable:true, align:'center', class:'<?=$kelas?>'},
									{display:'NILAI', name:'nilai', width:100, sortable:true, align:'center', class:'<?=$kelas?>'},
									{display:'KRITERIA', name:'krite', width:100, sortable:true, align:'center', class:'<?=$kelas?>'}
								],
								buttons :
								[
                  {separator:true}
                ],
                searchitems :
								[
                  {display:'ID', name:'idkar'},
									{display:'NAMA', name:'nama', isdefault:false},
                  {display:'LOKASI', name:'lok', isdefault:false},
									{display:'UNIT', name:'unit', isdefault:false},
									{display:'JABATAN', name:'jab', isdefault : false},
									{display:'SEMESTER', name:'smt', isdefault : false},
									{display:'HASIL KUANTITAS', name:'hasilkuan', isdefault : false},
									{display:'HASIL KUALITAS', name:'hasilkua', isdefault : false},
									{display:'NKO', name:'nko', isdefault : false},
									{display:'NILAI', name:'nilai', isdefault : false},
									{display:'KRITERIA', name:'krite', isdefault : false}
               	],
                sortname:"idkar",
                sortorder:"asc",
                usepager:true,
                title:'DATA PENYELARASAN',
                useRp:true,
                rp:500,
                showTableToggleBtn:true,
								//height:'600',
								striped:true,
                width:'auto'
            });


function editkan(x){
  //document.getElementById('id01').style.display='block';
	document.getElementById('viewsel').style='display:none';
	document.getElementById('viewdetail').style='display:';
	//document.getElementById('rangka').src="formeditkpi.php?id="+x;
	var xhttp = new XMLHttpRequest();
  xhttp.onreadystatechange = function() {
    if (this.readyState == 4 && this.status == 200) {
      document.getElementById("viewdetail").innerHTML =
      this.responseText;
    }
  };
  xhttp.open("GET", "formkpiakhir.php?idkar="+x, true);
  xhttp.send();
}

function batal(){
	document.getElementById('viewsel').style='display:';
	document.getElementById("viewdetail").style="display:none";
}

function editpenye(){
	po = document.getElementById('idkarperorang').value;
	nko = document.getElementById('nko').value;
	nilai = document.getElementById('nilai').value;
  alert(po+nko+nilai);
	document.getElementById('proses').src="editpenye.php?idkarperorang="+po+"&nko="+nko+"&nilai="+nilai;
}

function stopakses(a,b,c){
	po = document.getElementById('idkarperorang').value;
	var r = confirm("KPI ATAS NAMA "+a+"\nNIP "+b+"\nSEMESTER "+c+"\nAKAN DI TUTUP UNTUK MEGAKSESNYA ?...");
	if(r == true){
		document.getElementById('proses').src="kuncikpi.php?idkar="+po;
	}

}

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(){
  $("#selaras").flexReload();
}
function kembalihabisedit(){
	batal();
	kembalikan();
}

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

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