dec($task);}} switch($task) { case "default": $this->fn_default_auth(); break; case $task: $task="fn_".$task; if(method_exists($this,$task)){$this->$task();} break; default: $this->fn_default_auth(); break; } } public function fn_default_auth() { echo $this->FN_CREATEHEADER(); // echo ""; echo ""; echo $this->FN_CLOSEHEADER(); echo $this->FN_CREATEBODY("e8f1ff"); echo "
"; echo $this->FN_CREATEFOOTER(); } public function fn_updatemenuid() { $id=$_REQUEST['idnik']; $menuid=$_REQUEST['menuid'];//echo $menutype;return true; $tipemenu=$_REQUEST['tipemenu'];//echo $menutype;return true; //return false; $qry="update ".DB_APORTIL.".tbl_employee_accessibility set ".$tipemenu."menuid='$menuid',uby='".$_SESSION['nik']."',udt=now() where id='$id'"; if($this->executequery($qry)) { echo 'ok|'; //$msg="Menu baru ".strtoupper("$nmuser")." sudah berhasil ditambahkan
"; //$msg.="Klik ".$this->CREATE_LINK($this->fn_url_home(),"disini","javascript:void(0)","_self","Penambahan Menu Baru"); //$msg.=" untuk Penambahan Menu Baru. TERIMA KASIH"; //echo $this->SHOWMESSAGE($msg); }else{echo "failed|".$this->getErrorQuery();} } public function fn_loadmenu() { $id=$_REQUEST["idnik"]; $tipemenu=$_REQUEST["tipemenu"]; $idgroupproject=$_REQUEST["idgroupproject"]; $sp=$this->fn_get_fieldsvalues("menuidgroupproject,groupuser","select menuidgroupproject,groupuser from ".DB_APORTIL.".tbl_employee_accessibility where id='$id'"); //echo "select menuidgroupproject,groupuser from ".DB_APORTIL.".tbl_employee_accessibility where nik='$nik'";return false; $menuidgroupproject=$sp[0];$groupuser=$sp[1]; //include XML Header (as response will be in xml format) header("Content-type: text/xml"); //encoding may be different in your case echo(''); //start output of data echo ""; //if(!$menuidgroupproject){$menuidgroupproject=0;} if(!$menuidgroupproject){$menuidgroupproject=0;} $swhere="and t.id_menu_groupproject in($menuidgroupproject)"; if($idgroupproject){$swhere="and t.id_menu_groupproject='$idgroupproject'";} if($nik=='9999'||$nik=='9292'||$groupuser=='SU'&&!$idgroupproject){$swhere="";} $qry="select t.id,t.menutype,t.menutext,t.menudesc,0 ischecked,m.groupname from ".DB_APORTIL.".tbl_".$tipemenu."menu t inner join ".DB_APORTIL.".tbl_menu_groupproject m on m.id=t.id_menu_groupproject where t.isdeleted=0 and t.menuactivated=1 $swhere order by t.id asc limit ".TBL_PAGE_LIMIT; //echo $qry; $rs=$this->selectquery($qry); if($rs) { $i=1; while($row=$this->data_row_array($rs)) { //create xml tag for grid's row echo (""); print(""); print(""); print(""); print(""); print(""); print(""); echo (""); $i+=1; } } else { //error occurs echo mysql_errno().": ".mysql_error()." at ".__LINE__." line in ".__FILE__." file
"; } echo "
"; } public function fn_getnik() { $nik=$_REQUEST["nik"]; $getnik=$this->fn_get_fieldvalue("nik","select nik from ".DB_APORTIL.".tbl_employee_accessibility where nik='$nik' and isdeleted=0"); echo $getnik; } public function fn_getmenuid() { $id=$_REQUEST["idnik"]; $tipemenu=$_REQUEST["tipemenu"]; $menuid=$this->fn_get_fieldvalue($tipemenu."menuid","select ".$tipemenu."menuid from ".DB_APORTIL.".tbl_employee_accessibility where id='$id'"); echo $menuid; } } ?>