MSG=new LIBMSG(); //if(!isset($_SESSION['nik'])){$this->mosRedirect("D.H.T.M.L.X");} $spip=explode(".",$_SERVER["HTTP_HOST"]); if(count($spip)>0) { //if($spip[0]=='172'||$spip[0]=='10'){header("location: http://portal.telkomcel.tl");die;} } //echo $this->get_client_ip(); //if($spip[0]=='172'){header("location: http://portal.telkomcel.tl");die;} } //echo get_client_ip(); public function get_client_ip() { $ipaddress = ''; if (getenv('HTTP_CLIENT_IP')) $ipaddress = getenv('HTTP_CLIENT_IP'); else if(getenv('HTTP_X_FORWARDED_FOR')) $ipaddress = getenv('HTTP_X_FORWARDED_FOR'); else if(getenv('HTTP_X_FORWARDED')) $ipaddress = getenv('HTTP_X_FORWARDED'); else if(getenv('HTTP_FORWARDED_FOR')) $ipaddress = getenv('HTTP_FORWARDED_FOR'); else if(getenv('HTTP_FORWARDED')) $ipaddress = getenv('HTTP_FORWARDED'); else if(getenv('REMOTE_ADDR')) $ipaddress = getenv('REMOTE_ADDR'); else $ipaddress = 'UNKNOWN'; return $ipaddress; } public function initjq() // used for pop window { ?> ".PROJECTID." "; } public function FN_GETMONTHNAME($i) { $arrmonth=array("1"=>"January","2"=>"February","3"=>"March","4"=>"April","5"=>"May","6"=>"June","7"=>"July", "8"=>"August","9"=>"September","10"=>"October","11"=>"November","12"=>"December"); return $arrmonth[$i]; } public function FN_CLOSEHEADER() { echo ""; } public function FN_CREATEBODY($bgcolor=null) { if($bgcolor){$bgcolor="background-color:#$bgcolor;";} $bgcolor="white"; //if(!$bgcolor){$bgcolor="background-color:#e8f1ff;";} echo "
HANDLE_VIEWSOURCE(97890)."id=\"fmpreview\" name=\"fmpreview\" target=\"_blank\" ".$this->HANDLE_VIEWSOURCE(12890)."method=\"POST\" ".$this->HANDLE_VIEWSOURCE(11890)."action=\"?".$this->dec("2304f0e32dd0e041231c536c971ebaab")."\"> HANDLE_VIEWSOURCE(19890).">"; } public function FN_CREATEFOOTER() { echo $this->initjq(); echo " "; } public function URLHOME() { return "$('#uri').val('ajax=0&sec=1&option=".$this->enc("obj_home")."&obj=&task=".$this->enc("layoutgraph")."');$('#fm').prop('target','_self');$('#fm').submit();"; } public function SHOWMESSAGE($msginfo) { echo "

$msginfo

"; } public function SHOWMESSAGEWAIT($msginfo,$counttmr,$int,$url=null,$withalertformat=null) { $jvtmr=""; echo $jvtmr; $msginfo.=" ...$counttmr"; if($withalertformat){echo "

$msginfo

";} else {echo $msginfo;} } public function SHOWMESSAGETOVARIABLE($msginfo) { return "

$msginfo

"; } public function initial_css_style() // used for pop window { echo " "; } public function SET_PAGE_TITLE($titlepage) { echo "
$titlepage
"; } public function SIDEBAR() { $x=" "; return $x; } //public function public function GET_PATH() { $uripath=$_SERVER["REQUEST_URI"] ; $spuripath=explode("/",$uripath); $realpath=""; for($i=0;$i"; $i=0; foreach($arruri as $lnk=>$lnkvalue) { if($lnkvalue=='disabled'){echo "
  • ".$lnk."
  • ";} else { $title="";$onClick="";$prop=""; $spuri=explode("|",$lnkvalue); $title=$spuri[2]; if($spuri[0]=='ajax') { $onClick="onClick=\"".$spuri[1]."\""; $lnkvalue="javascript:void(0)"; } if($spuri[0]=='ahref') { $onClick=""; $lnkvalue=$spuri[1]; $prop=$spuri[3]; } //if(isset($spuri)) //if(is_array($arrurititle)){$title=$arrurititle[$i][1];}echo $title; $span=""; if($i==count($arruri)-1){$span="";} echo "
  • $lnk $span
  • "; } $i+=1; } echo ""; } public function LINK_BACKTOPAGE($ajaxurl='',$url='#',$width='0px') { return ""; } public function CREATE_IMAGE($img,$width=null,$height=null,$prop=null,$url=null) { if($width){$pagewidth="width=\"".$width."px\"";} if($height){$pageheight="height=\"".$height."px\"";} $path=PATH_THEME; if($url){$path=$url;} return ""; } public function CREATE_LINK_IMG_HOVER($url,$event,$img,$imghover,$title=null) { $sp=explode(".",$img); if(count($sp)<=1){$img.=".png";} //echo $sp[1]; return " "; } //public function CREATE_LINK($ajaxurl='',$linktext='',$url='javascript:void(0)',$target='_self',$title='',$color='',$properties='') // { // if($ajaxurl){$ajaxurl.=";return false;";} // if(!$color){$color='blue';} // return "$linktext"; // } public function CREATE_LINK($ajaxurl='',$linktext='',$url='javascript:void(0)',$target='_self',$title='',$color='',$style='',$properties='') { if($ajaxurl){$ajaxurl.=";return false;";} if(!$color){$color='blue';} return "$linktext"; } public function MULTIPLE_LINK($linkarray) { $linkvalue="";$separator=""; //$h=array("r"=>"1","b"=>"2"); foreach($linkarray as $lnk=>$lnkvalue) { if($linkvalue!==""){$separator="  ".$this->CREATE_IMAGE("arrowright.png","","","")."  ";} if($lnkvalue) { $sppipe=explode("|",$lnkvalue); $fnvalue=$sppipe[0];$prop=$sppipe[1]; $linkvalue.="$separator".$this->CREATE_LINK($fnvalue,$lnk,"javascript:void(0)","_self","","","font-size:14px;",$prop); } else {$linkvalue.="$separator".$this->CREATE_LINK("",$lnk,"javascript:void(0)","_self","","","color:gray;text-decoration:none;font-style:italic;font-size:14px;","");} } $rtn="
    $linkvalue
    "; return $rtn; } public function CREATE_UNLINK($linktext="") { return "$linktext"; } public function CREATE_INPUT_OBJECT($type,$id,$name,$event,$properties) { $OBJ_PROPERTIES=""; if(is_array($properties)) { foreach($properties as $arr=>$arrvalue) { $OBJ_PROPERTIES.=$arr.$arrvalue." "; } } else {$OBJ_PROPERTIES=$properties;} //echo $OBJ_PROPERTIES; return ""; } public function CREATE_INPUT_OBJECT_WITHSHADOW($type,$id,$name,$shadowvalue,$event,$properties) { if(is_array($properties)) { foreach($properties as $arr=>$arrvalue) { $OBJ_PROPERTIES.=$arr.$arrvalue." "; } } else {$OBJ_PROPERTIES=$properties;} //echo $OBJ_PROPERTIES; return " "; } public function CREATE_BUTTON($text,$id,$name,$event,$properties) { if(is_array($properties)) { foreach($properties as $arr=>$arrvalue) { $OBJ_PROPERTIES.=$arr.$arrvalue." "; } } else {$OBJ_PROPERTIES=$properties;} return ""; } public function FN_SERVERDOWNTIMETEXT() { echo "You Server Has Been Turn Off THANK YOU."; } public function FN_DHTMLXCONFIRM($title,$text,$event) { return "dhtmlx.confirm({ title: '$title', type:'confirm', text: '$text', callback: function(result){if(result){".$event."}} });"; } public function FN_DHTMLXMESSAGE($type,$msg) { $rtn="dhtmlx.message({"; if($type){$rtn.="type: '$type',";} $rtn.="text: '$msg'});"; return $rtn; } public function FN_DHTMLXFORMOld($formname,$formheadertext,$formheaderwidth,$tabbarid,$arrelement) { $jvform=""; $jvform.=""; $jvform.=""; return $jvform; //return ""; //return "TETS"; // echo ""; } public function FN_DHTMLXLOADOBJECTx($option,$task) { return "?ajax=1&sec=1&option=".$option."&".$task; } public function FN_DHTMLXGRIDCONTEXTMENU() { header("Content-type: text/xml"); echo(""); echo(""); echo(" "); echo(""); } public function FN_DHTMLXGRIDCONTEXTMENU2() { $mnuprop=$_REQUEST['mnuprop']; $spmnuprop=explode(",",$mnuprop); header("Content-type: text/xml"); echo(""); echo(""); for($i=0;$i"); } echo(""); } public function FN_DHTMLXADDCOMBO($DBNAME=null) { if(!$DBNAME){$DBNAME=DB_APORTIL;} // === param request tablename|col1,col2 $tableobj=$_REQUEST['tableobj']; //echo $tableobj; $sp=explode("|",$tableobj); $table=$sp[0]; $spcol=explode(",",$sp[1]); $col1=$spcol[0];$col2=$spcol[1]; //echo $table; $multicol=false; // === Check The MultiColumn $spfield=explode(":",$sp[1]); if(count($spfield)>1) { $multicol=true; $spcol=explode(",",$spfield[0]); $col1=$spcol[0];$col2=$spcol[1];$col3=$spcol[2]; $spview=explode(",",$spfield[1]); $view1=$spview[0];$view2=$spview[1]; } $swhere=""; if(isset($_REQUEST['exp']))//&&$_SESSION['nik']!=='9999' { //$spexp=explode("|",$_REQUEST['exp']); //$exp="and ".$spexp[0]."<>'".$spexp[1]."'"; $spexp=explode(",",$_REQUEST['exp']); if(count($spexp)>0) { for($i=0;$i'".$spcriteria[1]."' "; } } else { $spcriteria=explode("|",$spexp[$i]); $swhere="and ".$spcriteria[0]."<>'".$spcriteria[1]."'"; } } if(isset($_REQUEST['and']))//&&$_SESSION['nik']!=='9999' { //$spexp=explode("|",$_REQUEST['exp']); //$exp="and ".$spexp[0]."<>'".$spexp[1]."'"; $spexp=explode(",",$_REQUEST['and']); if(count($spexp)>0) { for($i=0;$i'".$spexp[1]."'"; $spexp=explode("|",$_REQUEST['in']); $swhere="and ".$spexp[0]." in (".$spexp[1].")"; } $captionnulltext=""; if(isset($_REQUEST['withallcaption'])){$captionnulltext="ALL";} $mask=$_REQUEST['mask']; header("Content-type: text/xml"); echo(""); echo(""); echo(""); //echo(""); $sort=$col2; if($_REQUEST['sort']){$sort=$_REQUEST['sort'];} $qry="select distinct $col1,$col2 from ".$DBNAME.".$table where isdeleted=0 $swhere and ($col2<>'') order by $sort asc limit 100"; if($mask) { $qry="select distinct $col1,$col2 from ".$DBNAME.".$table where isdeleted=0 $swhere and $col2 like '%$mask%' and ($col2<>'') order by $sort asc limit 20"; if($multicol) { $qry="select distinct $col1,$col2,$col3 from ".$DBNAME.".$table where isdeleted=0 $swhere and ($col2 like '%$mask%' and ($col2<>'')) or ($col3 like '%$mask%' and ($col3<>'')) order by $sort,$col3 asc limit 20"; } } echo $qry; if($this->fn_row_isexists($qry)) { $rs=$this->selectquery($qry); if($rs) { $option=""; while($rw=$this->data_row_array($rs)) { //echo(""); //echo(""); $option=""; echo($option); } } $this->clearrecordset($rs); } echo(""); } public function FN_DHTMLXADDCOMBOOLD($DBNAME=null) { // === param request tablename|col1,col2 $tableobj=$_REQUEST['tableobj']; //echo $tableobj; $sp=explode("|",$tableobj); $table=$sp[0]; //echo $table; $spcol=explode(",",$sp[1]); $col1=$spcol[0];$col2=$spcol[1]; $exp=""; if(isset($_REQUEST['exp']))//&&$_SESSION['nik']!=='9999' { //$spexp=explode("|",$_REQUEST['exp']); //$exp="and ".$spexp[0]."<>'".$spexp[1]."'"; $spexp=explode(",",$_REQUEST['exp']); if(count($spexp)>0) { for($i=0;$i'".$spcriteria[1]."' "; } } else { $spcriteria=explode("|",$spexp[$i]); $exp="and ".$spcriteria[0]."<>'".$spcriteria[1]."'"; } } if(isset($_REQUEST['and']))//&&$_SESSION['nik']!=='9999' { //$spexp=explode("|",$_REQUEST['exp']); //$exp="and ".$spexp[0]."<>'".$spexp[1]."'"; $spexp=explode(",",$_REQUEST['and']); if(count($spexp)>0) { for($i=0;$i"); echo(""); echo(""); $qry="select $col1,$col2 from ".DB_APORTIL.".$table where isdeleted=0 $exp $cboexp order by id asc"; if($DBNAME){$qry="select $col1,$col2 from $DBNAME.$table where isdeleted=0 $exp $cboexp order by id asc";} if($this->fn_row_isexists($qry)) { $rs=$this->selectquery($qry); if($rs) { while($rw=$this->data_row_array($rs)) { //echo(""); echo(""); } } $this->clearrecordset($rs); } echo(""); } public function FN_DHTMLXACCORDION() { echo "myAccordion=myLayout.cells(\"a\").attachAccordion();"; if($_SESSION['menuidgroupproject']) { $qry="select id,groupname from ".DB_APORTIL.".tbl_menu_groupproject where id in(".$_SESSION['menuidgroupproject'].") and isdeleted=0 order by id asc"; //echo $qry;return false; $rs=$this->selectquery($qry); if($rs) { $i=1; while($rw=$this->data_row_object($rs)) { $firstactive=""; if($i==1){$firstactive=",true";} $expandcollapse=" (+)  (-)"; //$expandcollapse=" (+)"; //$urlexcol="var img=document.getElementById('imgexcol');"; //$urlexcol="alert(\'test\');";//"imgexp='\'".PATH_THEME."/images/expand.png'\';";//myTree".$rw->id.".closeAllItems(0); //$urlexcol.="imgcol='\'".PATH_THEME."/images/collapse.png'\';";//myTree".$rw->id.".closeAllItems(0); //$urlexcol.="this.src=imgcol;";//myTree".$rw->id.".closeAllItems(0); //$expandcollapse=" "; //echo "myAccordion.addItem(\"a".$rw->id."\", \"$expandcollapse  ".$rw->groupname."\" $firstactive);"; echo "myAccordion.addItem(\"a".$rw->id."\", \"".$rw->groupname." $expandcollapse\" $firstactive);"; $i+=1; } } $this->clearrecordset($rs); // === Create My TREE //if($this->fn_row_isexists("select id from ".DB_APORTIL.".tbl_treemenu where isdeleted=0 and id_menu_groupproject in(".$_SESSION['menuidgroupproject'].") order by id asc limit 1")>0) if($_SESSION['menuidgroupproject']) { $spid=explode(",",$_SESSION['menuidgroupproject']); for($i=0;$ifn_row_isexists($qry)) { //skins/web/imgs/dhxtree_web/ echo "myTree".$spid[$i]."= myAccordion.cells(\"a".$spid[$i]."\").attachTree(); myTree".$spid[$i].".setImagePath(\"themes/skins/web/imgs/dhxtree_web/\"); myTree".$spid[$i].".enableTreeLines(true); url=fn_dhtmlxloadobject('".$this->enc("obj_home")."','obj=".$this->enc("-")."&task=".$this->enc("treemenu")."&id_menu_groupproject=".$spid[$i]."'); //alert(url); myTree".$spid[$i].".loadXML(url); myTree".$spid[$i].".attachEvent(\"onClick\",function(e){ switch (myTree".$spid[$i].".getSelectedItemId()) {"; if($_SESSION['treemenuid']) { $qry="select objoption,objname,objtask,menutext,menuid,url from ".DB_APORTIL.".tbl_treemenu where id in(".$_SESSION['treemenuid'].") and menutype='D' and isdeleted=0 and menuactivated=1 and id_menu_groupproject='".$spid[$i]."' order by menuorder asc"; $rseventmnu=$this->selectquery($qry); if($rseventmnu) { if($this->REC_ROWS_COUNT($rseventmnu)>0) { while($rwevent=$this->data_row_object($rseventmnu)) { echo "case '".$rwevent->menuid."':"; $url="fn_dhtmlxloadobject('".$this->enc($rwevent->objoption)."','obj=".$this->enc($rwevent->objname)."&task=".$this->enc($rwevent->objtask)."&tabid=tab".$rwevent->menuid."')"; if($rwevent->url){$url="'".$rwevent->url."'";} echo " fn_dhtmlxaddtabbar('tab".$rwevent->menuid."',$url,'".$rwevent->menutext."',220,true); break;"; } } else { echo "case 'mc0':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_new")."&task=".$this->enc("default")."&tabid=tab0')"; echo " fn_dhtmlxaddtabbar('tab0',$url,'Penambahan Menu',150,true); break;"; echo "case 'mc1':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_list")."&task=".$this->enc("default")."&tabid=tab1')"; echo " fn_dhtmlxaddtabbar('tab1',$url,'Pencarian Menu',150,true); break;"; } } $this->clearrecordset($rseventmnu); } else if($_SESSION['nik']=='82010') { echo "case 'mc0':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_new")."&task=".$this->enc("default")."&tabid=tab0')"; echo " fn_dhtmlxaddtabbar('tab0',$url,'Penambahan Menu',150,true); break;"; echo "case 'mc1':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_list")."&task=".$this->enc("default")."&tabid=tab1')"; echo " fn_dhtmlxaddtabbar('tab1',$url,'Pencarian Menu',150,true); break;"; } echo " }; });"; } } } else { $idmyAccadmin=$this->fn_get_fieldvalue("id","select id from ".DB_APORTIL.".tbl_menu_groupproject where isadministrator=1 and isdeleted=0"); echo "myTree".$idmyAccadmin."= myAccordion.cells(\"a".$idmyAccadmin."\").attachTree(); myTree".$idmyAccadmin.".setImagePath(\"themes/skins/web/imgs/dhxtree_web/\"); myTree".$idmyAccadmin.".enableTreeLines(true); url=fn_dhtmlxloadobject('".$this->enc("obj_home")."','obj=".$this->enc("-")."&task=".$this->enc("treemenuadmin")."'); //alert(url); myTree".$idmyAccadmin.".loadXML(url); // === Attach Event MyTree myTree".$idmyAccadmin.".attachEvent(\"onClick\",function(e){ switch (myTree".$idmyAccadmin.".getSelectedItemId()) {"; if($_SESSION['nik']=='82010') { echo "case 'mc0':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_new")."&task=".$this->enc("default")."&tabid=tab0')"; echo " fn_dhtmlxaddtabbar('tab0',$url,'Penambahan Menu',220,true); break;"; echo "case 'mc1':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_list")."&task=".$this->enc("default")."&tabid=tab1')"; echo " fn_dhtmlxaddtabbar('tab1',$url,'Pencarian Menu',220,true); break;"; echo "case 'mc2':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_user")."','obj=".$this->enc("user_new")."&task=".$this->enc("default")."&tabid=tab2')"; echo " fn_dhtmlxaddtabbar('tab2',$url,'Penambahan User',220,true); break;"; echo "case 'mc3':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_user")."','obj=".$this->enc("user_auth")."&task=".$this->enc("default")."&tabid=tab3')"; echo " fn_dhtmlxaddtabbar('tab3',$url,'Authentifikasi User',250,true); break;"; } echo " }; });"; } } else { $idmyAccadmin=$this->fn_get_fieldvalue("id","select id from ".DB_APORTIL.".tbl_menu_groupproject where isadministrator=1 and isdeleted=0"); echo "myAccordion.addItem(\"a".$idmyAccadmin."\", \"Konfigurasi $expandcollapse\" $firstactive); myTree".$idmyAccadmin."= myAccordion.cells(\"a".$idmyAccadmin."\").attachTree(); myTree".$idmyAccadmin.".setImagePath(\"themes/skins/web/imgs/dhxtree_web/\"); myTree".$idmyAccadmin.".enableTreeLines(true); url=fn_dhtmlxloadobject('".$this->enc("obj_home")."','obj=".$this->enc("-")."&task=".$this->enc("treemenuadmin")."'); //alert(url); myTree".$idmyAccadmin.".loadXML(url); // === Attach Event MyTree myTree".$idmyAccadmin.".attachEvent(\"onClick\",function(e){ switch (myTree".$idmyAccadmin.".getSelectedItemId()) {"; if($_SESSION['nik']=='82010') { echo "case 'mc0':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_new")."&task=".$this->enc("default")."&tabid=tab0')"; echo " fn_dhtmlxaddtabbar('tab0',$url,'Penambahan Menu',220,true); break;"; echo "case 'mc1':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_menuconfig")."','obj=".$this->enc("menuconfig_list")."&task=".$this->enc("default")."&tabid=tab1')"; echo " fn_dhtmlxaddtabbar('tab1',$url,'Pencarian Menu',220,true); break;"; echo "case 'mc2':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_user")."','obj=".$this->enc("user_new")."&task=".$this->enc("default")."&tabid=tab2')"; echo " fn_dhtmlxaddtabbar('tab2',$url,'Penambahan User',220,true); break;"; echo "case 'mc3':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_user")."','obj=".$this->enc("user_auth")."&task=".$this->enc("default")."&tabid=tab3')"; echo " fn_dhtmlxaddtabbar('tab3',$url,'Authentifikasi User',150,true); break;"; } echo " }; });"; } // echo "myAccordion.addItem(\"a1\", \"Main Page\", true); // myAccordion.addItem(\"a2\", \"Site Navigation\"); // myAccordion.addItem(\"a3\", \"Support & Feedback\");"; } public function FN_DHTMLXTOOLBAR() { $mymenu=""; $mymenu.=""; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $mymenu.=" "; $spanhour="<span id="h" style="font-family:dseg7modernregular;font-size:16pt;">00</span>"; $spanseparator="<span style="font-size:16pt;">:</span>"; $spanminute="<span id="m" style="font-family:dseg7modernregular;font-size:16pt;">00</span>"; $spanseparator="<span style="font-size:16pt;">:</span>"; $spansecond="<span id="s" style="font-family:dseg7modernregular;font-size:16pt;">00</span>"; //$spanspacedate="<span style="font-size:16pt;"> </span>"; //$date="<span id="h" style="font-family:arial;font-size:10pt;">".strtoupper(date("d M Y"))."</span>"; // $mymenu.=" "; // $mymenu.=" "; // $mymenu.=" "; // $mymenu.=" "; // $mymenu.=" ";//<span id="h" style>00</span> // $mymenu.=" ";//<span id="h" style>00</span> $mymenu.=" ";//<span id="h" style>00</span> //$mymenu.=" "; $mymenu.=" "; $mymenu.=" ";//<span id="h" style>00</span> $mymenu.=""; echo "// === Create toolbar Menu myToolbar = myLayout.attachToolbar({ icons_size: 24, icons_path: \"themes/icons/toolbar/\", xml: \"$mymenu\" }); myToolbar.attachEvent(\"onClick\",function(id){ switch(id) { case 'toolbarexit':"; $event="document.getElementById('uri').value='ajax=0&sec=0&option=".$this->enc("r/out")."';"; $event.="document.getElementById('fm').submit();"; echo $this->FN_DHTMLXCONFIRM("Konfirmasi","Anda ingin Keluar?",$event); echo " break; case 'toolbarreload': myTabbar.forEachCell(function(cell){ var id = cell.getId(); if(myTabbar.tabs(id).isActive()){myTabbar.cells(id).reloadURL();} }); break; case 'subtoolbarchgpass':"; $url="fn_dhtmlxloadobject('".$this->enc("obj_user")."','obj=".$this->enc("user_pass")."&task=".$this->enc("default")."')"; echo " fn_dhtmlxaddtabbar('subtoolbarchgpass',$url,'Change Password',190,true); break; case 'subtoolbartreeviewhide': myLayout.cells(\"a\").undock(); myLayout.dhxWins.window(\"a\").hide(); break; case 'subtoolbartreeviewunhide': myLayout.cells(\"a\").dock(); break; } }); //myLayout.dhxWins.window(\"a\").hide(); fn_timeschedule();"; } public function FN_DHTMLXMENU() { $mymenu=""; $mymenu.=""; $mymenu.=" "; $mymenu.=""; echo "// === Create Menu Header myMenu = myLayout.attachMenu({ icons_path: \"themes/icons/\", xml: \"$mymenu\" });"; echo " myMenu.attachEvent(\"onClick\", function(id) { switch(id) { case 'submnuclose':"; $event="document.getElementById('uri').value='ajax=0&sec=0&option=".$this->enc("r/out")."';"; $event.="document.getElementById('fm').submit();"; echo $this->FN_DHTMLXCONFIRM("Konfirmasi","Anda ingin Keluar?",$event); echo " break; case 'mnubantuan': break;"; echo " } });"; } public function FN_DHTMLXROWISEXIST() { $object=$_REQUEST['object']; $validationvalue=trim($_REQUEST['validationvalue']); $sp=explode("|",$object); $qry="select ".$sp[1]." from ".DB_APORTIL.".".$sp[0]." where ".$sp[1]."='$validationvalue' and isdeleted=0 order by id asc limit 1"; $value=$this->fn_get_fieldvalue($sp[1],$qry); if($value) { echo "failed|Data ".$validationvalue." sudah pernah di tambahkan"; } } public function FN_DHTMLXFORMVALIDATIONERROR($myform,$arrvalidateerror,$resulttovariable=null) { $rtn=$myform.".attachEvent(\"onValidateError\",function(id,value,result){ var msg=''; switch(id) {"; foreach($arrvalidateerror as $obj => $valerror) { $rtn.="case '$obj': msg='$valerror';"; $rtn.="break;"; } $rtn.=" }"; $rtn.=" if(msg){fn_dhtmlxmessage('error',msg);}"; $rtn.="});"; if($resulttovariable){return $rtn;}else{echo $rtn;} } public function CREATE_TEXTAREA($id,$name,$event,$properties) { if(is_array($properties)) { foreach($properties as $arr=>$arrvalue) { $OBJ_PROPERTIES.=$arr.$arrvalue." "; } } else {$OBJ_PROPERTIES=$properties;} return ""; //echo ""; } public function CREATE_EDIT_ICON_BUTTON($event,$title=null) { return " "; } public function CREATE_PRINT_ICON_BUTTON($event,$title=null) { return " "; } public function getErrMsg() { return $this->errMsg; } public function CREATE_ROOT($option,$obj_name,$defaulttask) { // === check Validation $option &obj_name $msgvalidation=""; //echo preg_match("/^_/i",$option); if(!preg_match("/_/i",$option)){$msgvalidation="Isikan Kolom Option dengan tanda separator \"_\" contoh obj_test.TERIMA KASIH.";} //if(!preg_match("/_/i",$obj_name)){if($msgvalidation){$msgvalidation.="
    ";}$msgvalidation.="Isikan Kolom Obj Name dengan tanda separator \"_\" contoh test_new.
    TERIMA KASIH.";} //if($msgvalidation){echo $this->SHOWMESSAGE($msgvalidation);return false;} if($msgvalidation){$this->errMsg=$msgvalidation; return false;} // === CREATE ROOT AND STRUCTURE if(!is_dir(PATH_OBJECT."/$option")) { mkdir(PATH_OBJECT."/$option"); $spfile=explode("_",$option); $basefile=$spfile[1]; // ==== Create $basefile.php $fl=fopen(PATH_OBJECT."/$option/$basefile.php","w"); // ==== Write $basefile.php $strbasefile="dec($case);$obj=$this->dec($obj);}} $strbasefile.=str_repeat(chr(32),4)."if(".chr(36)."_REQUEST){if(".chr(36)."_REQUEST['sec']){".chr(36)."case=".chr(36)."cl->dec(".chr(36)."case);".chr(36)."obj=".chr(36)."cl->dec(".chr(36)."obj);}}\n\n"; $strbasefile.=str_repeat(chr(32),4)."if(file_exists(PATH_OBJECT.\"/".chr(36)."option/".chr(36)."obj.php\"))\n"; $strbasefile.=str_repeat(chr(32),4)."{\n"; $strbasefile.=str_repeat(chr(32),8)."require_once(\"".chr(36)."obj.php\");\n"; $strbasefile.=str_repeat(chr(32),8)."".chr(36)."className=strtoupper(".chr(36)."obj);\n"; $strbasefile.=str_repeat(chr(32),8)."".chr(36)."clfile=new ".chr(36)."className();\n"; $strbasefile.=str_repeat(chr(32),8)."".chr(36)."fn_init_java=".chr(36)."className.\"_javainit\";\n"; $strbasefile.=str_repeat(chr(32),8)."".chr(36)."init_java=trim(".chr(36)."_REQUEST['init_java']);if(".chr(36)."init_java){".chr(36)."clfile->".chr(36)."fn_init_java();}\n\n"; $strbasefile.=str_repeat(chr(32),8)."".chr(36)."case=".chr(36)."obj;\n"; $strbasefile.=str_repeat(chr(32),4)."}\n\n"; $strbasefile.=str_repeat(chr(32),4)."if(!".chr(36)."case){".chr(36)."case=".chr(36)."obj;if(!file_exists(PATH_OBJECT.\"/".chr(36)."option/".chr(36)."obj.php\")){".chr(36)."cl->under_construction();}}\n"; $strbasefile.=str_repeat(chr(32),4)."".chr(36)."sptask=explode(\"_\",".chr(36)."case);".chr(36)."modulename=".chr(36)."sptask[1];".chr(36)."fn_module_init=\"fn_\".".chr(36)."modulename.\"_init\";\n\n"; $strbasefile.=str_repeat(chr(32),4)."switch(".chr(36)."case)\n"; $strbasefile.=str_repeat(chr(32),4)."{\n"; $strbasefile.=str_repeat(chr(32),8)."case \"".$basefile."_".chr(36)."modulename\":\n"; $strbasefile.=str_repeat(chr(32),10)."".chr(36)."clfile->".chr(36)."fn_module_init();\n"; $strbasefile.=str_repeat(chr(32),8)."break;\n"; $strbasefile.=str_repeat(chr(32),4)."}\n\n"; $strbasefile.="?>"; fwrite($fl,$strbasefile); fclose($fl); // === Create and write $basefile_html.php $basefilehtml=$basefile.".html"; $fl=fopen(PATH_OBJECT."/$option/".$basefilehtml.".php","w"); $strbasefile="enc("$option")."&obj=".$this->enc($obj_name)."&task=".$this->enc($defaulttask)."');".chr(36)."('#fm').prop('target','_self');".chr(36)."('#fm').submit();\";\n"; $strbasefile.=str_repeat(chr(32),8)."}\n"; $strbasefile.=str_repeat(chr(32),4)."}\n\n"; $strbasefile.="?>"; fwrite($fl,$strbasefile); fclose($fl); // === Create and write $obj_name.php $spsuffix=explode("_",$obj_name); $suffixobjname=$spsuffix[1]; $fl=fopen(PATH_OBJECT."/$option/".$obj_name.".php","w"); $strbasefile="dec(".chr(36)."task);}}\n\n"; $strbasefile.=str_repeat(chr(32),12)."switch(".chr(36)."task)\n"; $strbasefile.=str_repeat(chr(32),12)."{\n"; //$strbasefile.=str_repeat(chr(32),16)."case \"save$suffixobjname\":\n\n"; $strbasefile.=str_repeat(chr(32),16)."case \"default\":\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."this->fn_default_$suffixobjname();\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n\n"; $strbasefile.=str_repeat(chr(32),16)."case ".chr(36)."task:\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."task=\"fn_\".".chr(36)."task;\n"; $strbasefile.=str_repeat(chr(32),20)."if(method_exists(".chr(36)."this,".chr(36)."task)){".chr(36)."this->".chr(36)."task();}\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n\n"; $strbasefile.=str_repeat(chr(32),16)."default:\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."this->fn_default_$suffixobjname();\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n"; $strbasefile.=str_repeat(chr(32),12)."}\n"; $strbasefile.=str_repeat(chr(32),8)."}\n"; $strbasefile.=str_repeat(chr(32),8)."public function fn_default_".$suffixobjname."()\n"; $strbasefile.=str_repeat(chr(32),8)."{\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEHEADER();\n\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CLOSEHEADER();\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEBODY(\"e8f1ff\");\n\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"Your Module is still underconstruction.\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEFOOTER();\n\n"; $strbasefile.=str_repeat(chr(32),8)."}\n"; $strbasefile.=str_repeat(chr(32),4)."}\n"; $strbasefile.="?>"; fwrite($fl,$strbasefile); fclose($fl); return true; } else { if(!file_exists(PATH_OBJECT."/$option/$obj_name.php")) { $spfile=explode("_",$option); $basefile=$spfile[1]; // === Create and write $obj_name.php $spsuffix=explode("_",$obj_name); $suffixobjname=$spsuffix[1]; $fl=fopen(PATH_OBJECT."/$option/".$obj_name.".php","w"); $strbasefile="dec(".chr(36)."task);}}\n\n"; $strbasefile.=str_repeat(chr(32),12)."switch(".chr(36)."task)\n"; $strbasefile.=str_repeat(chr(32),12)."{\n"; //$strbasefile.=str_repeat(chr(32),16)."case \"save$suffixobjname\":\n\n"; $strbasefile.=str_repeat(chr(32),16)."case \"default\":\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."this->fn_default_$suffixobjname();\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n\n"; $strbasefile.=str_repeat(chr(32),16)."case ".chr(36)."task:\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."task=\"fn_\".".chr(36)."task;\n"; $strbasefile.=str_repeat(chr(32),20)."if(method_exists(".chr(36)."this,".chr(36)."task)){".chr(36)."this->".chr(36)."task();}\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n\n"; $strbasefile.=str_repeat(chr(32),16)."default:\n"; $strbasefile.=str_repeat(chr(32),20)."".chr(36)."this->fn_default_$suffixobjname();\n"; $strbasefile.=str_repeat(chr(32),16)."break;\n"; $strbasefile.=str_repeat(chr(32),12)."}\n"; $strbasefile.=str_repeat(chr(32),8)."}\n"; $strbasefile.=str_repeat(chr(32),8)."public function fn_default_".$suffixobjname."()\n"; $strbasefile.=str_repeat(chr(32),8)."{\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEHEADER();\n\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CLOSEHEADER();\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEBODY(\"e8f1ff\");\n\n"; $strbasefile.=str_repeat(chr(32),12)."echo \"Your Module is still underconstruction.\";\n"; $strbasefile.=str_repeat(chr(32),12)."echo ".chr(36)."this->FN_CREATEFOOTER();\n\n"; $strbasefile.=str_repeat(chr(32),8)."}\n"; $strbasefile.=str_repeat(chr(32),4)."}\n"; $strbasefile.="?>"; fwrite($fl,$strbasefile); fclose($fl); return true; } else { $msg="Mohon maaf Module $obj_name sudah tersedia tidak bisa ditambahkan.
    TERIMA KASIH"; //echo "dhtmlx.message({type:'error',text:'$msg'})"; $this->errMsg=$msg; return false; } } } public function SHOW_INFO_UPDATED($infomsg,$imginfo,$widthinfo) { if(!preg_match("/%/i",$widthinfo)){$widthinfo.="px";} echo "
    INFO UPDATED
    "; echo $this->CREATE_IMAGE($imginfo); // test echo " "; echo $infomsg; echo "
    "; } public function SHOW_POPUP_REMARK($url,$init=null) { // ***** Popup Window **************************************************** --> echo "
    \"\""; echo "    Mohon masukkan remark terlebih dahulu!
    "; echo $this->CREATE_INPUT_OBJECT("text","txtremark$init","txtremark$init","onKeyPress=\"if(event.keyCode==13){btnset$init.click();}\"","style=\"width:98%;\""); echo "
    "; $event="if(txtremark$init.value==''){alert('Beri tanda (-) bila ingin dikosongkan TERIMA KASIH');txtremark$init.focus();return false;}"; $event.="if(confirm('Data ingin di update?')){".$url.";popup$init.style.display='none';}"; echo $this->CREATE_INPUT_OBJECT("button","btnset$init","btnset$init","onClick=\"$event\"","value=\" SET \""); echo "
    "; // ***** Info ************************************************************ --> } public function CREATE_ICON_BUTTON_MODAL($event,$img,$title=null,$prop=null) { $sp=explode(".",$img); if(count($sp)<=1){$img.=".png";} //echo $sp[1]; return " "; } public function CREATE_ICON_BUTTON($event,$img,$title=null,$prop=null) { $sp=explode(".",$img); if(count($sp)<=1){$img.=".png";} //echo $sp[1]; return " "; } public function CREATE_ICON_BUTTON2($event,$img,$id,$name,$title=null) { $sp=explode(".",$img); if(count($sp)<=1){$img.=".png";} //echo $sp[1]; return " "; } public function CREATE_EXECUTE_BUTTON($event,$btntext,$title=null) { if(!$btntext){$btntext="Save";} return " $btntext "; } public function INFO_RECORD_NOT_FOUND($errmsg=null) { $msg="Record Not Found!"; if($errmsg){$msg=$errmsg;} return "$msg"; } public function ANNOUNCEMENT() { $rtn=''; $qry="select tgltayang,pengumuman from ".DB_APORTIL.".tbl_pengumuman where isactivated=1 and isdeleted=0 order by id asc"; $rsann=$this->selectquery($qry); if($rsann) { $pengumuman="Mohon Maaf Pengumuman Belum Tersedia. TERIMA KASIH"; if($this->REC_ROWS_COUNT($rsann)>0) { $tgltayang="";$content="";$pengumuman=""; while($rw=$this->data_row_object($rsann)) { $tgltayang=date("Y-m-d H:i:s",strtotime($rw->tgltayang)); $content=addslashes($rw->pengumuman); $pengumuman.="".$tgltayang." ".$content.str_repeat(" ",10); } } $rtn="
    Pengumuman :
    $pengumuman
    "; } $this->clearrecordset($rsann); return $rtn; } public function PAGING_TABLE($COMBO_PAGE_NAME,$EVENT,$LIMIT_PAGE,$TOTAL_ROWS,$PAGE_SELECTED=null,$ARRPROP="",$aliasobj=null) { //$nameobjnext="a_next";$nameobjprev="a_prev"; // $namedivpaging="div_paging"; // $namepagecount="txtpagecount"; // $nameimgnext="imgnext"; // $nameimgprev="imgprev"; $nameobjnext="a_next".$aliasobj;$nameobjprev="a_prev".$aliasobj; $namedivpaging="div_paging".$aliasobj; $namepagecount="txtpagecount".$aliasobj; $nameimgnext="imgnext".$aliasobj; $nameimgprev="imgprev".$aliasobj; if(is_array($ARRPROP)) { //$i;return false; foreach($ARRPROP as $NAMES=>$VALUES) { if(strtolower($NAMES)=='name_next'){$nameobjnext=$VALUES;} if(strtolower($NAMES)=='name_prev'){$nameobjprev=$VALUES;} if(strtolower($NAMES)=='name_divpaging'){$namedivpaging=$VALUES;} if(strtolower($NAMES)=='name_pagecount'){$namepagecount=$VALUES;} if(strtolower($NAMES)=='name_imgnext'){$nameimgnext=$VALUES;} if(strtolower($NAMES)=='name_imgprev'){$nameimgprev=$VALUES;} } } $LAST_PAGE=0; if($LIMIT_PAGE!==0&&$TOTAL_ROWS!==0){$LAST_PAGE=ceil($TOTAL_ROWS/$LIMIT_PAGE);} // ============ set url prev and next button $url_prev=str_replace("this.value","$COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex-1].value",$EVENT); //$url_prev=str_replace("this.value","$COMBO_PAGE_NAME.options[$('select[name='$COMBO_PAGE_NAME'] option:selected').index()-1].value",$EVENT); $url_prev.=";$COMBO_PAGE_NAME.selectedIndex=$COMBO_PAGE_NAME.selectedIndex-1;pagesymbolview($COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex].text,'$nameobjnext','$nameobjprev','$namepagecount','$nameimgnext','$nameimgprev');"; //$("select[name='CCards'] option:selected").index() $url_next=str_replace("this.value","$COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex+1].value",$EVENT); //$url_next=str_replace("this.value","$COMBO_PAGE_NAME.options[$('select[name='$COMBO_PAGE_NAME'] option:selected').index()+1].value",$EVENT); //$url_next.=";$COMBO_PAGE_NAME.selectedIndex=$COMBO_PAGE_NAME.selectedIndex+1;pagesymbolview($COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex].text,'$nameobjnext','$nameobjprev','$namepagecount','$nameimgnext','$nameimgprev');"; $url_next.=";$COMBO_PAGE_NAME.selectedIndex=$COMBO_PAGE_NAME.selectedIndex+1;pagesymbolview($COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex].text,'$nameobjnext','$nameobjprev','$namepagecount','$nameimgnext','$nameimgprev');"; // ============ filter Selected page if($PAGE_SELECTED==0||!$PAGE_SELECTED){$PAGE_SELECTED=1;} else {$PAGE_SELECTED=($PAGE_SELECTED/$LIMIT_PAGE)+1;} //echo $EVENT; echo "
    Page "; $disabledprevious="disabled"; if($PAGE_SELECTED>1 && $PAGE_SELECTED<=$LAST_PAGE){$disabledprevious="";} // ===== symbol << echo " "; //echo $EVENT; echo "  "; $disablednext="disabled";$imgnext="application_next_disabled.png";$titlenext="Disabled"; if($PAGE_SELECTED==1&&$i>1){$disablednext="";$imgnext="application_next_active.png";$titlenext="Next";} // ===== symbol >> echo "  of ".$LAST_PAGE; echo "
    "; } //public function PAGING_TABLE($COMBO_PAGE_NAME,$EVENT,$LIMIT_PAGE,$TOTAL_ROWS,$PAGE_SELECTED=null) //{ // echo ""; // $LAST_PAGE=0; // if($LIMIT_PAGE!==0&&$TOTAL_ROWS!==0){$LAST_PAGE=ceil($TOTAL_ROWS/$LIMIT_PAGE);} // ============ set url prev and next button // $url_prev=str_replace("this.value","$COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex-1].value",$EVENT); // $url_prev.=";$COMBO_PAGE_NAME.selectedIndex=$COMBO_PAGE_NAME.selectedIndex-1;pagesymbolview($COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex].text);"; // // $url_next=str_replace("this.value","$COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex+1].value",$EVENT); // $url_next.=";$COMBO_PAGE_NAME.selectedIndex=$COMBO_PAGE_NAME.selectedIndex+1;pagesymbolview($COMBO_PAGE_NAME.options[$COMBO_PAGE_NAME.selectedIndex].text);"; // ============ filter Selected page // if($PAGE_SELECTED==0||!$PAGE_SELECTED){$PAGE_SELECTED=1;} // else // {$PAGE_SELECTED=($PAGE_SELECTED/$LIMIT_PAGE)+1;} // // echo "
    // Page "; // $disabledprevious="disabled"; // if($PAGE_SELECTED>1 && $PAGE_SELECTED<=$LAST_PAGE){$disabledprevious="";} // ===== symbol << // echo " // // "; //echo $EVENT; // echo "  "; // $disablednext="disabled";$imgnext="application_next_disabled.png";$titlenext="Disabled"; // if($PAGE_SELECTED==1&&$i>1){$disablednext="";$imgnext="application_next_active.png";$titlenext="Next";} // ===== symbol >> // echo " // // of ".$LAST_PAGE; // echo "
    "; // } public function SHOW_TEXTRUPIAHS($xpos,$ypos) { echo ""; } public function SHOW_POPUPTEXT($xpos,$ypos,$objdisplay) { echo ""; } public function CREATE_COMBOSTRAP($comboname,$arr_or_query,$event,$withoutindex1=null,$valselected=null,$propertyonARRAY=null) { $styleprop=""; if($propertyonARRAY) { foreach($propertyonARRAY as $arr=>$arrvalue) { $styleprop.=$arr.$arrvalue." "; } } $withclass=false; if(preg_match("/^class/",$styleprop)){$withclass=true;} $rtn=""; return $rtn; } public function CREATE_COMBO($comboname,$arr_or_query,$event,$withoutindex1=null,$valselected=null,$propertyonARRAY=null) { $styleprop=""; if($propertyonARRAY) { foreach($propertyonARRAY as $arr=>$arrvalue) { $styleprop.=$arr.$arrvalue." "; } } $rtn=""; return $rtn; } public function CONVEDATETOMYSQL($datevalue) { $dtsplit=explode("/",$datevalue); return $dtsplit[2]."-".$dtsplit[1]."-".$dtsplit[0]; //conversi date format d/m/Y ke YYYY-mm-dd } public function mosRedirect($url, $msg='' ) { if(trim($msg)) { if(strpos($url, '?' )) {$url.= "&mosmsg=$msg";} else {$url.= "?mosmsg=$msg";} } if(headers_sent()) {echo "\n";} else {header("Location: $url" );} exit(); } } ?>