
var pType=Runner.pages.constants.PAGE_VIEW;Runner.pages.PageSettings.addPageEvent("My Home",pType,"afterInit",function(pageObj,pageid){var button_Menu=new Runner.form.Button({id:'Menu'});button_Menu.on("click",function(e){var ctrl=this;var params={buttId:this.id,rndVal:(new Date().getTime())};this.setDisabled();var isButtEnabled=false;location.href="/menu.php";params["txt"]="Hello";ctrl.setMessage("Sending request to server...");isButtEnabled=true;var afterHandler=function(result){var message=result["txt"]+" !!!";ctrl.setMessage(message);};var keyObject={};var isManyKeys=0;if($('input[@type=checkbox][@name^=selection]').length){var keysElems=$('input[@type=checkbox][@checked][@name^=selection]');isManyKeys=1;for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if($('input[@type=hidden][@name^=editid]').length){var keysElems=$('input[@type=hidden][@name^=editid]');for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if(window.recKeysObj){var i=0;for(var key in window.recKeysObj){keyObject[i]=encodeURIComponent(window.recKeysObj[key]);i++;}}
var reqParams={params:JSON.stringify(params),keys:JSON.stringify(keyObject),isManyKeys:isManyKeys};$.post("buttonhandler.php",reqParams,function(result){result=JSON.parse(result);afterHandler.call(ctrl,result);ctrl.setEnabled();});if(!isButtEnabled){this.setEnabled();}});});var pType=Runner.pages.constants.PAGE_VIEW;Runner.pages.PageSettings.addPageEvent("My Home",pType,"afterInit",function(pageObj,pageid){var button_Menu1=new Runner.form.Button({id:'Menu1'});button_Menu1.on("click",function(e){var ctrl=this;var params={buttId:this.id,rndVal:(new Date().getTime())};this.setDisabled();var isButtEnabled=false;location.href="menu.php";params["txt"]="Getting";ctrl.setMessage("Please wait while it Load the CRM Modules...");isButtEnabled=true;var afterHandler=function(result){var message=result["txt"]+" !!!";ctrl.setMessage(message);};var keyObject={};var isManyKeys=0;if($('input[@type=checkbox][@name^=selection]').length){var keysElems=$('input[@type=checkbox][@checked][@name^=selection]');isManyKeys=1;for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if($('input[@type=hidden][@name^=editid]').length){var keysElems=$('input[@type=hidden][@name^=editid]');for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if(window.recKeysObj){var i=0;for(var key in window.recKeysObj){keyObject[i]=encodeURIComponent(window.recKeysObj[key]);i++;}}
var reqParams={params:JSON.stringify(params),keys:JSON.stringify(keyObject),isManyKeys:isManyKeys};$.post("buttonhandler.php",reqParams,function(result){result=JSON.parse(result);afterHandler.call(ctrl,result);ctrl.setEnabled();});if(!isButtEnabled){this.setEnabled();}});});var pType=Runner.pages.constants.PAGE_VIEW;Runner.pages.PageSettings.addPageEvent("My Home",pType,"afterInit",function(pageObj,pageid){var button_Logoff=new Runner.form.Button({id:'Logoff'});button_Logoff.on("click",function(e){var ctrl=this;var params={buttId:this.id,rndVal:(new Date().getTime())};this.setDisabled();var isButtEnabled=false;location.href="login.php?a=logout";params["txt"]="Logging";ctrl.setMessage("Please Wait...");isButtEnabled=true;var afterHandler=function(result){var message=result["txt"]+" !!!";ctrl.setMessage(message);};var keyObject={};var isManyKeys=0;if($('input[@type=checkbox][@name^=selection]').length){var keysElems=$('input[@type=checkbox][@checked][@name^=selection]');isManyKeys=1;for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if($('input[@type=hidden][@name^=editid]').length){var keysElems=$('input[@type=hidden][@name^=editid]');for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if(window.recKeysObj){var i=0;for(var key in window.recKeysObj){keyObject[i]=encodeURIComponent(window.recKeysObj[key]);i++;}}
var reqParams={params:JSON.stringify(params),keys:JSON.stringify(keyObject),isManyKeys:isManyKeys};$.post("buttonhandler.php",reqParams,function(result){result=JSON.parse(result);afterHandler.call(ctrl,result);ctrl.setEnabled();});if(!isButtEnabled){this.setEnabled();}});});var pType=Runner.pages.constants.PAGE_VIEW;Runner.pages.PageSettings.addPageEvent("My Home",pType,"afterInit",function(pageObj,pageid){var button_Edit_Details=new Runner.form.Button({id:'Edit_Details'});button_Edit_Details.on("click",function(e){var ctrl=this;var params={buttId:this.id,rndVal:(new Date().getTime())};this.setDisabled();var isButtEnabled=false;location.href="My_Home_edit.php";params["txt"]="Hello";ctrl.setMessage("Sending request to server...");isButtEnabled=true;var afterHandler=function(result){var message=result["txt"]+" !!!";ctrl.setMessage(message);};var keyObject={};var isManyKeys=0;if($('input[@type=checkbox][@name^=selection]').length){var keysElems=$('input[@type=checkbox][@checked][@name^=selection]');isManyKeys=1;for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if($('input[@type=hidden][@name^=editid]').length){var keysElems=$('input[@type=hidden][@name^=editid]');for(var i=0;i<keysElems.length;i++){keyObject[i]=encodeURIComponent(keysElems[i].value);}}else if(window.recKeysObj){var i=0;for(var key in window.recKeysObj){keyObject[i]=encodeURIComponent(window.recKeysObj[key]);i++;}}
var reqParams={params:JSON.stringify(params),keys:JSON.stringify(keyObject),isManyKeys:isManyKeys};$.post("buttonhandler.php",reqParams,function(result){result=JSON.parse(result);afterHandler.call(ctrl,result);ctrl.setEnabled();});if(!isButtEnabled){this.setEnabled();}});});