<?
$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:'OPTION', name:'tomb', width:150, align:'center', class:'w3-light-gray w3-small'},
									{display:'NIP', name:'nip',width:100,sortable:true, class:'<?=$kelas?>'},
									{display:'NAMA', name:'nama', width:200, sortable:true, class:'<?=$kelas?>'},
									{display:'UNIT', name:'unit', width:200, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'JABATAN', name:'jab', width:300, sortable:true, align:'left', class:'<?=$kelas?>' },
									{display:'LOKASI', name:'lokasi', width:150, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'KODE JAB', name:'kodejab', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
									{display:'ATASAN', name:'bos', width:100, sortable:true, align:'left', class:'<?=$kelas?>'},
								],
								buttons :
								[
                  {separator:true}
                ],
                searchitems :
								[
                  {display:'NIP', name:'nip'},
									{display:'NAMA', name:'nama', isdefault:false},
                  {display:'UNIT', name:'unit', isdefault:false},
									{display:'JABATAN', name:'jab', isdefault : false},
									{display:'LOKASI', name:'lokasi', isdefault : false},
									{display:'KODE JABATAN', name:'kodejab', isdefault : false},
									{display:'ATASAN', name:'bos', isdefault : false},
               	],
                sortname:"id",
                sortorder:"asc",
                usepager:true,
                title:'DATA KARYAWAN',
                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="formeditkar.php?id="+x;
}

function hapuskan(x,n){
	var r = confirm("APAKAH DATA KARYAWAN DENGAN NIP : "+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="tambahdatakar.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>
