Wtf.appList=function(A){Wtf.apply(this,A);this.sortindex="";this.dir=0;this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:this.flag?"Applicant Name":"Employee Name",dataIndex:this.flag?"Applicant Name":"Employee Name"},{header:"Employee ID",dataIndex:"Employee ID",hidden:this.flag},{header:"IC/Passport No.",dataIndex:"IC/Passport No",sortable:false},{header:"Contact No.",dataIndex:"Contact No",sortable:false},{header:this.flag?"Applied On":"Enrollment Date",dataIndex:this.flag?"Applied On":"Enrollment Date",sortable:false},{header:"DOB",dataIndex:"Date of Birth",sortable:false},{header:"Country",dataIndex:"Country",sortable:false},{header:"Nationality",dataIndex:"Nationality"},{header:"Program Name",dataIndex:"Program Name",sortable:false},{header:"University/Institution",dataIndex:"University/Institution",sortable:false},{header:"Diploma/Degree",dataIndex:"Diploma/Degree",sortable:false},{header:"Class Degree",dataIndex:"Class Degree",sortable:false},{header:"CGPA",dataIndex:"CGPA",sortable:false},{header:"English Proficiency",dataIndex:"English Proficiency",sortable:false},{header:"Industry",dataIndex:"Industry",sortable:false},{header:"Employment Status",dataIndex:"Employment Status",sortable:false},{header:"Company Name",dataIndex:"Company Name",sortable:false},{header:"Position Level",dataIndex:"Position Level",sortable:false},{header:"Years of Service",dataIndex:"Years of Service",sortable:false},{header:"Health Condition",dataIndex:"Health Condition",sortable:false},{header:"Sponsor",dataIndex:"Sponsor",sortable:false},{header:"Status",dataIndex:"Status",hidden:!this.flag,sortable:false}]);var C=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Employee Name","Employee ID","IC/Passport No","Contact No","Enrollment Date","Date of Birth","Country","Nationality","Program Name","University/Institution","Diploma/Degree","Class Degree","CGPA","English Proficiency","Industry","Employment Status","Company Name","Position Level","Years of Service","Health Condition","Sponsor"]);var B=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Applicant Name","IC/Passport No","Contact No","Applied On","Date of Birth","Country","Nationality","Program Name","University/Institution","Diploma/Degree","Class Degree","CGPA","English Proficiency","Industry","Employment Status","Company Name","Position Level","Years of Service","Health Condition","Sponsor","Status"]);this.ds=new Wtf.data.Store({reader:this.flag?B:C,autoLoad:false,url:"jspfiles/reportNew.jsp"});this.sessionRecord=Wtf.data.Record.create([{name:"sessionid",type:"string"},{name:"sessionname",type:"string"}]);this.sessionReader=new Wtf.data.KwlJsonReader({root:"data"},this.sessionRecord);this.sessionStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/LacaStructure.jsp"}),baseParams:{flag:"41"},reader:this.sessionReader});this.sessionCmb=new Wtf.form.ComboBox({store:this.sessionStore,editable:false,displayField:"sessionname",mode:"local",triggerAction:"all",emptyText:"Select a session...",valueField:"sessionid",allowBlank:false});this.progStore=new Wtf.data.JsonStore({url:"CountryList.jsp?mode=prog",root:"data",fields:["programid","programname"]});this.programCmb=new Wtf.form.ComboBox({store:this.progStore,editable:false,displayField:"programname",mode:"local",width:140,triggerAction:"all",emptyText:"Select a program...",valueField:"programid"});this.fromDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select start date...",width:110,format:"Y-m-j"});this.toDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select end date...",width:110,name:"sdate",format:"Y-m-j"});this.appStatusStore=new Wtf.data.SimpleStore({data:[["Application Fee not paid","-2"],["Archived Application","-1"],["Applied","0"],["Approved","1"],["On Hold","2"],["Rejected","3"],["Partial Course Fee paid","4"],["Employee","5"],["Graduate","6"],["Alumni","7"]],fields:["status","id"],reader:new Wtf.data.ArrayReader({},[{name:"status"},{name:"id"}]),autoLoad:true});this.appStatusCombo=new Wtf.form.ComboBox({mode:"local",triggerAction:"all",editable:false,width:110,emptyText:"Select a status...",store:this.appStatusStore,displayField:"status",valueField:"id",value:(this.flag)?-2:5});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.ds.baseParams={mode:3,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue(),stat:this.appStatusCombo.getValue(),session:this.sessionCmb.getValue(),sortindex:this.sortindex,dir:this.dir,flag:(this.flag)?0:1};this.p=this.programCmb.getValue();this.f=this.fromDate1.getRawValue();this.t=this.toDate1.getRawValue();this.s=this.appStatusCombo.getValue();this.ses=this.sessionCmb.getValue();this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});if(this.flag){this.tbarConfig=["Program: ",this.programCmb,"-","Applied:","    From ",this.fromDate1,"   To ",this.toDate1,"-","Status: ",this.appStatusCombo,"-",this.submitBttn]}else{this.tbarConfig=["Session: ",this.sessionCmb,"-","Program: ",this.programCmb,"-","Applied:","    From ",this.fromDate1,"   To ",this.toDate1,"-",this.submitBttn]}Wtf.appList.superclass.constructor.call(this,{layout:"fit",border:false,items:[this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,cm:this.cm,viewConfig:{autoFill:true},loadMask:{msg:"Loading..."},tbar:this.tbarConfig,bbar:this.pg=new Wtf.PagingToolbar({pageSize:15,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:[this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var D=Wtf.urlEncode({mode:3,progid:this.p,fromdate:this.f,todate:this.t,stat:this.s,session:this.ses,sortindex:this.sortindex,dir:this.dir,flag:(this.flag)?0:1,fileName:(this.flag)?"List_of_Applicants.pdf":"Registered_Students.pdf"});setDldUrl("ReportsServlet.jsp?"+D)}}}),"-",this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var D=Wtf.urlEncode({progid:this.p,fromdate:this.f,todate:this.t,stat:this.s,session:this.ses,sortindex:this.sortindex,dir:this.dir,flag:(this.flag)?0:1,type:"reports",dtype:"attachment",report:"getApplications"});setDldUrl("fileDownload.jsp?"+D)}}})]})})]})};Wtf.extend(Wtf.appList,Wtf.Panel,{onRender:function(A){Wtf.appList.superclass.onRender.call(this,A);this.ds.baseParams={mode:3,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue(),stat:this.appStatusCombo.getValue(),session:this.sessionCmb.getValue(),sortindex:this.sortindex,dir:this.dir,flag:(this.flag)?0:1};this.p=this.programCmb.getValue();this.f=this.fromDate1.getRawValue();this.t=this.toDate1.getRawValue();this.s=this.appStatusCombo.getValue();this.ses=this.sessionCmb.getValue();this.ds.load({params:{start:0,limit:15}});this.sessionStore.load();this.progStore.load();this.progStore.on("load",function(){var C=new Wtf.data.Record.create(["programid","programname"]);var B=new C({programid:"",programname:"All"});this.progStore.addSorted(B)},this);this.grid.on("headerclick",function(C,B,E){if(C.colModel.config[B].sortable==false){return }var D=Wtf.get(E.getTarget().id);if(!this.prevTarget||this.prevTarget!==D){if(this.prevTarget){if(this.prevTarget.hasClass("sort-asc")){this.prevTarget.removeClass("sort-asc")}else{if(this.prevTarget.hasClass("sort-desc")){this.prevTarget.removeClass("sort-desc")}}}this.prevTarget=D}if(D.hasClass("sort-asc")){D.addClass("sort-desc");D.removeClass("sort-asc");this.dir=1}else{D.addClass("sort-asc");D.addClass("x-grid3-hd-inner");if(D.hasClass("sort-desc")){D.removeClass("sort-desc")}this.dir=0}this.sortindex=C.colModel.config[B].dataIndex;this.ds.baseParams={mode:3,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue(),stat:this.appStatusCombo.getValue(),session:this.sessionCmb.getValue(),sortindex:this.sortindex,dir:this.dir,flag:(this.flag)?0:1};this.ds.load({params:{start:0,limit:this.pP.combo.value}})},this)}});Wtf.grid.DynamicColumnModel4=function(A){this.cols1=[];var F=A.recordType;var C=F.prototype.fields;for(var B=0;B<C.keys.length;B++){var E=C.keys[B];var D=F.getField(E);if(E.match("No. of Applicants")){this.appendLast2={header:D.name,dataIndex:D.name}}else{if(E.match("No. of Students")){this.appendLast2={header:D.name,dataIndex:D.name}}else{this.cols1.push({header:D.name,dataIndex:D.name})}}}if(this.appendLast2){this.cols1.push(this.appendLast2)}Wtf.grid.DynamicColumnModel4.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel4,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.analysisReport=function(A){Wtf.apply(this,A);this.progStore=new Wtf.data.JsonStore({url:"CountryList.jsp?mode=prog",root:"data",fields:["programid","programname"]});this.programCmb=new Wtf.form.ComboBox({store:this.progStore,editable:false,displayField:"programname",mode:"local",width:140,triggerAction:"all",emptyText:"Select a program...",valueField:"programid"});this.fromDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select start date...",width:110,format:"Y-m-j"});this.toDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select end date...",width:110,name:"sdate",format:"Y-m-j"});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.northP.remove(this.grid);this.loadGrid()}});this.printBttn=new Wtf.Toolbar.Button({text:"Print",scope:this,disabled:false,handler:this.printReport});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.setValue("");this.fromDate1.setValue("");this.toDate1.setValue("");this.northP.remove(this.grid);this.loadGrid()}});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var B=Wtf.urlEncode({mode:this.mode,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}});Wtf.analysisReport.superclass.constructor.call(this,{border:false,layout:"border",bbar:[this.printBttn,"-",this.csv],tbar:["Select Program",this.programCmb,"Select start date",this.fromDate1,"Select end date",this.toDate1,this.submitBttn,this.clearBttn],items:[{region:"west",layout:"fit",width:300,bodyStyle:"background-color:#FFFFFF",items:this.northP=new Wtf.Panel({id:"middleeast"+this.id,border:false,layout:"fit"})},{region:"center",layout:"fit",bodyStyle:"background-color:#FFFFFF",items:new Wtf.Panel({id:"middlewest"+this.id,layout:"fit",border:false})}]});this.on("render",this.handleRender,this)};Wtf.extend(Wtf.analysisReport,Wtf.Panel,{handleRender:function(A){this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."});this.loadMask.show();this.loadGrid();this.progStore.load();this.progStore.on("load",function(){var C=new Wtf.data.Record.create(["programid","programname"]);var B=new C({programid:"",programname:"All"});this.progStore.addSorted(B)},this);if(Wtf.isIE){this.ownerCt.addListener("activate",this.handleActivate,this)}},handleActivate:function(A){A.doLayout();var B=(Wtf.getCmp("middleeast"+this.id).ownerCt.getSize().width<300)?300:Wtf.getCmp("middleeast"+this.id).ownerCt.getSize().width;Wtf.getCmp("middleeast"+this.id).ownerCt.setWidth(B);A.doLayout()},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue()}},this,function(request,response){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds=new Wtf.data.Store({reader:jreader});this._reader=jreader;this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel4(this.ds);this.grid=new Wtf.grid.GridPanel({loadMask:this.loadMask,border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,viewConfig:{autoFill:true}});this.northP.add(this.grid);this.ds.loadData(resObj.data)}this.doLayout();this.loadMask.hide();if(resObj!==undefined){this.plotChart(resObj)}}}},function(resp,req){this.loadMask.hide()})},plotChart:function(E){var G="";var B="";var A=0;var D=false;if(E.totalCnt>0){D=true;for(var C=0;C<E.chartdata.length;C++){A=(E.chartdata[C].cnt/E.totalCnt)*100;G+=E.chartdata[C].item.replace("+","%2b")+"+["+this.roundNumber(A,2)+"%]|";B+=A+","}}if(D){G=G.substring(0,G.length-1);B=B.substring(0,B.length-1);G=G.replace(/&/,"%26");G=G.replace(/#/,"%23")}var F='<div><img style = "" align="center" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+B+"&chco=3e85e5,fcb441,e0400a&chs=510x120&chl="+G+'"</img></div>';Wtf.getCmp("middlewest"+this.id).el.dom.firstChild.firstChild.innerHTML=F},roundNumber:function(A,C){var B=Math.round(A*Math.pow(10,C))/Math.pow(10,C);return B},printReport:function(){setDldUrl("ReportsServlet.jsp?mode="+this.mode+"&progid="+this.programCmb.getValue()+"&fromdate="+this.fromDate1.getRawValue()+"&todate="+this.toDate1.getRawValue())}});Wtf.analysisReport1=function(A){Wtf.apply(this,A);this.progStore=new Wtf.data.JsonStore({url:"CountryList.jsp?mode=prog",root:"data",fields:["programid","programname"]});this.programCmb=new Wtf.form.ComboBox({store:this.progStore,editable:false,displayField:"programname",mode:"local",width:140,triggerAction:"all",emptyText:"Select a program...",valueField:"programid"});this.fromDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select start date...",width:110,format:"Y-m-j"});this.toDate1=new Wtf.form.DateField({fieldLabel:"Start Date",emptyText:"Select end date...",width:110,name:"sdate",format:"Y-m-j"});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.northP.remove(this.grid);this.northP1.remove(this.grid1);this.loadGrid()}});this.printBttn=new Wtf.Toolbar.Button({text:"Print",scope:this,disabled:false,handler:this.printReport});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var B=Wtf.urlEncode({mode:this.mode,progid:this.programCmb.getValue(),fromdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.setValue("");this.fromDate1.setValue("");this.toDate1.setValue("");this.northP.remove(this.grid);this.northP1.remove(this.grid1);this.loadGrid()}});Wtf.analysisReport1.superclass.constructor.call(this,{autoDestroy:true,border:false,layout:"form",bodyStyle:"background-color:#FFFFFF;position:relative;",height:640,autoScroll:true,bbar:[this.printBttn,"-",this.csv],tbar:["Select Program",this.programCmb,"Select start date",this.fromDate1,"Select end date",this.toDate1,this.submitBttn,this.clearBttn],items:[{layout:"fit",height:250,border:false,items:[{border:false,layout:"border",items:[{region:"center",layout:"fit",bodyStyle:"background-color:#FFFFFF",items:new Wtf.Panel({id:"middlewest"+this.id,border:false,bodyStyle:"background-color:#FFFFFF"})},{region:"west",layout:"fit",width:320,bodyStyle:"background-color:#FFFFFF",items:this.northP=new Wtf.Panel({id:"middleeast"+this.id,border:false,layout:"fit"})}]}]},new Wtf.Panel({layout:"fit",height:250,border:false,items:[{border:false,layout:"border",items:[{region:"center",layout:"fit",bodyStyle:"background-color:#FFFFFF",items:new Wtf.Panel({id:"middlewest1"+this.id,border:false})},{region:"west",layout:"fit",width:320,bodyStyle:"background-color:#FFFFFF",items:this.northP1=new Wtf.Panel({id:"middleeast1"+this.id,border:false,layout:"fit"})}]}]})]});this.on("render",this.handleRender,this)};Wtf.extend(Wtf.analysisReport1,Wtf.Panel,{handleRender:function(A){this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."});this.loadMask.show();this.loadGrid();this.progStore.load();this.progStore.on("load",function(){var C=new Wtf.data.Record.create(["programid","programname"]);var B=new C({programid:"",programname:"All"});this.progStore.addSorted(B)},this);if(Wtf.isIE){this.ownerCt.addListener("activate",this.handleActivate,this)}},handleActivate:function(A){A.doLayout();var C=(Wtf.getCmp("middleeast"+this.id).ownerCt.getSize().width<320)?320:Wtf.getCmp("middleeast"+this.id).ownerCt.getSize().width;Wtf.getCmp("middleeast"+this.id).ownerCt.setWidth(C);A.doLayout();var B=(Wtf.getCmp("middleeast1"+this.id).ownerCt.getSize().width<320)?320:Wtf.getCmp("middleeast1"+this.id).ownerCt.getSize().width;Wtf.getCmp("middleeast1"+this.id).ownerCt.setWidth(B);A.doLayout()},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,progid:this.programCmb.getValue(),fomdate:this.fromDate1.getRawValue(),todate:this.toDate1.getRawValue()}},this,function(request,response){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds=new Wtf.data.Store({reader:jreader});this._reader=jreader;this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel4(this.ds);this.grid=new Wtf.grid.GridPanel({loadMask:this.loadMask,border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,viewConfig:{autoFill:true}});this.northP.add(this.grid);this.ds.loadData(resObj.data);this.doLayout();this.northP.ownerCt.doLayout()}if(resObj.data1!==undefined){var jreader1=new Wtf.data.DynamicJsonReader({});jreader1.readRecords(resObj.data1);this.ds1=new Wtf.data.Store({reader:jreader1});this._reader1=jreader1;this.ds1.recordType=jreader1.recordType;this.ds1.fields=jreader1.recordType.prototype.fields;this.cm1=new Wtf.grid.DynamicColumnModel4(this.ds1);this.grid1=new Wtf.grid.GridPanel({loadMask:this.loadMask,border:false,store:this.ds1,enableColumnHide:false,enableColumnMove:false,cm:this.cm1,sm:this.examSM1,viewConfig:{autoFill:true}});this.northP1.add(this.grid1);this.ds1.loadData(resObj.data1)}this.doLayout();this.loadMask.hide();if(resObj!==undefined){this.plotChart(resObj)}}}},function(resp,req){this.loadMask.hide()})},plotChart:function(F){var H="";var B="";var A=0;var D=false;if(F.totalCnt>0){D=true;for(var C=0;C<F.chartdata.length;C++){A=(F.chartdata[C].cnt/F.totalCnt)*100;H+=F.chartdata[C].item.replace("+","%2b")+"+["+this.roundNumber(A,2)+"%]|";B+=A+","}}if(D){H=H.substring(0,H.length-1);B=B.substring(0,B.length-1)}var E='<div><img style = "" align="center" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+B+"&chco=3e85e5,fcb441,e0400a&chs=510x120&chl="+H+'"</img></div>';document.getElementById("middlewest"+this.id).innerHTML=E;H="";B="";A=0;D=false;if(F.totalCnt1>0){D=true;for(var C=0;C<F.chartdata1.length;C++){A=(F.chartdata1[C].cnt/F.totalCnt1)*100;H+=F.chartdata1[C].item.replace("+","%2b")+"+["+this.roundNumber(A,2)+"%]|";B+=A+","}}if(D){H=H.substring(0,H.length-1);B=B.substring(0,B.length-1)}var G='<div><img style = "" align="center" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+B+"&chco=3e85e5,fcb441,e0400a&chs=510x120&chl="+H+'"</img></div>';document.getElementById("middlewest1"+this.id).innerHTML=G},roundNumber:function(A,C){var B=Math.round(A*Math.pow(10,C))/Math.pow(10,C);return B},printReport:function(){setDldUrl("ReportsServlet.jsp?mode="+this.mode+"&progid="+this.programCmb.getValue()+"&fromdate="+this.fromDate1.getRawValue()+"&todate="+this.toDate1.getRawValue())}});Wtf.MonthPicker=Wtf.extend(Wtf.Component,{format:"M, Y",okText:"OK",cancelText:"Cancel",constrainToViewport:true,monthNames:Date.monthNames,value:0,noPastYears:true,useDayDate:null,initComponent:function(){Wtf.MonthPicker.superclass.initComponent.call(this);this.value=this.value?this.value.clearTime():new Date().clearTime();this.addEvents("select");if(this.handler){this.on("select",this.handler,this.scope||this)}},focus:function(){if(this.el){this.update(this.activeDate)}},onRender:function(D,B){var A=['<div style="width: 175px; height:175px;"></div>'];A[A.length]='<div class="x-date-mp"></div>';var C=document.createElement("div");C.className="x-date-picker";C.innerHTML=A.join("");D.dom.insertBefore(C,B);this.el=Wtf.get(C);this.monthPicker=this.el.down("div.x-date-mp");this.monthPicker.enableDisplayMode("block");this.el.unselectable();this.showMonthPicker();if(Wtf.isIE){this.el.repaint()}this.update(this.value)},createMonthPicker:function(){if(!this.monthPicker.dom.firstChild){var A=['<table border="0" cellspacing="0">'];for(var B=0;B<6;B++){A.push('<tr><td class="x-date-mp-month"><a href="#">',this.monthNames[B].substr(0,3),"</a></td>",'<td class="x-date-mp-month x-date-mp-sep"><a href="#">',this.monthNames[B+6].substr(0,3),"</a></td>",B==0?'<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>':'<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>')}A.push('<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',this.okText,'</button><button type="button" class="x-date-mp-cancel">',this.cancelText,"</button></td></tr>","</table>");this.monthPicker.update(A.join(""));this.monthPicker.on("click",this.onMonthClick,this);this.monthPicker.on("dblclick",this.onMonthDblClick,this);this.mpMonths=this.monthPicker.select("td.x-date-mp-month");this.mpYears=this.monthPicker.select("td.x-date-mp-year");this.mpMonths.each(function(C,D,E){E+=1;if((E%2)==0){C.dom.xmonth=5+Math.round(E*0.5)}else{C.dom.xmonth=Math.round((E-1)*0.5)}})}},showMonthPicker:function(){this.createMonthPicker();var A=this.el.getSize();this.monthPicker.setSize(A);this.monthPicker.child("table").setSize(A);this.mpSelMonth=(this.activeDate||this.value).getMonth();this.updateMPMonth(this.mpSelMonth);this.mpSelYear=(this.activeDate||this.value).getFullYear();this.updateMPYear(this.mpSelYear);this.monthPicker.show()},updateMPYear:function(F){if(this.noPastYears){var D=new Date().getFullYear();if(F<(D+4)){F=D+4}}this.mpyear=F;var C=this.mpYears.elements;for(var B=1;B<=10;B++){var E=C[B-1],A;if((B%2)==0){A=F+Math.round(B*0.5);E.firstChild.innerHTML=A;E.xyear=A}else{A=F-(5-Math.round(B*0.5));E.firstChild.innerHTML=A;E.xyear=A}this.mpYears.item(B-1)[A==this.mpSelYear?"addClass":"removeClass"]("x-date-mp-sel")}},updateMPMonth:function(A){this.mpMonths.each(function(B,C,D){B[B.dom.xmonth==A?"addClass":"removeClass"]("x-date-mp-sel")})},selectMPMonth:function(A){},getAdjustedDate:function(A,B){return new Date(A,B,this.useDayDate?(Math.min(this.useDayDate,(new Date(A,B,1)).getDaysInMonth())):(this.activeDate||this.value).getDate())},onMonthClick:function(D,B){D.stopEvent();var C=new Wtf.Element(B),A;if(C.is("button.x-date-mp-cancel")){this.hideMonthPicker()}else{if(C.is("button.x-date-mp-ok")){this.update(this.getAdjustedDate(this.mpSelYear,this.mpSelMonth));this.fireEvent("select",this,this.value)}else{if(A=C.up("td.x-date-mp-month",2)){this.mpMonths.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelMonth=A.dom.xmonth}else{if(A=C.up("td.x-date-mp-year",2)){this.mpYears.removeClass("x-date-mp-sel");A.addClass("x-date-mp-sel");this.mpSelYear=A.dom.xyear}else{if(C.is("a.x-date-mp-prev")){this.updateMPYear(this.mpyear-10)}else{if(C.is("a.x-date-mp-next")){this.updateMPYear(this.mpyear+10)}}}}}}},onMonthDblClick:function(D,B){D.stopEvent();var C=new Wtf.Element(B),A;if(A=C.up("td.x-date-mp-month",2)){this.update(this.getAdjustedDate(this.mpSelYear,A.dom.xmonth));this.fireEvent("select",this,this.value)}else{if(A=C.up("td.x-date-mp-year",2)){this.update(this.getAdjustedDate(A.dom.xyear,this.mpSelMonth));this.fireEvent("select",this,this.value)}}},hideMonthPicker:function(A){Wtf.menu.MenuMgr.hideAll()},showPrevMonth:function(A){this.update(this.activeDate.add("mo",-1))},showNextMonth:function(A){this.update(this.activeDate.add("mo",1))},showPrevYear:function(){this.update(this.activeDate.add("y",-1))},showNextYear:function(){this.update(this.activeDate.add("y",1))},update:function(C){this.activeDate=C;this.value=C;if(!this.internalRender){var A=this.el.dom.firstChild;var B=A.offsetWidth;this.el.setWidth(B+this.el.getBorderWidth("lr"));Wtf.fly(A).setWidth(B);this.internalRender=true;if(Wtf.isOpera&&!this.secondPass){A.rows[0].cells[1].style.width=(B-(A.rows[0].cells[0].offsetWidth+A.rows[0].cells[2].offsetWidth))+"px";this.secondPass=true;this.update.defer(10,this,[C])}}},setValue:function(A){this.activeDate=A;this.value=A}});Wtf.MonthItem=function(A){Wtf.MonthItem.superclass.constructor.call(this,new Wtf.MonthPicker(A),A);this.picker=this.component;this.addEvents("select");this.picker.on("render",function(B){B.getEl().swallowEvent("click");B.container.addClass("x-menu-date-item")});this.picker.on("select",this.onSelect,this)};Wtf.extend(Wtf.MonthItem,Wtf.menu.Adapter,{onSelect:function(B,A){this.fireEvent("select",this,A,B);Wtf.MonthItem.superclass.handleClick.call(this)}});Wtf.MonthMenu=function(B){Wtf.MonthMenu.superclass.constructor.call(this,B);this.plain=true;var A=new Wtf.MonthItem(B);this.add(A);this.picker=A.picker;this.relayEvents(A,["select"])};Wtf.extend(Wtf.MonthMenu,Wtf.menu.Menu,{cls:"x-date-menu"});Wtf.MonthField=function(A){Wtf.MonthField.superclass.constructor.call(this,A)};Wtf.extend(Wtf.MonthField,Wtf.form.DateField,{format:Wtf.MonthPicker.prototype.format,noPastYears:Wtf.MonthPicker.prototype.noPastYears,useDayDate:Wtf.MonthPicker.prototype.useDayDate,onTriggerClick:function(){if(this.disabled){return }if(this.menu==null){this.menu=new Wtf.MonthMenu()}Wtf.apply(this.menu.picker,{format:this.format,noPastYears:this.noPastYears,useDayDate:this.useDayDate});this.menu.on(Wtf.apply({},this.menuListeners,{scope:this}));this.menu.picker.setValue(this.getValue()||new Date());this.menu.show(this.el,"tl-bl?")}});Wtf.grid.DynamicColumnModel5=function(A){this.cols1=[];var F=A.recordType;var C=F.prototype.fields;C.keys=C.keys.sort();for(var B=0;B<C.keys.length;B++){var E=C.keys[B];var D=F.getField(E);if(E.match("Stundent Name")){this.appendFirst={header:D.name,dataIndex:D.name}}else{if(E.match("Stundent Id")){this.appendSecond={header:D.name,dataIndex:D.name}}else{this.cols1.push({header:D.name,dataIndex:D.name})}}}if(this.appendSecond){this.cols1.unshift(this.appendSecond)}if(this.appendFirst){this.cols1.unshift(this.appendFirst)}this.cols1.unshift(new Wtf.grid.RowNumberer({}));Wtf.grid.DynamicColumnModel5.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel5,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.WtfAttendanceList=function(A){Wtf.apply(this,A);this.venueRecord=Wtf.data.Record.create([{name:"vname",type:"string"},{name:"id",type:"string"},{name:"timezone"}]);this.venueReader=new Wtf.data.JsonReader({root:"data"},this.venueRecord);this.venueStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newClass.jsp"}),reader:this.venueReader});this.programStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","appfee","exemptiontype","programtype","feetype","auditper"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:1}});this.courseStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","prereqcourseid","level","parentcourse","isdefault","grpruleflag","subgrp","courseno"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:2}});this.moduleStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","id"]),autoLoad:false,url:"jspfiles/reportNew.jsp",baseParams:{mode:29}});this.classTypeStore=new Wtf.data.Store({url:"jspfiles/newCourse.jsp",reader:new Wtf.data.JsonReader({fields:[{name:"typeid",type:"string"},{name:"classtype",type:"string"}],root:"data"})});this.facRecord=Wtf.data.Record.create([{name:"username",type:"string"},{name:"id",type:"string"}]);this.facReader=new Wtf.data.KwlJsonReader({root:"data"},this.facRecord);this.facStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newClass.jsp"}),reader:this.facReader});this.programStore.load();this.programCmb=new Wtf.form.ComboBox({id:"prog"+this.id,store:this.programStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a program...",fieldLabel:"Program",name:"id",valueField:"id"});this.courseCmb=new Wtf.form.ComboBox({id:"course"+this.id,store:this.courseStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a course...",fieldLabel:"Course",name:"id",valueField:"id"});this.moduleCmb=new Wtf.form.ComboBox({id:"module"+this.id,store:this.moduleStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a module...",fieldLabel:"Module",name:"id",valueField:"id"});this.ctypeCombo=new Wtf.form.ComboBox({id:"ctype"+this.id,store:this.classTypeStore,editable:false,valueField:"typeid",displayField:"classtype",mode:"local",triggerAction:"all",emptyText:"Select a type...",fieldLabel:"Classroom Type",name:"ctype"});this.facCombo=new Wtf.form.ComboBox({id:"facc11"+this.id,store:this.facStore,editable:false,displayField:"username",mode:"local",triggerAction:"all",emptyText:"Select trainer...",fieldLabel:"Trainer",name:"facid",width:145,listWidth:165,valueField:"id",disabled:false});this.venueCombo=new Wtf.form.ComboBox({id:"venuess"+this.id,store:this.venueStore,editable:false,displayField:"vname",mode:"local",triggerAction:"all",emptyText:"Select a venue...",fieldLabel:"Venue",name:"venueid",valueField:"id",width:125,listWidth:140});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.northP.remove(this.grid);this.loadMask.hide();this.loadGrid()}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.reset();this.fromDate.reset();this.moduleCmb.reset();this.venueCombo.reset();this.ctypeCombo.reset();this.facCombo.reset();this.northP.remove(this.grid)}});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,date:this.fromDate.getValue().format("Y-m-d"),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}}});this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,date:this.fromDate.getValue().format("Y-m-d"),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue(),fileName:"Employee_Attendance_List.pdf"});setDldUrl("ReportsServlet.jsp?"+B)}});this.programCmb.on("select",this.handleProgSelect,this);this.courseCmb.on("select",this.handleCourseSelect,this);this.moduleCmb.on("select",this.handleModuleSelect,this);this.fromDate=new Wtf.MonthField({});this.fromDate.on("change",this.handleDateChange,this);Wtf.WtfAttendanceList.superclass.constructor.call(this,{layout:"fit",border:false,tbar:["Date ",this.fromDate,"Program ",this.programCmb," Module ",this.moduleCmb],bbar:[this.print,"-",this.csv],items:[this.northP=new Wtf.Panel({border:false,layout:"fit",tbar:["Class Type",this.ctypeCombo,"Trainer",this.facCombo,"Venue",this.venueCombo,this.submitBttn,this.clearBttn]})]})};Wtf.extend(Wtf.WtfAttendanceList,Wtf.Panel,{onRender:function(A){Wtf.WtfAttendanceList.superclass.onRender.call(this,A);this.venueStore.load({params:{type:"venue"}});this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."})},handleProgSelect:function(C,A,B){this.moduleCmb.reset();this.ctypeCombo.reset();this.moduleStore.removeAll();this.classTypeStore.removeAll();this.classTypeStore.load({params:{type:"programsessionclasstype",progid:A.data.id}});if(this.fromDate.getValue()!=""){this.moduleStore.load({params:{progid:A.data.id,fromdate:this.fromDate.getValue().format("Y-m-d")}})}else{this.fromDate.markInvalid("This field is required.")}},handleCourseSelect:function(C,A,B){this.moduleCmb.reset();this.moduleStore.removeAll();this.moduleStore.load({params:{id:A.data.id}})},handleDateChange:function(C,A,B){this.programCmb.reset()},handleModuleSelect:function(C,A,B){this.modId=A.data.id;this.facStore.removeAll();this.facStore.baseParams={type:"facvenue"};this.facStore.removeAll();this.facStore.load({params:{moduleid:A.data.id}})},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,moduleid:this.modId,date:this.fromDate.getValue().format("Y-m-d"),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue()}},this,function(request,response){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds=new Wtf.data.Store({reader:jreader});this._reader=jreader;this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel5(this.ds);this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,viewConfig:{autoFill:true}});this.northP.add(this.grid);this.ds.loadData(resObj.data)}this.doLayout();this.loadMask.hide()}}},function(resp,req){this.loadMask.hide()})}});Wtf.WtfAttendanceRep=function(A){Wtf.apply(this,A);this.venueRecord=Wtf.data.Record.create([{name:"vname",type:"string"},{name:"id",type:"string"},{name:"timezone"}]);this.venueReader=new Wtf.data.JsonReader({root:"data"},this.venueRecord);this.venueStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newClass.jsp"}),reader:this.venueReader});this.programStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","appfee","exemptiontype","programtype","feetype","auditper"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:1}});this.courseStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","prereqcourseid","level","parentcourse","isdefault","grpruleflag","subgrp","courseno"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:2}});this.moduleStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","id"]),autoLoad:false,url:"jspfiles/reportNew.jsp",baseParams:{mode:32}});this.sessionRecord=Wtf.data.Record.create([{name:"sessionid",type:"string"},{name:"sessionname",type:"string"}]);this.sessionReader=new Wtf.data.KwlJsonReader({root:"data"},this.sessionRecord);this.sessionStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/LacaStructure.jsp"}),baseParams:{flag:"41"},reader:this.sessionReader});this.sessionCmb=new Wtf.form.ComboBox({store:this.sessionStore,editable:false,displayField:"sessionname",mode:"local",triggerAction:"all",emptyText:"Select a session...",valueField:"sessionid",allowBlank:false});this.classTypeStore=new Wtf.data.Store({url:"jspfiles/newCourse.jsp",reader:new Wtf.data.JsonReader({fields:[{name:"typeid",type:"string"},{name:"classtype",type:"string"}],root:"data"})});this.facRecord=Wtf.data.Record.create([{name:"username",type:"string"},{name:"id",type:"string"}]);this.facReader=new Wtf.data.KwlJsonReader({root:"data"},this.facRecord);this.facStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newClass.jsp"}),reader:this.facReader});this.fromDate=new Wtf.form.DateField({fieldLabel:"From",id:"DateFrom"+this.id,format:"Y-m-d"});this.programStore.load();this.programCmb=new Wtf.form.ComboBox({id:"prog"+this.id,store:this.programStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a program...",fieldLabel:"Program",name:"id",valueField:"id"});this.courseCmb=new Wtf.form.ComboBox({id:"course"+this.id,store:this.courseStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a course...",fieldLabel:"Course",name:"id",valueField:"id"});this.moduleCmb=new Wtf.form.ComboBox({id:"module"+this.id,store:this.moduleStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a module...",fieldLabel:"Module",name:"id",valueField:"id"});this.ctypeCombo=new Wtf.form.ComboBox({id:"ctype"+this.id,store:this.classTypeStore,editable:false,valueField:"typeid",displayField:"classtype",mode:"local",triggerAction:"all",emptyText:"Select a type...",fieldLabel:"Classroom Type",name:"ctype"});this.facCombo=new Wtf.form.ComboBox({id:"facc11"+this.id,store:this.facStore,editable:false,displayField:"username",mode:"local",triggerAction:"all",emptyText:"Select trainer...",fieldLabel:"Trainer",name:"facid",width:145,listWidth:165,valueField:"id",disabled:false});this.venueCombo=new Wtf.form.ComboBox({id:"venuess"+this.id,store:this.venueStore,editable:false,displayField:"vname",mode:"local",triggerAction:"all",emptyText:"Select a venue...",fieldLabel:"Venue",name:"venueid",valueField:"id",width:125,listWidth:140});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.loadMask.show();this.ds.removeAll();this.ds.load({params:{mode:this.mode,moduleid:this.modId,date:this.fromDate.getRawValue(),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue()}})}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.reset();this.fromDate.reset();this.moduleCmb.reset();this.venueCombo.reset();this.ctypeCombo.reset();this.facCombo.reset();this.sessionCmb.reset();this.ds.removeAll()}});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,date:this.fromDate.getRawValue(),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}}});this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,date:this.fromDate.getRawValue(),venueid:this.venueCombo.getValue(),classtype:this.ctypeCombo.getValue(),facid:this.facCombo.getValue(),fileName:"Employee_Attendance_Report.pdf"});setDldUrl("ReportsServlet.jsp?"+B)}}});this.programCmb.on("select",this.handleProgSelect,this);this.courseCmb.on("select",this.handleCourseSelect,this);this.moduleCmb.on("select",this.handleModuleSelect,this);this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Employee Name",dataIndex:"Employee Name"},{header:"Employee ID",dataIndex:"Employee ID"},{header:"No. of Classes Attended",dataIndex:"Classes Attended"},{header:"% of Classes Attended",dataIndex:"Classes Percent"}]);this.ds=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["Employee Name","Employee ID","Classes Attended","Classes Percent"]),url:"jspfiles/reportNew.jsp",baseParams:{mode:this.mode}});this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,viewConfig:{autoFill:true}});this.ds.on("load",function(D,B,C){this.loadMask.hide()},this);this.ds.on("loadException",function(){this.loadMask.hide()},this);Wtf.WtfAttendanceRep.superclass.constructor.call(this,{layout:"fit",border:false,tbar:["Session ",this.sessionCmb,"Program ",this.programCmb," Module ",this.moduleCmb],bbar:[this.print,"-",this.csv],items:[this.northP=new Wtf.Panel({border:false,layout:"fit",items:this.grid,tbar:["Class Type",this.ctypeCombo,"Trainer",this.facCombo,"Venue",this.venueCombo,this.submitBttn,this.clearBttn]})]})};Wtf.extend(Wtf.WtfAttendanceRep,Wtf.Panel,{onRender:function(A){Wtf.WtfAttendanceRep.superclass.onRender.call(this,A);this.sessionStore.load();this.venueStore.load({params:{type:"venue"}});this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."})},handleProgSelect:function(C,A,B){this.moduleCmb.reset();this.ctypeCombo.reset();this.moduleStore.removeAll();this.classTypeStore.removeAll();this.classTypeStore.load({params:{type:"programsessionclasstype",progid:A.data.id}});this.moduleStore.load({params:{progid:A.data.id,sessionid:this.sessionCmb.getValue()}})},handleCourseSelect:function(C,A,B){this.moduleCmb.reset();this.moduleStore.removeAll();this.moduleStore.load({params:{id:A.data.id}})},handleModuleSelect:function(C,A,B){this.modId=A.data.id;this.facStore.removeAll();this.facStore.baseParams={type:"facvenue"};this.facStore.removeAll();this.facStore.load({params:{moduleid:A.data.id}})}});Wtf.data.DynamicJsonReader2=function(A){Wtf.data.DynamicJsonReader2.superclass.constructor.call(this,A,[])};Wtf.extend(Wtf.data.DynamicJsonReader2,Wtf.data.JsonReader,{getRecordType:function(D){var C=0,A=[];for(var B in D[0]){A[C++]=B}this.recordType=Wtf.data.Record.create(A);return this.recordType},readRecords:function(o){this.jsonData=o;var s=this.meta;var sid=s.id;var totalRecords=0;if(s.totalProperty){var v=parseInt(eval("o."+s.totalProperty),10);if(!isNaN(v)){totalRecords=v}}var root=s.root?eval("o."+s.root):o;var recordType=this.getRecordType(root);var fields=recordType.prototype.fields;var records=[];for(var i=0;i<root.length;i++){var n=root[i];var values={};var id=(n[sid]!==undefined&&n[sid]!==""?n[sid]:null);for(var j=0,jlen=fields.length;j<jlen;j++){var f=fields.items[j];var map=f.mapping||f.name;var v=n[map]!==undefined?n[map]:f.defaultValue;v=f.convert(v);values[f.name]=v}var record=new recordType(values,id);record.json=n;records[records.length]=record}return{records:records,totalRecords:totalRecords||records.length}}});Wtf.grid.DynamicColumnModel7=function(A,D){this.cols1=[];var G=A.recordType;var C=G.prototype.fields;for(var B=0;B<C.keys.length;B++){var F=C.keys[B];var E=G.getField(F);if(F.match("Name")){var E=G.getField(F);this.appendFirst1={header:E.name,dataIndex:E.name,id:"Name",width:100,renderer:function(L,K,J,M,I,H){return L}}}else{if(F.match("Matric Number")){var E=G.getField(F);this.appendFirst2={header:E.name,dataIndex:E.name,width:100}}else{if(F.match("Nationality")){var E=G.getField(F);this.appendFirst3={header:E.name,dataIndex:E.name,width:100}}else{this.cols1.push({header:E.name,dataIndex:E.name})}}}}if(this.appendFirst3){this.cols1.unshift(this.appendFirst3)}if(this.appendFirst2){this.cols1.unshift(this.appendFirst2)}if(this.appendFirst1){this.cols1.unshift(this.appendFirst1)}Wtf.grid.DynamicColumnModel7.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel7,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.ScoreRep=function(A){Wtf.apply(this,A);this.sessionRecord=Wtf.data.Record.create([{name:"sessionid",type:"string"},{name:"sessionname",type:"string"}]);this.sessionReader=new Wtf.data.KwlJsonReader({root:"data"},this.sessionRecord);this.sessionStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/LacaStructure.jsp"}),baseParams:{flag:"41"},reader:this.sessionReader});this.sessionCmb=new Wtf.form.ComboBox({store:this.sessionStore,editable:false,displayField:"sessionname",mode:"local",triggerAction:"all",emptyText:"Select a session...",valueField:"sessionid",allowBlank:false});this.courseRecord=Wtf.data.Record.create([{name:"courseid",type:"string"},{name:"coursename",type:"string"}]);this.courseReader=new Wtf.data.KwlJsonReader({root:"data"},this.courseRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/reportNew.jsp"}),baseParams:{mode:"30"},reader:this.courseReader});this.courseCmb=new Wtf.form.ComboBox({store:this.courseStore,editable:false,displayField:"coursename",mode:"local",triggerAction:"all",emptyText:"Select a course...",valueField:"courseid",allowBlank:false});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){if(this.grid!=undefined){this.centerPanel.remove(this.grid)}this.loadMask.show();this.loadGrid()}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.courseCmb.setValue("");this.sessionCmb.setValue("");this.centerPanel.remove(this.grid)}});this.bttnArr=[];if(this.mode==12){this.programStore=new Wtf.data.Store({url:"jspfiles/reportNew.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["programid","programname"])});this.programStore.load({params:{mode:31}});this.programCmb=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"programid",displayField:"programname",store:this.programStore,emptyText:"Select a program..."});this.bttnArr.push("Program ");this.bttnArr.push(this.programCmb);this.programCmb.on("select",this.handleProgSelect,this)}this.bttnArr.push("Session ");this.bttnArr.push(this.sessionCmb);this.bttnArr.push("Course ");this.bttnArr.push(this.courseCmb);this.bttnArr.push(this.submitBttn);this.bttnArr.push(this.clearBttn);Wtf.ScoreRep.superclass.constructor.call(this,{layout:"fit",border:false,items:[this.centerPanel=new Wtf.Panel({layout:"fit",border:false,region:"center",tbar:this.bttnArr,frame:false})]});this.on("render",this.renderGrids,this)};Wtf.extend(Wtf.ScoreRep,Wtf.Panel,{onRender:function(A){Wtf.ScoreRep.superclass.onRender.call(this,A)},renderGrids:function(){this.sessionStore.load();if(this.mode==13){this.courseStore.load({params:{mode:30,repmode:this.mode}})}this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."})},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,sessionid:this.sessionCmb.getValue(),courseid:this.courseCmb.getValue(),venueid:""}},this,function(request){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader2({root:"data",totalProperty:"count"});jreader.readRecords(resObj);this.ds=new Wtf.data.Store({reader:jreader,url:"jspfiles/reportNew.jsp",baseParams:{mode:this.mode,flag:true}});this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel7(this.ds,this.examSM);this.grid=new Wtf.grid.GridPanel({loadMask:this.loadMask,border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,bbar:this.pg=new Wtf.PagingToolbar({pageSize:25,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:["-",this.printBttn=new Wtf.Toolbar.Button({text:"Print",scope:this,disabled:false,handler:this.printReport}),this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var str=Wtf.urlEncode({mode:this.mode,progid:this.mode==12?this.programCmb.getValue():"",acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),venueid:"",type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+str)}})]}),viewConfig:{autoFill:true}});this.centerPanel.add(this.grid);this.ds.baseParams={mode:this.mode,sessionid:this.sessionCmb.getValue(),courseid:this.courseCmb.getValue(),venueid:"",flag:true};this.ds.loadData(resObj)}this.doLayout();this.loadMask.hide()}}},function(){this.loadMask.hide()})},handleProgSelect:function(B,A){this.courseCmb.reset();this.courseStore.removeAll();this.courseStore.load({params:{mode:30,progid:A.data.programid,repmode:this.mode}})},printReport:function(){var A=Wtf.urlEncode({mode:this.mode,progid:this.mode==12?this.programCmb.getValue():"",acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),venueid:"",limit:this.pP.combo.value,fileName:"Analysis_Of_Employee_Result_By_Learning_Center.pdf"});setDldUrl("ReportsServlet.jsp?"+A)}});Wtf.grid.DynamicColumnModel8=function(A){this.cols1=[];var F=A.recordType;var C=F.prototype.fields;for(var B=0;B<C.keys.length;B++){var E=C.keys[B];var D=F.getField(E);if(E.match("Course/Module")){this.appendFirst={header:D.name,dataIndex:D.name}}else{if(E.search("% of change")!=-1){if(this.appendLast){this.appendLast1={header:D.name,dataIndex:D.name}}else{this.appendLast={header:D.name,dataIndex:D.name}}}else{this.cols1.push({header:D.name,dataIndex:D.name})}}}if(this.appendSecond){this.cols1.unshift(this.appendSecond)}if(this.appendFirst){this.cols1.unshift(this.appendFirst)}if(this.appendLast1){this.cols1.push(this.appendLast1)}if(this.appendLast){this.cols1.push(this.appendLast)}this.cols1.unshift(new Wtf.grid.RowNumberer({}));Wtf.grid.DynamicColumnModel8.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel8,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.SessionResultRep=function(A){Wtf.apply(this,A);this.programStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","appfee","exemptiontype","programtype","feetype","auditper"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:1}});this.programCmb=new Wtf.form.ComboBox({id:"prog"+this.id,store:this.programStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a program...",fieldLabel:"Program",name:"id",valueField:"id"});this.sessionRecord=Wtf.data.Record.create([{name:"sessionid",type:"string"},{name:"sessionname",type:"string"}]);this.sessionReader=new Wtf.data.KwlJsonReader({root:"data"},this.sessionRecord);this.sessionStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/LacaStructure.jsp"}),baseParams:{flag:"41"},reader:this.sessionReader});this.sessionCmb=new Wtf.form.ComboBox({store:this.sessionStore,editable:false,displayField:"sessionname",mode:"local",triggerAction:"all",emptyText:"Select a session...",valueField:"sessionid",allowBlank:false});this.courseRecord=Wtf.data.Record.create([{name:"courseid",type:"string"},{name:"coursename",type:"string"}]);this.courseReader=new Wtf.data.KwlJsonReader({root:"data"},this.courseRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/reportNew.jsp"}),baseParams:{mode:"34"},reader:this.courseReader});this.courseCmb=new Wtf.form.ComboBox({store:this.courseStore,editable:false,displayField:"coursename",mode:"local",triggerAction:"all",emptyText:"Select a course...",valueField:"courseid",allowBlank:false});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.loadMask.show();if(this.ds!=undefined){this.ds.removeAll()}this.northP.remove(this.grid);this.loadGrid()}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.reset();this.sessionCmb.reset();this.courseCmb.reset();this.northP.remove(this.grid);this.southP.el.dom.firstChild.firstChild.innerHTML=""}});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,progid:this.programCmb.getValue(),acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}}});this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){var B=Wtf.urlEncode({mode:this.mode,progid:this.programCmb.getValue(),acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),fileName:"Employee_Result_Analysis.pdf"});setDldUrl("ReportsServlet.jsp?"+B)}});this.programCmb.on("select",this.handleProgSelect,this);Wtf.SessionResultRep.superclass.constructor.call(this,{layout:"border",border:false,tbar:[" Session ",this.sessionCmb,"Program ",this.programCmb,"Course",this.courseCmb,this.submitBttn,this.clearBttn],bbar:[this.print,"-",this.csv],items:[this.northP=new Wtf.Panel({border:true,region:"center",bodyStyle:"background-color:#FFFFFF",layout:"fit"}),{border:true,region:"south",layout:"fit",bodyStyle:"background-color:#FFFFFF",title:"Graph",height:210,items:this.southP=new Wtf.Panel({border:false,layout:"fit"})}]})};Wtf.extend(Wtf.SessionResultRep,Wtf.Panel,{onRender:function(A){Wtf.SessionResultRep.superclass.onRender.call(this,A);this.programStore.load();this.sessionStore.load();this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."});if(Wtf.isIE){this.ownerCt.addListener("activate",this.handleActivate,this)}},handleActivate:function(A){A.doLayout();var B=this.southP.ownerCt.getSize().height<210?210:this.southP.ownerCt.getSize().height;this.southP.ownerCt.setHeight(B);A.doLayout()},handleProgSelect:function(B,A){this.courseCmb.reset();this.courseStore.removeAll();this.courseStore.load({params:{progid:A.data.id}})},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,courseid:this.courseCmb.getValue(),sessionid:this.sessionCmb.getValue(),progid:this.programCmb.getValue()}},this,function(request){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds=new Wtf.data.Store({reader:jreader});this._reader=jreader;this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel8(this.ds);this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,viewConfig:{autoFill:true}});this.northP.add(this.grid);this.ds.loadData(resObj.data);var graphdata1='<div><img style = "" align="center" src ="'+resObj.imgurl+'"</img></div>';this.southP.el.dom.firstChild.firstChild.innerHTML=graphdata1}this.doLayout();this.loadMask.hide()}}},function(resp,req){this.loadMask.hide()})}});Wtf.grid.DynamicColumnModel15=function(A){this.cols1=[];var F=A.recordType;var C=F.prototype.fields;for(var B=0;B<C.keys.length;B++){var E=C.keys[B];var D=F.getField(E);if(E.match("Employee Name")){this.appendFirst={header:D.name,dataIndex:D.name}}else{if(E.match("Employee Id")){this.appendSecond={header:D.name,dataIndex:D.name}}else{this.cols1.push({header:D.name,dataIndex:D.name})}}}if(this.appendSecond){this.cols1.unshift(this.appendSecond)}if(this.appendFirst){this.cols1.unshift(this.appendFirst)}this.cols1.unshift(new Wtf.grid.RowNumberer({}));Wtf.grid.DynamicColumnModel15.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel15,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.grid.DynamicColumnModelSum=function(A){this.cols1=[];var F=A.recordType;var C=F.prototype.fields;C.keys=C.keys.sort();for(var B=0;B<C.keys.length;B++){var E=C.keys[B];var D=F.getField(E);if(E.match("Course/Module")){this.appendFirst={header:D.name,dataIndex:D.name}}else{if(E.match("Total")){this.appendLast={header:D.name,dataIndex:D.name}}else{this.cols1.push({header:D.name,dataIndex:D.name})}}}if(this.appendSecond){this.cols1.unshift(this.appendSecond)}if(this.appendFirst){this.cols1.unshift(this.appendFirst)}if(this.appendLast){this.cols1.push(this.appendLast)}this.cols1.unshift(new Wtf.grid.RowNumberer({}));Wtf.grid.DynamicColumnModelSum.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModelSum,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.ResultSummaryRep=function(A){Wtf.apply(this,A);this.programStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["name","code","duration","id","note","appfee","exemptiontype","programtype","feetype","auditper"]),autoLoad:false,url:"jspfiles/admin/LacaStructure.jsp",baseParams:{flag:1}});this.programCmb=new Wtf.form.ComboBox({id:"prog"+this.id,store:this.programStore,editable:false,displayField:"name",mode:"local",triggerAction:"all",emptyText:"Select a program...",fieldLabel:"Program",name:"id",valueField:"id"});this.sessionRecord=Wtf.data.Record.create([{name:"sessionid",type:"string"},{name:"sessionname",type:"string"}]);this.sessionReader=new Wtf.data.KwlJsonReader({root:"data"},this.sessionRecord);this.sessionStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/LacaStructure.jsp"}),baseParams:{flag:"41"},reader:this.sessionReader});this.sessionCmb=new Wtf.form.ComboBox({store:this.sessionStore,editable:false,displayField:"sessionname",mode:"local",triggerAction:"all",emptyText:"Select a session...",valueField:"sessionid",allowBlank:false});this.courseRecord=Wtf.data.Record.create([{name:"courseid",type:"string"},{name:"coursename",type:"string"}]);this.courseReader=new Wtf.data.KwlJsonReader({root:"data"},this.courseRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/reportNew.jsp"}),baseParams:{mode:"34"},reader:this.courseReader});this.courseCmb=new Wtf.form.ComboBox({store:this.courseStore,editable:false,displayField:"coursename",mode:"local",triggerAction:"all",emptyText:"Select a course...",valueField:"courseid",allowBlank:false});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.loadMask.show();if(this.ds!=undefined){this.ds.removeAll()}if(this.ds1!=undefined){this.ds1.removeAll()}this.northP.remove(this.grid);this.southWP.remove(this.grid1);this.loadGrid();this.loadGrid1()}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.reset();this.sessionCmb.reset();this.courseCmb.reset();this.northP.remove(this.grid);this.southWP.remove(this.grid1);this.southEP.el.dom.firstChild.firstChild.innerHTML=""}});this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,progid:this.programCmb.getValue(),acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),type:"reports",dtype:"attachment",report:this.mode});setDldUrl("fileDownload.jsp?"+B)}}});this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){var B=Wtf.urlEncode({mode:this.mode,moduleid:this.modId,progid:this.programCmb.getValue(),acad:this.sessionCmb.getValue(),part:this.courseCmb.getValue(),fileName:"Employee_Result_Summary_Report.pdf"});setDldUrl("ReportsServlet.jsp?"+B)}});this.programCmb.on("select",this.handleProgSelect,this);Wtf.ResultSummaryRep.superclass.constructor.call(this,{layout:"border",border:false,bodyStyle:"background-color:#FFFFFF",tbar:[" Session ",this.sessionCmb,"Program ",this.programCmb,"Course",this.courseCmb,this.submitBttn,this.clearBttn],bbar:[this.print,"-",this.csv],items:[{layout:"fit",border:true,region:"center",bodyStyle:"background-color:#FFFFFF",items:this.northP=new Wtf.Panel({border:false,layout:"fit"})},{layout:"border",border:true,region:"south",bodyStyle:"background-color:#FFFFFF",height:200,id:"southp"+this.id,items:[{layout:"fit",border:true,region:"west",width:300,title:"Result Summary",items:this.southWP=new Wtf.Panel({border:false,layout:"fit"})},{layout:"fit",border:true,region:"center",title:"Graph",items:this.southEP=new Wtf.Panel({border:false,layout:"fit"})}]}]})};Wtf.extend(Wtf.ResultSummaryRep,Wtf.Panel,{onRender:function(A){Wtf.ResultSummaryRep.superclass.onRender.call(this,A);this.programStore.load();this.sessionStore.load();this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."});if(Wtf.isIE){this.ownerCt.addListener("activate",this.handleActivate,this)}},handleActivate:function(A){A.doLayout();var C=Wtf.getCmp("southp"+this.id).getSize().height<200?200:Wtf.getCmp("southp"+this.id).getSize().height;Wtf.getCmp("southp"+this.id).setHeight(C);A.doLayout();var B=this.southWP.ownerCt.getSize().width<300?300:this.southWP.ownerCt.getSize().width;this.southWP.ownerCt.setWidth(B);A.doLayout()},handleProgSelect:function(B,A){this.courseCmb.reset();this.courseStore.removeAll();this.courseStore.load({params:{progid:A.data.id}})},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:this.mode,courseid:this.courseCmb.getValue(),sessionid:this.sessionCmb.getValue(),progid:this.programCmb.getValue()}},this,function(request){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds=new Wtf.data.Store({reader:jreader});this._reader=jreader;this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel15(this.ds);this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,sm:this.examSM,viewConfig:{autoFill:true}});this.northP.add(this.grid);this.ds.loadData(resObj.data)}this.doLayout()}}},function(resp,req){})},loadGrid1:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:35,courseid:this.courseCmb.getValue(),sessionid:this.sessionCmb.getValue(),progid:this.programCmb.getValue()}},this,function(request,response){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader({});jreader.readRecords(resObj.data);this.ds1=new Wtf.data.Store({reader:jreader});this._reader1=jreader;this.ds1.recordType=jreader.recordType;this.ds1.fields=jreader.recordType.prototype.fields;this.cm1=new Wtf.grid.DynamicColumnModelSum(this.ds1);this.grid1=new Wtf.grid.GridPanel({border:false,store:this.ds1,enableColumnHide:false,enableColumnMove:false,cm:this.cm1,viewConfig:{autoFill:true}});this.southWP.add(this.grid1);this.ds1.loadData(resObj.data);var graphdata1='<div><img style = "" align="center" src ="'+resObj.imgurl+'"</img></div>';this.southEP.el.dom.firstChild.firstChild.innerHTML=graphdata1}this.doLayout();this.loadMask.hide()}}},function(resp,req){this.loadMask.hide()})}});Wtf.StudSponsor=function(A){Wtf.apply(this,A);this.sortindex="";this.dir=0;this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Employee Name",dataIndex:"Registered Employee"},{header:"Employee ID",dataIndex:"Employee ID"},{header:"Contact No.",dataIndex:"Contact No",sortable:false},{header:"Program",dataIndex:"Program",sortable:false},{header:"Nationality",dataIndex:"Nationality"},{header:"Funding Method",dataIndex:"Funding Method",sortable:false},{header:"Fee Plan",dataIndex:"Fee Plan",sortable:false},{header:"Sponsor",dataIndex:"Sponsor"}]);this.ds=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Registered Employee","Employee ID","Contact No","Program","Nationality","Funding Method","Fee Plan","Sponsor"]),url:"jspfiles/reportNew.jsp",baseParams:{mode:4,progid:"",funding:"",sponsor:"",fromdate:"",todate:"",sortindex:this.sortindex,dir:this.dir}});this.programStore=new Wtf.data.Store({url:"jspfiles/admin/acastructure.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["programid","programname"])});this.programStore.on("load",function(B){var D=new Wtf.data.Record.create(["programid","programname"]);var C=new D({programid:"",programname:"All"});B.addSorted(C);this.programCmb.setValue("")},this);this.programStore.load({params:{type:20}});this.programCmb=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"programid",displayField:"programname",store:this.programStore,emptyText:"Select a program..."});this.fundingStore=new Wtf.data.SimpleStore({fields:["fundmeth","name"],data:[["Krawler-Funding","Krawler-Funding"],["Self-funding","Self-funding"],["Sponsorship","Sponsorship"]]});this.fundingCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"fundmeth",displayField:"name",store:this.fundingStore,emptyText:"Select a Funding Method..."});this.sponsorStore=new Wtf.data.Store({url:"jspfiles/admin/acastructure.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["code","name"])});this.sponsorStore.load({params:{type:99}});this.sponsorCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"code",displayField:"name",store:this.sponsorStore,emptyText:"Select a sponsor..."});this.fromDate=new Wtf.form.DateField({fieldLabel:"From",id:"DateFrom"+this.id,format:Wtf.getDateFormat()});this.toDate=new Wtf.form.DateField({fieldLabel:"To",id:"DateTo"+this.id,format:Wtf.getDateFormat()});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.ds.baseParams={mode:4,progid:this.programCmb.getValue(),funding:this.fundingCombo.getValue(),sponsor:this.sponsorCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.setValue("");this.fundingCombo.setValue("");this.sponsorCombo.setValue("");this.fromDate.setValue("");this.toDate.setValue("");this.ds.baseParams={mode:4,progid:"",funding:"",sponsor:"",fromdate:"",todate:"",sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});Wtf.StudSponsor.superclass.constructor.call(this,{layout:"fit",border:false,tbar:["Program: ",this.programCmb,"-","Funding method:",this.fundingCombo],items:[this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,cm:this.cm,viewConfig:{autoFill:true},loadMask:{msg:"Loading..."},tbar:["Sponsor:",this.sponsorCombo,"-","Applied:","From ",this.fromDate,"   To ",this.toDate,"-",this.submitBttn,this.clearBttn],bbar:this.pg=new Wtf.PagingToolbar({pageSize:25,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:[this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({mode:4,progid:this.programCmb.getValue(),funding:this.fundingCombo.getValue(),sponsor:this.sponsorCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),sortindex:this.sortindex,dir:this.dir,fileName:"Employee_Sponsor_List.pdf"});setDldUrl("ReportsServlet.jsp?"+B)}}}),"-",this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var B=Wtf.urlEncode({progid:this.programCmb.getValue(),funding:this.fundingCombo.getValue(),sponsor:this.sponsorCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),sortindex:this.sortindex,dir:this.dir,type:"reports",dtype:"attachment",report:"studentsponsor"});setDldUrl("fileDownload.jsp?"+B)}}})]})})]});this.grid.on("headerclick",function(C,B,E){if(C.colModel.config[B].sortable==false){return }var D=Wtf.get(E.getTarget().id);if(!this.prevTarget||this.prevTarget!==D){if(this.prevTarget){if(this.prevTarget.hasClass("sort-asc")){this.prevTarget.removeClass("sort-asc")}else{if(this.prevTarget.hasClass("sort-desc")){this.prevTarget.removeClass("sort-desc")}}}this.prevTarget=D}if(D.hasClass("sort-asc")){D.addClass("sort-desc");D.removeClass("sort-asc");this.dir=1}else{D.addClass("sort-asc");D.addClass("x-grid3-hd-inner");if(D.hasClass("sort-desc")){D.removeClass("sort-desc")}this.dir=0}this.sortindex=C.colModel.config[B].dataIndex;this.ds.baseParams={mode:4,progid:this.programCmb.getValue(),funding:this.fundingCombo.getValue(),sponsor:this.sponsorCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})},this)};Wtf.extend(Wtf.StudSponsor,Wtf.Panel,{onRender:function(A){Wtf.StudSponsor.superclass.onRender.call(this,A);this.ds.load({params:{start:0,limit:25}})}});Wtf.accountReport=function(B){Wtf.apply(this,B);this.sortindex="";this.dir=0;var A=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Type","Employee Name","Date","Invoice No","Amount"]);var D=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Type","Employee Name","Date","Invoice No","Payment No","Payment Mode","Amount"]);this.ds=new Wtf.data.GroupingStore({url:"jspfiles/reportNew.jsp",baseParams:{mode:5,progid:"",type:"",fromdate:"",todate:"",flag:this.flag,sortindex:this.sortindex,dir:this.dir},reader:D,sortInfo:{field:"Type",direction:"ASC"},groupField:"Type"});this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{dataIndex:"Type",groupable:this.flag==2?true:false,sortable:this.flag==2?true:false,hidden:this.flag==2?false:true},{header:"Employee Name",dataIndex:"Employee Name",sortable:false},{header:"Date",dataIndex:"Date"},{header:this.flag==2?"Document No.":"Invoice No.",dataIndex:"Invoice No",sortable:false},{header:"Payment No.",dataIndex:"Payment No",sortable:false,hidden:this.flag==1?false:true},{header:"Payment Mode",dataIndex:"Payment Mode",hidden:this.flag==1?false:true},{header:"Amount",dataIndex:"Amount",sortable:false,align:"right",summaryType:"sum",summaryRenderer:function(E){E=E+"";if(E!=null&&E!=""){return"Total: "+Wtf.precisionDecimalValue(E)}else{return"Total: "+E}},renderer:function(E){E=E+"";if(E!=null&&E!=""){return Wtf.precisionDecimalValue(E)}else{return E}}}]);this.groupingView=new Wtf.grid.GroupingView({forceFit:true,showGroupName:false,enableGroupingMenu:false,hideGroupedColumn:true});this.summary=new Wtf.grid.GroupSummary({});this.programStore=new Wtf.data.Store({url:"jspfiles/admin/acastructure.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["programid","programname"])});this.programStore.on("load",function(E){var G=new Wtf.data.Record.create(["programid","programname"]);var F=new G({programid:"",programname:"All"});E.addSorted(F);this.programCmb.setValue("")},this);this.programStore.load({params:{type:20}});this.programCmb=new Wtf.form.ComboBox({triggerAction:"all",editable:false,width:140,mode:"local",valueField:"programid",displayField:"programname",store:this.programStore,emptyText:"Select a program..."});this.typeStore=new Wtf.data.JsonStore({url:"CountryList.jsp",root:"data",fields:["id","name"]});this.accStore=new Wtf.data.Store({url:"jspfiles/admin/acastructure.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["accid","accountname"])});if(this.flag==2){this.accStore.load({params:{type:69,typeid:9}})}else{this.typeStore.load({params:{mode:this.flag==0?"feetype":"paymode"}})}this.typeCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,width:140,mode:"local",valueField:this.flag==2?"accid":"id",displayField:this.flag==2?"accountname":"name",store:this.flag==2?this.accStore:this.typeStore,emptyText:this.flag==0?"Select a fee type...":this.flag==1?"Select paymode...":"Select an account..."});this.fromDate=new Wtf.form.DateField({fieldLabel:"From",format:Wtf.getDateFormat()});this.toDate=new Wtf.form.DateField({fieldLabel:"To",format:Wtf.getDateFormat()});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.ds.baseParams={mode:5,progid:this.programCmb.getValue(),type:this.typeCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.setValue("");this.typeCombo.setValue("");this.fromDate.setValue("");this.toDate.setValue("");this.ds.baseParams={mode:5,progid:"",type:"",fromdate:"",todate:"",flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});var C=this.flag==0?"Fee Type: ":this.flag==1?"Paymode: ":"Account: ";Wtf.accountReport.superclass.constructor.call(this,{layout:"fit",border:false,items:[this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,cm:this.cm,view:this.groupingView,plugins:this.summary,loadMask:{msg:"Loading..."},tbar:["Program: ",this.programCmb,"-",C,this.typeCombo,"-","Applied:","From ",this.fromDate,"   To ",this.toDate,"-",this.submitBttn,this.clearBttn],bbar:this.pg=new Wtf.PagingToolbar({pageSize:15,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:[this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var E=Wtf.urlEncode({mode:5,progid:this.programCmb.getValue(),type:this.typeCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir,fileName:this.flag==0?"Account_Receivable_Report.pdf":this.flag==1?"Payment_Mode_Report.pdf":"Income_Report.pdf"});setDldUrl("ReportsServlet.jsp?"+E)}}}),"-",this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var E=Wtf.urlEncode({progid:this.programCmb.getValue(),paytype:this.typeCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir,type:"reports",dtype:"attachment",report:"getAccountReport"});setDldUrl("fileDownload.jsp?"+E)}}})]})})]});this.grid.on("headerclick",function(F,E,H){if(F.colModel.config[E].sortable==false){return }var G=Wtf.get(H.getTarget().id);if(!this.prevTarget||this.prevTarget!==G){if(this.prevTarget){if(this.prevTarget.hasClass("sort-asc")){this.prevTarget.removeClass("sort-asc")}else{if(this.prevTarget.hasClass("sort-desc")){this.prevTarget.removeClass("sort-desc")}}}this.prevTarget=G}if(G.hasClass("sort-asc")){G.addClass("sort-desc");G.removeClass("sort-asc");this.dir=1}else{G.addClass("sort-asc");G.addClass("x-grid3-hd-inner");if(G.hasClass("sort-desc")){G.removeClass("sort-desc")}this.dir=0}this.sortindex=F.colModel.config[E].dataIndex;this.ds.baseParams={mode:5,progid:this.programCmb.getValue(),type:this.typeCombo.getValue(),fromdate:this.fromDate.getRawValue(),todate:this.toDate.getRawValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})},this)};Wtf.extend(Wtf.accountReport,Wtf.Panel,{onRender:function(A){Wtf.accountReport.superclass.onRender.call(this,A);this.ds.load({params:{start:0,limit:15}})}});Wtf.GraduationReport=function(B){Wtf.apply(this,B);this.sortindex="";this.dir=0;var A=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Employee Name","Employee ID","Contact No","Nationality","Country","Intake Session","Graduation Date",this.flag?"Degree":"Final Result"]);this.ds=new Wtf.data.Store({url:"jspfiles/reportNew.jsp",baseParams:{mode:6,progid:"",year:"",acad:"",flag:this.flag,sortindex:this.sortindex,dir:this.dir},reader:A});this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Employee Name",dataIndex:"Employee Name"},{header:"Employee ID",dataIndex:"Employee ID"},{header:"Contact No",dataIndex:"Contact No",sortable:false},{header:"Nationality",dataIndex:"Nationality"},{header:"Country",dataIndex:"Country",sortable:false},{header:"Intake Session",dataIndex:"Intake Session",sortable:false},{header:"Graduation Date",dataIndex:"Graduation Date"},{header:this.flag?"Degree":"Final Result",dataIndex:this.flag?"Degree":"Final Result",sortable:false}]);if(!this.flag){this.cm.config[7].sortable=false}this.programStore=new Wtf.data.Store({url:"jspfiles/admin/acastructure.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["programid","programname"])});this.programStore.on("load",function(C){var E=new Wtf.data.Record.create(["programid","programname"]);var D=new E({programid:"",programname:"All"});C.addSorted(D);this.programCmb.setValue("")},this);this.programStore.load({params:{type:20}});this.programCmb=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"programid",displayField:"programname",store:this.programStore,emptyText:"Select a program..."});this.yearStore=new Wtf.data.SimpleStore({data:[],fields:["name","id"]});if(this.flag){this.fillYearStore("2006",new Date().getFullYear())}this.gradYear=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",store:this.yearStore,valueField:"id",displayField:"name",emptyText:"Select Graduation Year..."});this.acadStore=new Wtf.data.JsonStore({url:"CountryList.jsp",root:"data",fields:["id","name"]});this.acadStore.load({params:{mode:"intake"}});this.acadCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"id",displayField:"name",store:this.acadStore,emptyText:"Select an Training Session..."});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.ds.baseParams={mode:6,progid:this.programCmb.getValue(),year:this.flag?this.gradYear.getValue():"",acad:this.acadCombo.getValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.programCmb.setValue("");this.gradYear.setValue("");this.acadCombo.setValue("");this.ds.baseParams={mode:6,progid:"",year:"",acad:"",flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});this.tbar=this.flag?["Program: ",this.programCmb,"-","Year: ",this.gradYear,"-","Training Session: ",this.acadCombo,"-",this.submitBttn,this.clearBttn]:["Program: ",this.programCmb,"-","Training Session: ","-",this.acadCombo,this.submitBttn,this.clearBttn];Wtf.GraduationReport.superclass.constructor.call(this,{layout:"fit",border:false,items:[this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,cm:this.cm,viewConfig:{autoFill:true},loadMask:{msg:"Loading..."},bbar:this.pg=new Wtf.PagingToolbar({pageSize:15,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:[this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var C=Wtf.urlEncode({mode:6,progid:this.programCmb.getValue(),year:this.flag?this.gradYear.getValue():"",acad:this.acadCombo.getValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir,fileName:this.flag?"gelm_Graduates.pdf":"Graduating_Students.pdf"});setDldUrl("ReportsServlet.jsp?"+C)}}}),"-",this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var C=Wtf.urlEncode({progid:this.programCmb.getValue(),year:this.flag?this.gradYear.getValue():"",acad:this.acadCombo.getValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir,type:"reports",dtype:"attachment",report:"getGraduateReport"});setDldUrl("fileDownload.jsp?"+C)}}})]})})]});this.grid.on("headerclick",function(D,C,F){if(D.colModel.config[C].sortable==false){return }var E=Wtf.get(F.getTarget().id);if(!this.prevTarget||this.prevTarget!==E){if(this.prevTarget){if(this.prevTarget.hasClass("sort-asc")){this.prevTarget.removeClass("sort-asc")}else{if(this.prevTarget.hasClass("sort-desc")){this.prevTarget.removeClass("sort-desc")}}}this.prevTarget=E}if(E.hasClass("sort-asc")){E.addClass("sort-desc");E.removeClass("sort-asc");this.dir=1}else{E.addClass("sort-asc");E.addClass("x-grid3-hd-inner");if(E.hasClass("sort-desc")){E.removeClass("sort-desc")}this.dir=0}this.sortindex=D.colModel.config[C].dataIndex;this.ds.baseParams={mode:6,progid:this.programCmb.getValue(),year:this.flag?this.gradYear.getValue():"",acad:this.acadCombo.getValue(),flag:this.flag,sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})},this)};Wtf.extend(Wtf.GraduationReport,Wtf.Panel,{onRender:function(A){Wtf.GraduationReport.superclass.onRender.call(this,A);this.ds.load({params:{start:0,limit:15}})},fillYearStore:function(D,A){this.yearStore.removeAll();var B=Wtf.data.Record.create([{name:"id"},{name:"name"}]);for(var C=A;C>=D;C--){this.yearStore.add(new B({id:C,name:C}))}}});Wtf.data.DynamicJsonReader2=function(A){Wtf.data.DynamicJsonReader2.superclass.constructor.call(this,A,[])};Wtf.extend(Wtf.data.DynamicJsonReader2,Wtf.data.JsonReader,{getRecordType:function(D){var C=0,A=[];for(var B in D[0]){A[C++]=B}this.recordType=Wtf.data.Record.create(A);return this.recordType},readRecords:function(o){this.jsonData=o;var s=this.meta;var sid=s.id;var totalRecords=0;if(s.totalProperty){var v=parseInt(eval("o."+s.totalProperty),10);if(!isNaN(v)){totalRecords=v}}var root=s.root?eval("o."+s.root):o;var recordType=this.getRecordType(root);var fields=recordType.prototype.fields;var records=[];for(var i=0;i<root.length;i++){var n=root[i];var values={};var id=(n[sid]!==undefined&&n[sid]!==""?n[sid]:null);for(var j=0,jlen=fields.length;j<jlen;j++){var f=fields.items[j];var map=f.mapping||f.name;var v=n[map]!==undefined?n[map]:f.defaultValue;v=f.convert(v);values[f.name]=v}var record=new recordType(values,id);record.json=n;records[records.length]=record}return{records:records,totalRecords:totalRecords||records.length}}});Wtf.grid.DynamicColumnModel111=function(B){this.cols1=[];var A=[];var G=B.recordType;var D=G.prototype.fields;String.prototype.startsWith=function(H){return(this.match("^"+H)==H)};for(var C=0;C<D.keys.length;C++){var F=D.keys[C];var E=G.getField(F);if(F.match("Registered Employee")){var E=G.getField(F);this.appendFirst1={header:E.name,dataIndex:E.name,width:300}}else{if(F.match("Employee ID")){var E=G.getField(F);this.appendFirst2={header:E.name,dataIndex:E.name,width:300}}else{if(F.match("IC/Passport No")){var E=G.getField(F);this.appendFirst3={header:E.name,dataIndex:E.name,sortable:false,width:300}}else{if(F.match("Contact No")){var E=G.getField(F);this.appendFirst4={header:E.name,dataIndex:E.name,sortable:false,width:300}}else{if(F.match("Nationality")){var E=G.getField(F);this.appendFirst5={header:E.name,dataIndex:E.name,width:300}}else{if(F.startsWith("Reg ")){var E=G.getField(F);A[A.length]={header:E.name,dataIndex:E.name,sortable:false,width:300}}else{this.cols1.push({header:E.name,dataIndex:E.name,sortable:false})}}}}}}}if(this.appendFirst5){this.cols1.unshift(this.appendFirst5)}if(this.appendFirst4){this.cols1.unshift(this.appendFirst4)}if(this.appendFirst3){this.cols1.unshift(this.appendFirst3)}if(this.appendFirst2){this.cols1.unshift(this.appendFirst2)}if(this.appendFirst1){this.cols1.unshift(this.appendFirst1)}this.cols1.unshift(new Wtf.grid.RowNumberer());for(var C=A.length-1;C>=0;C--){this.cols1.push(A[C])}Wtf.grid.DynamicColumnModel111.superclass.constructor.call(this,this.cols1)};Wtf.extend(Wtf.grid.DynamicColumnModel111,Wtf.grid.ColumnModel,{getConfig:function(){return this.cols1}});Wtf.RegDetails=function(A){Wtf.apply(this,A);this.sortindex="";this.dir=0;this.acadStore=new Wtf.data.JsonStore({url:"CountryList.jsp",root:"data",fields:["id","name"]});this.acadCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"id",displayField:"name",store:this.acadStore,emptyText:"Select an Training Session..."});this.partStore=new Wtf.data.Store({url:"jspfiles/reportNew.jsp",reader:new Wtf.data.KwlJsonReader({root:"data"},["id","name"])});this.partStore.on("load",function(B,C){this.partCombo.setValue(C[0].data.id);if(this.rendered){this.loadMask.show();this.loadGrid()}},this);this.acadStore.on("load",function(B){var D=new Wtf.data.Record.create(["id","name"]);var C=new D({id:"",name:"All"});B.addSorted(C);this.acadCombo.setValue("");this.partStore.load({params:{mode:7}})},this);this.acadStore.load({params:{mode:"intake"}});this.partCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"id",displayField:"name",store:this.partStore,emptyText:"Select an Training Part..."});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){if(this.grid!=undefined){this.remove(this.grid)}this.loadMask.show();this.loadGrid()}});this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",scope:this,handler:function(){this.partCombo.setValue("");this.acadCombo.setValue("");this.ds.baseParams={mode:1,part:"",acad:"",sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});Wtf.RegDetails.superclass.constructor.call(this,{border:false,layout:"fit",tbar:["Training Session: ",this.acadCombo,"-","Part: ",this.partCombo,"-",this.submitBttn]})};Wtf.extend(Wtf.RegDetails,Wtf.Panel,{onRender:function(A){Wtf.RegDetails.superclass.onRender.call(this,A);this.loadMask=new Wtf.LoadMask(this.id,{msg:"Loading..."})},loadGrid:function(){Wtf.Ajax.requestEx({url:"jspfiles/reportNew.jsp",method:"POST",params:{mode:1,part:this.partCombo.getValue(),acad:this.acadCombo.getValue(),sortindex:this.sortindex,dir:this.dir}},this,function(request){if(request!=null&&request!=""){var resObj=eval("("+request.trim()+")");if(resObj){if(resObj.data!==undefined){var jreader=new Wtf.data.DynamicJsonReader2({root:"data",totalProperty:"count"});jreader.readRecords(resObj);this.ds=new Wtf.data.Store({reader:jreader,url:"jspfiles/reportNew.jsp",baseParams:{mode:1,part:this.partCombo.getValue(),acad:this.acadCombo.getValue(),sortindex:this.sortindex,dir:this.dir}});this.ds.recordType=jreader.recordType;this.ds.fields=jreader.recordType.prototype.fields;this.cm=new Wtf.grid.DynamicColumnModel111(this.ds);this.grid=new Wtf.grid.GridPanel({loadMask:this.loadMask,border:false,store:this.ds,enableColumnHide:false,enableColumnMove:false,cm:this.cm,bbar:this.pg=new Wtf.PagingToolbar({pageSize:15,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:["-",this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var str=Wtf.urlEncode({mode:1,part:this.partCombo.getValue(),acad:this.acadCombo.getValue(),sortindex:this.sortindex,dir:this.dir,limit:this.pP.combo.value,fileName:"Module_Registration_Details.pdf"});setDldUrl("ReportsServlet.jsp?"+str)}}}),this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var str=Wtf.urlEncode({part:this.partCombo.getValue(),acad:this.acadCombo.getValue(),sortindex:this.sortindex,dir:this.dir,type:"reports",dtype:"attachment",report:"getRegistrationReport"});setDldUrl("fileDownload.jsp?"+str)}}})]}),viewConfig:{autoFill:true}});this.add(this.grid);this.ds.baseParams={mode:1,part:this.partCombo.getValue(),acad:this.acadCombo.getValue(),sortindex:this.sortindex,dir:this.dir};this.ds.loadData(resObj)}this.doLayout();this.loadMask.hide()}}},function(){this.loadMask.hide()})}});Wtf.CourseRegReport=function(B){Wtf.apply(this,B);this.sortindex="";this.dir=0;var A=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"count"},["Registered Employee","Employee ID","IC/Passport No","Contact No","Nationality","code","course"]);this.ds=new Wtf.data.GroupingStore({url:"jspfiles/reportNew.jsp",baseParams:{mode:2,progid:"",acad:"",course:"",sortindex:this.sortindex,dir:this.dir},reader:A,sortInfo:{field:"code",direction:"ASC"},groupField:"code"});this.cm=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Registered Employee",dataIndex:"Registered Employee"},{header:"Employee ID",dataIndex:"Employee ID"},{header:"IC/Passport No",dataIndex:"IC/Passport No",sortable:false},{header:"Contact No",dataIndex:"Contact No",sortable:false},{header:"Nationality",dataIndex:"Nationality"},{dataIndex:"code",groupable:true},{header:"",dataIndex:"course",sortable:false,align:"center",summaryType:"sum",summaryRenderer:function(C){return"Total: "+C}}]);this.groupingView=new Wtf.grid.GroupingView({forceFit:true,showGroupName:false,enableGroupingMenu:false,hideGroupedColumn:true});this.summary=new Wtf.grid.GroupSummary({});this.programStore=new Wtf.data.Store({url:"jspfiles/reportNew.jsp",baseParams:{mode:9,type:1},reader:new Wtf.data.KwlJsonReader({root:"data"},["id","name"])});this.programCmb=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"id",displayField:"name",store:this.programStore,emptyText:"Select a program..."});this.programCmb.on("select",function(C){this.courseStore.removeAll();this.courseStore.load({params:{progid:C.getValue(),acad:this.acadCombo.getValue()}})},this);this.acadStore=new Wtf.data.JsonStore({url:"CountryList.jsp",root:"data",fields:["id","name"]});this.acadCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,mode:"local",valueField:"id",displayField:"name",store:this.acadStore,emptyText:"Select an Training Session..."});this.acadCombo.on("select",function(C){this.courseStore.removeAll();this.courseStore.load({params:{progid:this.programCmb.getValue(),acad:C.getValue()}})},this);this.courseStore=new Wtf.data.Store({url:"jspfiles/reportNew.jsp",baseParams:{mode:8},reader:new Wtf.data.KwlJsonReader({root:"data"},["id","name"])});this.courseStore.on("load",this.courseLoad,this);this.acadStore.on("load",function(C){var E=new Wtf.data.Record.create(["id","name"]);var D=new E({id:"",name:"All"});C.addSorted(D);this.acadCombo.setValue("");this.courseStore.load()},this);this.programStore.on("load",function(C){var E=new Wtf.data.Record.create(["id","name"]);var D=new E({id:"",name:"All"});C.addSorted(D);this.programCmb.setValue("");this.acadStore.load({params:{mode:"intake"}})},this);this.programStore.load();this.courseCombo=new Wtf.form.ComboBox({triggerAction:"all",editable:false,width:220,mode:"local",valueField:"id",displayField:"name",store:this.courseStore,emptyText:"Select a Course..."});this.submitBttn=new Wtf.Toolbar.Button({text:"Submit",scope:this,handler:function(){this.cm.setColumnHeader(7,this.courseStore.getAt(this.courseStore.find("id",this.courseCombo.getValue())).data.name);this.ds.baseParams={mode:2,progid:this.programCmb.getValue(),acad:this.acadCombo.getValue(),course:this.courseCombo.getValue(),sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}});this.tbar=["Program: ",this.programCmb,"-","Training Session: ",this.acadCombo,"-","Course: ",this.courseCombo,"-",this.submitBttn];Wtf.CourseRegReport.superclass.constructor.call(this,{layout:"fit",border:false,items:[this.grid=new Wtf.grid.GridPanel({border:false,store:this.ds,enableColumnHide:false,cm:this.cm,view:this.groupingView,plugins:this.summary,loadMask:{msg:"Loading..."},bbar:this.pg=new Wtf.PagingToolbar({pageSize:15,store:this.ds,displayInfo:true,displayMsg:"Displaying items {0} - {1} of {2}",emptyMsg:"No items to display",plugins:this.pP=new Wtf.common.pPageSize({}),items:[this.print=new Wtf.Toolbar.Button({text:"Print",scope:this,handler:function(){if(this.ds.getCount()>0){var C=Wtf.urlEncode({mode:2,progid:this.programCmb.getValue(),acad:this.acadCombo.getValue(),course:this.courseCombo.getValue(),sortindex:this.sortindex,dir:this.dir,fileName:"Course_Registration_Details.pdf"});setDldUrl("ReportsServlet.jsp?"+C)}}}),"-",this.csv=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){if(this.ds.getCount()>0){var C=Wtf.urlEncode({progid:this.programCmb.getValue(),acad:this.acadCombo.getValue(),course:this.courseCombo.getValue(),sortindex:this.sortindex,dir:this.dir,type:"reports",dtype:"attachment",report:"getCourseRegReport"});setDldUrl("fileDownload.jsp?"+C)}}})]})})]});this.grid.on("headerclick",function(D,C,F){if(D.colModel.config[C].sortable==false){return }var E=Wtf.get(F.getTarget().id);if(!this.prevTarget||this.prevTarget!==E){if(this.prevTarget){if(this.prevTarget.hasClass("sort-asc")){this.prevTarget.removeClass("sort-asc")}else{if(this.prevTarget.hasClass("sort-desc")){this.prevTarget.removeClass("sort-desc")}}}this.prevTarget=E}if(E.hasClass("sort-asc")){E.addClass("sort-desc");E.removeClass("sort-asc");this.dir=1}else{E.addClass("sort-asc");E.addClass("x-grid3-hd-inner");if(E.hasClass("sort-desc")){E.removeClass("sort-desc")}this.dir=0}this.sortindex=D.colModel.config[C].dataIndex;this.ds.baseParams={mode:2,progid:this.programCmb.getValue(),acad:this.acadCombo.getValue(),course:this.courseCombo.getValue(),sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})},this)};Wtf.extend(Wtf.CourseRegReport,Wtf.Panel,{courseLoad:function(A,B){this.courseCombo.setValue(B[0].data.id);this.cm.setColumnHeader(7,B[0].data.name);if(this.rendered){this.ds.baseParams={mode:2,progid:this.programCmb.getValue(),acad:this.acadCombo.getValue(),course:this.courseCombo.getValue(),sortindex:this.sortindex,dir:this.dir};this.ds.load({params:{start:0,limit:this.pP.combo.value}})}A.removeListener("load",this.courseLoad,this);A.on("load",function(C,D){this.courseCombo.setValue(D[0].data.id)},this)}})