Wtf.ReportGrid=function(A){Wtf.apply(this,A);this.FirstAttemptFlag=true;Wtf.ReportGrid.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ReportGrid,Wtf.Panel,{initComponent:function(A){Wtf.ReportGrid.superclass.initComponent.call(this)},DisplayReport:function(response){var obj=eval("("+response.trim()+")");this.temprecord=Wtf.data.Record.create(this.createFields(obj.columnheader));this.jsonReader=new Wtf.data.JsonReader({root:"data",totalProperty:"count"},this.temprecord);this.simstore=new Wtf.data.Store({proxy:new Wtf.data.PagingMemoryProxy([]),reader:this.jsonReader,remoteSort:true});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"_reportGrid",ds:this.simstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true,enableRowBody:true,showPreview:true},bbar:new Wtf.PagingToolbar({pageSize:25,emptyMsg:"No records to display",store:this.simstore,displayInfo:true,displayMsg:"Displaying Records {0} - {1} of {2}",emptyMsg:"No records to display"})});this.simstore.proxy.data=obj;this.simstore.load({params:{start:0,limit:25}});this.add(this.reportGrid);this.doLayout();if(this.reporttype=="registeredstudent"){this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var str=Wtf.urlEncode({reptype:"registeredstudent",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+str)}});this.reportGrid.getBottomToolbar().add(this.csv1)}if(this.reporttype=="offeredstudent"){this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var str=Wtf.urlEncode({reptype:"offeredstudent",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+str)}});this.reportGrid.getBottomToolbar().add(this.csv1)}},onRender:function(A){Wtf.ReportGrid.superclass.onRender.call(this,A);if(this.FirstAttemptFlag){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype}},this,function(B,C){this.DisplayReport(B)},function(C,B){});this.FirstAttemptFlag=false}},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C}});Wtf.CustomReportPanel=function(A){Wtf.apply(this,A);Wtf.CustomReportPanel.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.CustomReportPanel,Wtf.Panel,{initComponent:function(){Wtf.CustomReportPanel.superclass.initComponent.call(this)},createCombo:function(A){this.combostore=new Wtf.data.SimpleStore({fields:this.createFields(A.columnheader),data:A.data});this.comboBoxDates=new Wtf.form.ComboBox({anchor:"98%",mode:"local",triggerAction:"all",typeAhead:true,editable:false,store:this.combostore,fieldLabel:this.combofieldLabel.toString()+"*",displayField:"name",valueField:"id",allowBlank:false,msgTarget:"side"});this.comboBoxDates.setValue(this.combostore.getAt(0).data["id"]);this.comboBoxDates.on("select",this.onComboChange,this);Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:this.comboBoxDates.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},onComboChange:function(C,A,B){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:A.data.id}},this,function(D,E){Wtf.getCmp("centerGridRegion").remove(this.reportGrid);this.createGrid(D);Wtf.getCmp("centerGridRegion").add(this.reportGrid);this.doLayout()},function(E,D){})},getComboboxData:function(tablename){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"retrivetableentry",tablename:tablename}},this,function(response,e){this.createCombo(eval("("+response.trim()+")"))},function(resp,req){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.simstore=new Wtf.data.JsonStore({fields:this.createFields(obj.columnheader),data:obj.data});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"_reportGrid",ds:this.simstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}})},onRender:function(A){Wtf.CustomReportPanel.superclass.onRender.call(this,A);this.getComboboxData(this.tablename)},DisplayReport:function(){this.panel={border:false,layout:"border",items:[{title:this.combofieldLabel,region:"north",height:0,border:false,layout:"fit",bodyStyle:"background:#f1f1f1;",tbar:[this.combofieldLabel.toString()+"* :",this.comboBoxDates]},{region:"center",autoScroll:true,id:"centerGridRegion",bodyStyle:"background:#f1f1f1;font-size:10px;",border:false,layout:"fit",items:this.reportGrid}]};this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C}});Wtf.ExamReportPanel=function(A){Wtf.apply(this,A);Wtf.ExamReportPanel.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ExamReportPanel,Wtf.Panel,{initComponent:function(){Wtf.ExamReportPanel.superclass.initComponent.call(this);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.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,minWidth:30});this.criBttn.on("click",this.onComboChange,this);this.sessionCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.sessionStore,mode:"local",readOnly:true,displayField:"sessionname",fieldLabel:"Session*",hiddenName:"sessionid",valueField:"sessionid",allowBlank:false,emptyText:"Select a session..."});this.comboRecord=Wtf.data.Record.create([{name:"id",type:"string"},{name:"name",type:"string"}]);this.comboReader=new Wtf.data.KwlJsonReader({root:"data"},this.comboRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/report.jsp"}),baseParams:{type:"retrivetableentry",tablename:"course"},reader:this.comboReader});this.comboBoxDates=new Wtf.form.ComboBox({anchor:"98%",mode:"local",triggerAction:"all",typeAhead:true,editable:false,store:this.courseStore,fieldLabel:"CIFP Courses*",displayField:"name",valueField:"id",allowBlank:false,msgTarget:"side",emptyText:"Select a course..."});this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var A=Wtf.urlEncode({courseid:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue(),reptype:"exam",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+A)}})},onComboChange:function(){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(A,B){Wtf.getCmp("centerGridRegion").remove(this.reportGrid);this.createGrid(A);Wtf.getCmp("centerGridRegion").add(this.reportGrid);this.doLayout()},function(B,A){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.temprecord=Wtf.data.Record.create(this.createFields(obj.columnheader));this.jsonReader=new Wtf.data.JsonReader({root:"data",totalProperty:"count"},this.temprecord);this.simstore=new Wtf.data.Store({proxy:new Wtf.data.PagingMemoryProxy([]),reader:this.jsonReader,remoteSort:true});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"_reportGrid",ds:this.simstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true,enableRowBody:true,showPreview:true},bbar:new Wtf.PagingToolbar({pageSize:25,emptyMsg:"No records to display",store:this.simstore,displayInfo:true,displayMsg:"Displaying Records {0} - {1} of {2}",emptyMsg:"No records to display"})});this.simstore.proxy.data=obj;this.simstore.load({params:{start:0,limit:25}})},onRender:function(A){Wtf.ExamReportPanel.superclass.onRender.call(this,A);this.sessionStore.load();this.courseStore.load();Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},DisplayReport:function(){this.panel={border:false,layout:"border",items:[{title:this.combofieldLabel,region:"north",height:0,border:false,layout:"fit",bodyStyle:"background:#f1f1f1;",tbar:[this.combofieldLabel.toString()+"* :",this.comboBoxDates,"-","Session* :",this.sessionCombo,"-",this.criBttn,"-",this.csv1]},{region:"center",autoScroll:true,id:"centerGridRegion",bodyStyle:"background:#f1f1f1;font-size:10px;",border:false,layout:"fit",items:this.reportGrid}]};this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C}});Wtf.ExamDeferPanel=function(A){Wtf.apply(this,A);Wtf.ExamDeferPanel.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ExamDeferPanel,Wtf.Panel,{initComponent:function(){Wtf.ExamDeferPanel.superclass.initComponent.call(this);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.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,minWidth:30});this.criBttn.on("click",this.onComboChange,this);this.sessionCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.sessionStore,mode:"local",readOnly:true,displayField:"sessionname",fieldLabel:"Session*",hiddenName:"sessionid",valueField:"sessionid",allowBlank:false,emptyText:"Select a session..."});this.comboRecord=Wtf.data.Record.create([{name:"id",type:"string"},{name:"name",type:"string"}]);this.comboReader=new Wtf.data.KwlJsonReader({root:"data"},this.comboRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/report.jsp"}),baseParams:{type:"retrivetableentry",tablename:"course"},reader:this.comboReader});this.comboBoxDates=new Wtf.form.ComboBox({anchor:"98%",mode:"local",triggerAction:"all",typeAhead:true,editable:false,store:this.courseStore,fieldLabel:"CIFP Courses*",displayField:"name",valueField:"id",allowBlank:false,msgTarget:"side",emptyText:"Select a course..."});this.deferstore=new Wtf.data.SimpleStore({fields:[{name:"type"},{name:"name"}],data:[["4","Deferred"],["6","Exempted"],["18","Withdrawn"]]});this.comboBoxType=new Wtf.form.ComboBox({anchor:"98%",mode:"local",triggerAction:"all",typeAhead:true,editable:false,store:this.deferstore,fieldLabel:"Type*",displayField:"name",valueField:"type",allowBlank:false,msgTarget:"side",emptyText:"Select a type..."});this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var A=Wtf.urlEncode({courseid:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue(),dtypeval:this.comboBoxType.getValue(),dtypename:this.comboBoxType.getRawValue(),reptype:"defer",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+A)}})},onComboChange:function(){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue(),dtype:this.comboBoxType.getValue()}},this,function(A,B){Wtf.getCmp("centerGridRegion").remove(this.reportGrid);this.createGrid(A);Wtf.getCmp("centerGridRegion").add(this.reportGrid);this.doLayout()},function(B,A){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.temprecord=Wtf.data.Record.create(this.createFields(obj.columnheader));this.jsonReader=new Wtf.data.JsonReader({root:"data",totalProperty:"count"},this.temprecord);this.simstore=new Wtf.data.Store({proxy:new Wtf.data.PagingMemoryProxy([]),reader:this.jsonReader,remoteSort:true});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"_reportGrid",ds:this.simstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true,enableRowBody:true,showPreview:true},bbar:new Wtf.PagingToolbar({pageSize:25,emptyMsg:"No records to display",store:this.simstore,displayInfo:true,displayMsg:"Displaying Records {0} - {1} of {2}",emptyMsg:"No records to display"})});this.simstore.proxy.data=obj;this.simstore.load({params:{start:0,limit:25}})},onRender:function(A){Wtf.ExamDeferPanel.superclass.onRender.call(this,A);this.sessionStore.load();this.courseStore.load();Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype,filterval:this.comboBoxDates.getValue(),sessionid:this.sessionCombo.getValue(),dtype:this.comboBoxType.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},DisplayReport:function(){this.panel={border:false,layout:"border",items:[{title:this.combofieldLabel,region:"north",height:0,border:false,layout:"fit",bodyStyle:"background:#f1f1f1;",tbar:[this.combofieldLabel.toString()+"* :",this.comboBoxDates,"-","Type:*",this.comboBoxType,"Session* :",this.sessionCombo,"-",this.criBttn,"-",this.csv1]},{region:"center",autoScroll:true,id:"centerGridRegion",bodyStyle:"background:#f1f1f1;font-size:10px;",border:false,layout:"fit",items:this.reportGrid}]};this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C}});Wtf.GroupingReportGrid=function(A){Wtf.apply(this,A);this.FirstAttemptFlag=true;Wtf.GroupingReportGrid.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.GroupingReportGrid,Wtf.Panel,{initComponent:function(A){Wtf.GroupingReportGrid.superclass.initComponent.call(this)},DisplayReport:function(response){var obj=eval("("+response.trim()+")");this.simstore=new Wtf.data.GroupingStore({reader:this.createFields(obj.columnheader),data:obj.data,groupField:this.groupField,sortInfo:{field:this.sortfield,direction:"desc"}});this.GroupingReportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"GroupingReportGrid",ds:this.simstore,autoScroll:true,collapsible:true,layout:"fit",viewConfig:{forceFit:true,autoFill:true},view:new Wtf.grid.GroupingView({forceFit:true,groupTextTpl:'{text} ({[values.rs.length]} {[values.rs.length > 1 ? "Items" : "Item"]})'}),loadMask:{msg:"Loading..."}});this.add(this.GroupingReportGrid);this.doLayout()},onRender:function(A){Wtf.GroupingReportGrid.superclass.onRender.call(this,A);if(this.FirstAttemptFlag){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:this.reporttype}},this,function(B,C){this.DisplayReport(B)},function(C,B){});this.FirstAttemptFlag=false}},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return(new Wtf.data.ArrayReader({},C))},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C}});Wtf.ClassRegReport=function(A){Wtf.apply(this,A);this.FirstAttemptFlag=true;Wtf.ClassRegReport.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ClassRegReport,Wtf.Panel,{initComponent:function(A){Wtf.ClassRegReport.superclass.initComponent.call(this);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.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,minWidth:30});this.criBttn.on("click",this.onComboValChange,this);this.sessionCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.sessionStore,mode:"local",readOnly:true,displayField:"sessionname",fieldLabel:"Session*",hiddenName:"sessionid",valueField:"sessionid",allowBlank:false,emptyText:"Select a session..."});this.comboRecord=Wtf.data.Record.create([{name:"id",type:"string"},{name:"name",type:"string"}]);this.comboReader=new Wtf.data.KwlJsonReader({root:"data"},this.comboRecord);this.courseStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/report.jsp"}),baseParams:{type:"retrivetableentry",tablename:"course"},reader:this.comboReader});this.classStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/report.jsp"}),baseParams:{type:"retrivetableentry",tablename:"classtype"},reader:this.comboReader});this.comboBoxCourse=new Wtf.form.ComboBox({fieldLabel:"Courses*",triggerAction:"all",typeAhead:true,editable:false,store:this.courseStore,displayField:"name",valueField:"id",readOnly:true,emptyText:"Select a CIFP course...",allowBlank:false});this.classtypeCombo=new Wtf.form.ComboBox({triggerAction:"all",typeAhead:true,editable:false,store:this.classStore,fieldLabel:"Classes*",displayField:"name",valueField:"id",readOnly:true,emptyText:"Select a class type...",allowBlank:false});this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var B=Wtf.urlEncode({courseid:this.comboBoxCourse.getValue(),classtypeid:this.classtypeCombo.getValue(),classname:this.classtypeCombo.getRawValue(),sessionid:this.sessionCombo.getValue(),reptype:"class",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+B)}})},onRender:function(A){Wtf.ClassRegReport.superclass.onRender.call(this,A);this.courseStore.load();this.classStore.load();this.sessionStore.load();Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"classregistration",courseid:this.comboBoxCourse.getValue(),classtypeid:this.classtypeCombo.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.temprecord=Wtf.data.Record.create(this.createFields(obj.columnheader));this.jsonReader=new Wtf.data.JsonReader({root:"data",totalProperty:"count"},this.temprecord);this.simstore=new Wtf.data.Store({proxy:new Wtf.data.PagingMemoryProxy([]),reader:this.jsonReader,remoteSort:true});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),id:this.id+"_reportGrid",ds:this.simstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true,enableRowBody:true,showPreview:true},bbar:new Wtf.PagingToolbar({pageSize:25,emptyMsg:"No records to display",store:this.simstore,displayInfo:true,displayMsg:"Displaying Records {0} - {1} of {2}",emptyMsg:"No records to display"})});this.simstore.proxy.data=obj;this.simstore.load({params:{start:0,limit:25}})},DisplayReport:function(){this.panel={border:false,layout:"border",items:[{title:"Criteria",region:"north",height:0,border:false,layout:"fit",bodyStyle:"background:#f1f1f1;",tbar:["Courses* :",this.comboBoxCourse,"-","Classes* :",this.classtypeCombo,"-","Session* :",this.sessionCombo,"-",this.criBttn,"-",this.csv1]},{region:"center",autoScroll:true,id:"centerClasaRegRegion",bodyStyle:"background:#f1f1f1;font-size:10px;",border:false,layout:"fit",items:this.reportGrid}]};this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["width"]=70;A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C},onComboValChange:function(C,A,B){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"classregistration",courseid:this.comboBoxCourse.getValue(),classtypeid:this.classtypeCombo.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(D,E){Wtf.getCmp("centerClasaRegRegion").remove(this.reportGrid);this.createGrid(D);Wtf.getCmp("centerClasaRegRegion").add(this.reportGrid);this.doLayout()},function(E,D){})}});Wtf.candidateVenueList=function(A){Wtf.apply(this,A);this.FirstAttemptFlag=true;Wtf.candidateVenueList.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.candidateVenueList,Wtf.Panel,{initComponent:function(A){Wtf.candidateVenueList.superclass.initComponent.call(this);this.moduleRecord=Wtf.data.Record.create([{name:"coursename",type:"string"},{name:"courseid",type:"string"},{name:"programid",type:"string"}]);this.moduleReader=new Wtf.data.KwlJsonReader({root:"data"},this.moduleRecord);this.moduleStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newCourse.jsp"}),reader:this.moduleReader});this.programRecord=Wtf.data.Record.create([{name:"programid",type:"string"},{name:"programname",type:"string"}]);this.programReader=new Wtf.data.KwlJsonReader({root:"data"},this.programRecord);this.programStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/acastructure.jsp"}),reader:this.programReader});this.programCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.programStore,mode:"local",readOnly:true,displayField:"programname",fieldLabel:"Program*",hiddenName:"programid",valueField:"programid",allowBlank:false,emptyText:"Select a program..."});this.courseCombo=new Wtf.form.ComboBox({id:"course"+this.id,store:this.moduleStore,readOnly:true,displayField:"coursename",mode:"local",triggerAction:"all",emptyText:"Select a course...",fieldLabel:"Course/Group*",name:"courseid",valueField:"courseid",allowBlank:false});this.courseCombo.on("select",this.onComboValChange,this);this.programCombo.on("select",this.programSelect,this);this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var B=Wtf.urlEncode({programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue(),reptype:"venue",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+B)}})},programSelect:function(B,C,A){this.moduleStore.load({params:{type:"programsessioncourse",programid:C.data["programid"]}})},onRender:function(A){Wtf.candidateVenueList.superclass.onRender.call(this,A);this.programStore.load({params:{type:20}});Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"calndidatevenuelist",programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.classregstore=new Wtf.data.JsonStore({fields:this.createFields(obj.columnheader),data:obj.data});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,title:"Candidate List According To Venue",layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}})},DisplayReport:function(){this.panel={border:false,layout:"border",items:[{title:"Criteria",region:"north",height:0,border:false,tbar:["Program* :",this.programCombo,"-","Course/Group* :",this.courseCombo,"-",this.csv1],bodyStyle:"background:#f1f1f1;"},{region:"center",autoScroll:true,id:"centerClasaRegRegion",bodyStyle:"background:#f1f1f1;font-size:10px;",border:false,layout:"fit",items:this.reportGrid}]};this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];E[E.length]=new Wtf.grid.RowNumberer();for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["sortable"]=false;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C},onComboValChange:function(C,A,B){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"calndidatevenuelist",programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue()}},this,function(D,E){Wtf.getCmp("centerClasaRegRegion").remove(this.reportGrid);this.createGrid(D);Wtf.getCmp("centerClasaRegRegion").add(this.reportGrid);this.doLayout()},function(E,D){})}});Wtf.ExamResultGrid=function(A){Wtf.apply(this,A);Wtf.ExamResultGrid.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ExamResultGrid,Wtf.Panel,{initComponent:function(A){Wtf.ExamResultGrid.superclass.initComponent.call(this);this.moduleRecord=Wtf.data.Record.create([{name:"coursename",type:"string"},{name:"courseid",type:"string"},{name:"programid",type:"string"}]);this.moduleReader=new Wtf.data.KwlJsonReader({root:"data"},this.moduleRecord);this.moduleStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newCourse.jsp"}),reader:this.moduleReader});this.programRecord=Wtf.data.Record.create([{name:"programid",type:"string"},{name:"programname",type:"string"},{name:"programtype"}]);this.programReader=new Wtf.data.KwlJsonReader({root:"data"},this.programRecord);this.programStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/acastructure.jsp"}),reader:this.programReader});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.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,disabled:true,minWidth:30});this.criBttn.on("click",this.onComboValChange,this);this.clearBttn=new Wtf.Toolbar.Button({text:"Clear Filter",tooltip:"Clear selected criteria",id:"btnClear"+this.id,scope:this,minWidth:30});this.clearBttn.on("click",function(){this.programCombo.setValue("");this.courseCombo.setValue("");this.sessionCombo.setValue("");this.criBttn.disable()},this);this.sessionCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.sessionStore,mode:"local",readOnly:true,displayField:"sessionname",fieldLabel:"Session*",hiddenName:"sessionid",valueField:"sessionid",allowBlank:false,emptyText:"Select a session..."});this.programCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.programStore,mode:"local",readOnly:true,displayField:"programname",fieldLabel:"Program*",hiddenName:"programid",valueField:"programid",allowBlank:false,emptyText:"Select a program..."});this.courseCombo=new Wtf.form.ComboBox({id:"course"+this.id,store:this.moduleStore,readOnly:true,displayField:"coursename",mode:"local",triggerAction:"all",emptyText:"Select a course...",fieldLabel:"Course/Group*",name:"courseid",valueField:"courseid",allowBlank:false});this.resultAnaCM=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer({}),{header:"Name",dataIndex:"name"},{header:"A",dataIndex:"pd"},{header:"A %",dataIndex:"pdpercent"},{header:"B",dataIndex:"pass"},{header:"B %",dataIndex:"passpercent"},{header:"F",dataIndex:"fail"},{header:"F %",dataIndex:"failpercent"},{header:"Total",dataIndex:"total"}]);this.resultAnaStore=new Wtf.data.JsonStore({root:"dataanalysis",fields:["name","dist","distpercent","merit","meritpercent","avg","avgpercent","aa","aapercent","pd","pdpercent","pass","passpercent","fail","failpercent","total"],autoLoad:false});this.resultAnalyGrid=new Wtf.grid.GridPanel({ds:this.resultAnaStore,cm:this.resultAnaCM,border:false,loadMask:{msg:"Loading Programs..."},viewConfig:{forceFit:true}});this.programCombo.on("select",this.programSelect,this);this.courseCombo.on("select",this.enableCriteria,this);this.sessionCombo.on("select",this.enableCriteria,this)},enableCriteria:function(){if(this.courseCombo.isValid()&&this.sessionCombo.isValid()){this.criBttn.enable()}},programSelect:function(B,C,A){this.pType=C.get("programtype");this.courseCombo.setValue("");this.moduleStore.load({params:{type:"programsessioncourse",programid:C.data["programid"]}});this.criBttn.disable()},onRender:function(A){Wtf.ExamResultGrid.superclass.onRender.call(this,A);this.programStore.load({params:{type:20}});this.sessionStore.load();Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"examresult",programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(B,C){this.createGrid(B);this.DisplayReport()},function(C,B){})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.classregstore=new Wtf.data.JsonStore({fields:this.createFields(obj.columnheader),data:obj.data});this.temprecord=Wtf.data.Record.create(this.createFields(obj.columnheader));this.jsonReader=new Wtf.data.JsonReader({root:"data",totalProperty:"count"},this.temprecord);this.simstore=new Wtf.data.Store({proxy:new Wtf.data.PagingMemoryProxy([]),reader:this.jsonReader,remoteSort:true});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.simstore,border:false,title:"Exam Result",layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true},bbar:new Wtf.PagingToolbar({pageSize:25,emptyMsg:"No records to display",store:this.simstore,displayInfo:true,displayMsg:"{0} - {1} of {2}",emptyMsg:"No records to display",items:[this.csv1=new Wtf.Toolbar.Button({text:"Export",scope:this,handler:function(){var str=Wtf.urlEncode({programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue(),sessionid:this.sessionCombo.getValue(),reptype:"result",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+str)}})]})});this.simstore.proxy.data=obj;this.simstore.load({params:{start:0,limit:25}});this.resultAnaStore.loadData(obj,false);this.reportGrid2=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}})},makeresultAnalysisGraph:function(F){if(Wtf.getCmp("ResultGraphinnerPanel")){Wtf.getCmp("ResultGraphinnerPanel").destroy()}var A="";var K="";var C="";var G="";var E="";var H="";var J="";if(this.pType==1){for(var D=0;D<F.length;D++){if(F[D].distpercent){G+=F[D].distpercent+","}else{G+=0+","}if(F[D].meritpercent){E+=F[D].meritpercent+","}else{E+=0+","}if(F[D].aapercent){H+=F[D].aapercent+","}else{H+=0+","}if(F[D].avgpercent){J+=F[D].avgpercent+","}else{J+=0+","}if(F[D].failpercent){C+=F[D].failpercent+","}else{C+=0+","}}if(G.length>0){G=G.substr(0,G.length-1)+"|"+E.substr(0,E.length-1)+"|"+H.substr(0,H.length-1)+"|"+J.substr(0,J.length-1)+"|"+C.substr(0,C.length-1)}var B='<div><img id="chartdiv2" src ="http://chart.apis.google.com/chart?cht=bvg&chd=t:'+G+'&chs=1000x200&chbh=10,0,20&chg=100,5&chco=2060FFFF,EE8800,994499,99BBE8,CC3333&chxt=y,x&chxl=0:5|1:1|2&chdl=Distinction|Merit|Above Avg|Avg|Fail&chtt=Percentage+by+Modules"</img></div>'}else{for(var D=0;D<F.length;D++){if(F[D].pdpercent){A+=F[D].pdpercent+","}else{A+=F[D].pdpercent+","}if(F[D].passpercent){K+=F[D].passpercent+","}else{K+=F[D].passpercent+","}if(F[D].failpercent){C+=F[D].failpercent+","}else{C+=F[D].failpercent+","}}if(A.length>0){A=A.substr(0,A.length-1)+"|"+K.substr(0,K.length-1)+"|"+C.substr(0,C.length-1)}var B='<div><img id="chartdiv2" src ="http://chart.apis.google.com/chart?cht=bvg&chd=t:'+A+'&chs=1000x200&chbh=10,0,20&chg=100,5&chco=2060FFFF,8B0000,EED800&chxt=y,x&chxl=0:5|1:1|2&chdl=A|B|F&chtt=Percentage+by+Modules"</img></div>'}document.getElementById("ResultGraphinnerPanelresult").innerHTML=B;var I=new Wtf.Panel({id:"ResultGraphinnerPanel",border:false,layout:"fit",html:B})},DisplayReport:function(){this.panel=new Wtf.Panel({border:false,layout:"fit",border:false,bbar:[],items:[{border:false,autoScroll:true,bodyStyle:"background:transparent;",layout:"fit",title:"Criteria",tbar:["Program* :",this.programCombo,"-","Course/Group* :",this.courseCombo,"-","Session* :",this.sessionCombo,"-",this.criBttn,"-",this.clearBttn],items:[{layout:"border",border:false,items:[{region:"north",id:"centerClasaRegRegion"+this.id,border:false,baseCls:"reportCont",paging:false,autoLoad:false,layout:"fit",split:true,bodyStyle:"background:transparent;",items:[this.reportGrid]},{region:"center",id:"centerRegion_"+this.id,border:false,bodyStyle:"background:transparent;",layout:"border",items:[{region:"center",split:true,border:false,paging:false,autoLoad:false,autoScroll:true,html:"<div id = 'ResultGraphinnerPanelresult'></div>",title:"Result Analysis Graph",bodyStyle:"background:white;"},{region:"west",width:600,title:"Result Analysis Report",paging:false,autoLoad:false,bodyStyle:"background:transparent;",id:"resultanalysisgraph",border:false,layout:"fit",split:true,items:[this.resultAnalyGrid]}]}]}]}]});this.add(this.panel);this.doLayout()},createFields:function(D){var C=[];for(var A=0;A<D.length;A++){var B={};B["name"]=D[A][0];B["type"]="string";B["mapping"]=D[A][0];C[C.length]=B}return C},createColModel:function(B){var E=[];for(var D=0;D<B.length;D++){var A={};A["header"]=B[D][0];A["dataIndex"]=B[D][0];A["sortable"]=true;E[E.length]=A}var C=new Wtf.grid.ColumnModel(E);return C},onComboValChange:function(obj,newval,oldval){Wtf.Ajax.requestEx({url:"jspfiles/report.jsp",method:"GET",params:{type:"examresult",programid:this.programCombo.getValue(),courseid:this.courseCombo.getValue(),sessionid:this.sessionCombo.getValue()}},this,function(response,e){Wtf.getCmp("centerClasaRegRegion"+this.id).remove(this.reportGrid);this.createGrid(response);this.makeresultAnalysisGraph(eval("("+response.trim()+")").dataanalysis);Wtf.getCmp("centerClasaRegRegion"+this.id).add(this.reportGrid);if(this.pType==1){this.resultAnaStore2=new Wtf.data.JsonStore({root:"dataanalysis",fields:["name","dist","distpercent","merit","meritpercent","avg","avgpercent","aa","aapercent","fail","failpercent","total"]});this.resultAnaCM2=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer({}),{header:"Name",dataIndex:"name"},{header:"Distinction",dataIndex:"dist"},{header:"Distinction %",dataIndex:"distpercent"},{header:"Merit",dataIndex:"merit"},{header:"Merit %",dataIndex:"meritpercent"},{header:"Above Average",dataIndex:"aa"},{header:"Above Average %",dataIndex:"aapercent"},{header:"Average",dataIndex:"avg"},{header:"Average %",dataIndex:"avgpercent"},{header:"Fail",dataIndex:"fail"},{header:"Fail %",dataIndex:"failpercent"},{header:"Total",dataIndex:"total"}]);this.resultAnalyGrid.reconfigure(this.resultAnaStore,this.resultAnaCM2)}else{this.resultAnalyGrid.reconfigure(this.resultAnaStore,this.resultAnaCM)}this.doLayout()},function(resp,req){})}});Wtf.ApplicationStatistics=function(A){Wtf.apply(this,A);Wtf.ApplicationStatistics.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.ApplicationStatistics,Wtf.Panel,{initComponent:function(A){Wtf.ApplicationStatistics.superclass.initComponent.call(this);this.programRecord=Wtf.data.Record.create([{name:"programid",type:"string"},{name:"programname",type:"string"}]);this.programReader=new Wtf.data.KwlJsonReader({root:"data"},this.programRecord);this.programStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/acastructure.jsp"}),reader:this.programReader});this.programStore.on("load",function(){this.criBttn.enable()},this);this.programCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.programStore,mode:"local",readOnly:true,displayField:"programname",fieldLabel:"Program*",hiddenName:"programid",valueField:"programid",allowBlank:false,emptyText:"Select a program..."});this.userDate=new Wtf.form.DateField({fieldLabel:"Date*",width:140,allowBlank:false,name:"userdate",format:Wtf.getDateFormat(),value:new Date()});this.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,disabled:true,minWidth:30});this.criBttn.on("click",this.onComboValChange,this);this.csv1=new Wtf.menu.Item({text:"Statistics by Gender",scope:this,handler:function(){var B=Wtf.urlEncode({programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d"),reptype:"gender",type:"reports",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+B)}});this.csv2=new Wtf.menu.Item({text:"Statistics by Religion",scope:this,handler:function(){var B=Wtf.urlEncode({programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d"),type:"reports",reptype:"religion",dtype:"attachment",report:"applicationstatisticscsv"});setDldUrl("fileDownload.jsp?"+B)}});this.gendregionCM=new Wtf.grid.ColumnModel([{header:"Category",dataIndex:"Category"},{header:"Total",dataIndex:"Total"},{header:"Male",dataIndex:"Male"},{header:"Female",dataIndex:"Female"},{header:"Muslim",dataIndex:"Muslim"},{header:"Non Muslim",dataIndex:"Non Muslim"}]);this.gendregionStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["Category","Total","Male","Female","Muslim","Non Muslim"]),autoLoad:false,url:"jspfiles/report.jsp"});this.gendregionStore.on("load",this.makeresultAnalysisGraph,this);this.gendregionGrid=new Wtf.grid.GridPanel({ds:this.gendregionStore,cm:this.gendregionCM,border:false,layout:"fit",autoScroll:true,loadMask:{msg:"Loading..."},viewConfig:{forceFit:true,autoFill:true}});this.nationStaticCM=new Wtf.grid.ColumnModel([{header:"Nationality",dataIndex:"nationality"},{header:"Registered",dataIndex:"registered"},{header:"Offered",dataIndex:"offered"},{header:"Total",dataIndex:"total"}]);this.nationStaticStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["nationality","registered","offered","total"]),autoLoad:false,url:"jspfiles/report.jsp",baseParams:{type:"nationalityStatistics"}});this.nationalityGrid=new Wtf.grid.GridPanel({ds:this.nationStaticStore,cm:this.nationStaticCM,border:false,loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}});this.doLayout()},onRender:function(A){Wtf.ApplicationStatistics.superclass.onRender.call(this,A);this.panel=new Wtf.Panel({border:false,bodyStyle:"background:transparent;",layout:"fit",tbar:["Program   :",this.programCombo,"-","  Date*  :",this.userDate,"-",this.criBttn,"-",this.programOperBttn=new Wtf.Toolbar.Button({text:"Export",tooltip:"Click to open",id:"examscheduleMenu"+this.id,scope:this,menu:[this.csv1,this.csv2]})],items:[{layout:"border",items:[{region:"north",border:false,baseCls:"reportCont",layout:"border",items:[{title:"Student Statistics by Gender and Religion",region:"center",paging:false,autoLoad:false,bodyStyle:"background:transparent;",border:false,layout:"fit",items:[this.gendregionGrid]},{border:false,region:"east",width:500,id:"gendreganalysisgraph",paging:false,split:true,autoLoad:false,autoScroll:true,title:"Student Statistics by Gender (Graph)",html:"<div id = 'ResultGraphinnerPanel1'></div>",layout:"fit",bodyStyle:"background:white;"}]},{region:"center",border:false,baseCls:"reportCont",layout:"border",items:[{title:"Application Statistics",region:"center",paging:false,autoLoad:false,bodyStyle:"background:transparent;",border:false,layout:"fit",split:true,items:[this.nationalityGrid]},{region:"east",width:500,border:false,paging:false,autoLoad:false,split:true,autoScroll:true,id:"natanalysisgraph",html:"<div id = 'ResultGraphinnerPanel'></div>",title:"Student Statistics by Religion (Graph)",layout:"fit",bodyStyle:"background:white;"}]}]}]});this.add(this.panel);this.programStore.load({params:{type:20}})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.classregstore=new Wtf.data.JsonStore({fields:this.createFields(obj.columnheader),data:obj.data});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,title:"Exam Result",layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}});this.resultAnaStore.loadData(obj,false);this.reportGrid2=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}})},makeresultAnalysisGraph:function(){var A="0";var B=this.gendregionStore.getAt(2);if(B.data["Muslim"]!=""){A=(B.data["Muslim"]/B.data["Total"])*100}if(B.data["Non Muslim"]!=""){A+=","+(B.data["Non Muslim"]/B.data["Total"])*100}var C='<div><img style = "padding:50px" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+A+'&chs=350x150&chl=Muslim|NonMuslim&chtt=Student+Statistics+by Religion&chts=0000dd,15"</img></div>';document.getElementById("ResultGraphinnerPanel").innerHTML=C;A="0";if(B.data["Male"]!=""){A=(B.data["Male"]/B.data["Total"])*100}if(B.data["Female"]!=""){A+=","+(B.data["Female"]/B.data["Total"])*100}var D='<div><img style = "padding:50px" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+A+'&chs=350x150&chl=Male|Female&chtt=Student+Statistics+by Gender&chts=0000dd,15"</img></div>';document.getElementById("ResultGraphinnerPanel1").innerHTML=D},onComboValChange:function(C,A,B){this.gendregionStore.load({params:{type:"applicationstatistics",programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d")}});this.nationStaticStore.load({params:{programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d")}})}});Wtf.TutorialAttendance=function(A){Wtf.apply(this,A);Wtf.TutorialAttendance.superclass.constructor.call(this,{border:false})};Wtf.extend(Wtf.TutorialAttendance,Wtf.Panel,{initComponent:function(A){Wtf.TutorialAttendance.superclass.initComponent.call(this);this.moduleRecord=Wtf.data.Record.create([{name:"modulename",type:"string"},{name:"moduleid",type:"string"},{name:"courseid",type:"string"}]);this.moduleReader=new Wtf.data.KwlJsonReader({root:"data"},this.moduleRecord);this.moduleStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/newCourse.jsp"}),reader:this.moduleReader});this.courseRecord=Wtf.data.Record.create([{name:"coursename",type:"string"},{name:"courseid",type:"string"},{name:"programid",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/newCourse.jsp"}),reader:this.courseReader});this.programRecord=Wtf.data.Record.create([{name:"programid",type:"string"},{name:"programname",type:"string"}]);this.programReader=new Wtf.data.KwlJsonReader({root:"data"},this.programRecord);this.programStore=new Wtf.data.Store({proxy:new Wtf.data.HttpProxy({url:"jspfiles/admin/acastructure.jsp"}),reader:this.programReader});this.programStore.on("load",function(){this.criBttn.enable()},this);this.programCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.programStore,mode:"local",readOnly:true,displayField:"programname",fieldLabel:"Program*",valueField:"programid",allowBlank:false,emptyText:"Select a program..."});this.courseCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.courseStore,mode:"local",readOnly:true,displayField:"coursename",fieldLabel:"Course*",valueField:"courseid",allowBlank:false,emptyText:"Select a course..."});this.moduleCombo=new Wtf.form.ComboBox({triggerAction:"all",store:this.moduleStore,mode:"local",readOnly:true,displayField:"modulename",fieldLabel:"Module*",valueField:"moduleid",allowBlank:false,emptyText:"Select a module..."});this.userDate=new Wtf.form.DateField({fieldLabel:"Date*",allowBlank:false,format:"F, Y",value:new Date()});this.criBttn=new Wtf.Toolbar.Button({text:"Submit",tooltip:"Search according to criteria",id:"btnNew1"+this.id,scope:this,disabled:true,minWidth:30});this.criBttn.on("click",this.onComboValChange,this);this.nationStaticCM=new Wtf.grid.ColumnModel([{header:"Nationality",dataIndex:"nationality"},{header:"Registered",dataIndex:"registered"},{header:"Provisional Offered",dataIndex:"offered"},{header:"Total",dataIndex:"total"}]);this.nationStaticStore=new Wtf.data.Store({reader:new Wtf.data.KwlJsonReader({root:"data"},["nationality","registered","offered","total"]),autoLoad:false,url:"jspfiles/report.jsp",baseParams:{type:"nationalityStatistics"}});this.nationalityGrid=new Wtf.grid.GridPanel({ds:this.nationStaticStore,cm:this.nationStaticCM,border:false,loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}});this.panel=new Wtf.Panel({border:false,bodyStyle:"background:transparent;",layout:"border",items:[{title:"Criteria",region:"north",height:120,border:false,layout:"form",bodyStyle:"background:#f1f1f1;",items:[{border:false,layout:"column",bodyStyle:"padding:5px 5px 5px 5px;background:transparent;",items:[{columnWidth:0.4,layout:"form",border:false,bodyStyle:"background:transparent;",items:this.programCombo},{columnWidth:0.3,layout:"form",border:false,bodyStyle:"background:transparent;",items:this.courseCombo},{columnWidth:0.3,layout:"form",border:false,bodyStyle:"background:transparent;",items:this.moduleCombo}]},{border:false,layout:"column",bodyStyle:"padding:5px 5px 5px 5px;background:transparent;",items:[{columnWidth:0.4,layout:"form",border:false,bodyStyle:"background:transparent;",items:this.userDate},{columnWidth:0.3,layout:"form",border:false,bodyStyle:"background:transparent;",items:this.criBttn}]}]},{region:"center",autoScroll:true,bodyStyle:"background:transparent;",layout:"fit",items:this.nationalityGrid}]});this.add(this.panel);this.panel.doLayout();this.doLayout()},onRender:function(A){Wtf.TutorialAttendance.superclass.onRender.call(this,A);this.programStore.load({params:{type:20}});this.courseStore.load({params:{type:"allcourses"}});this.programStore.load({params:{type:"allmodules"}})},createGrid:function(response){var obj=eval("("+response.trim()+")");this.classregstore=new Wtf.data.JsonStore({fields:this.createFields(obj.columnheader),data:obj.data});this.reportGrid=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,title:"Exam Result",layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}});this.resultAnaStore.loadData(obj,false);this.reportGrid2=new Wtf.grid.GridPanel({cm:this.createColModel(obj.columnheader),ds:this.classregstore,border:false,layout:"fit",loadMask:{msg:"Loading..."},viewConfig:{forceFit:true}})},makeresultAnalysisGraph:function(){if(Wtf.getCmp("ResultGraphinnerPanel")){Wtf.getCmp("ResultGraphinnerPanel").destroy()}if(Wtf.getCmp("ResultGraphinnerPanel1")){Wtf.getCmp("ResultGraphinnerPanel1").destroy()}var A="0";var B=this.gendregionStore.getAt(2);if(B.data["Muslim"]!=""){A=B.data["Muslim"]}if(B.data["Non Muslim"]!=""){A+=","+B.data["Non Muslim"]}var E='<div "><img style = "padding:50px" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+A+'&chs=350x150&chl=Muslim|NonMuslim"</img></div>';var D=new Wtf.Panel({id:"ResultGraphinnerPanel",border:false,layout:"fit",html:E});Wtf.getCmp("natanalysisgraph").add(D);Wtf.getCmp("natanalysisgraph").doLayout();A="0";if(B.data["Male"]!=""){A=B.data["Male"]}if(B.data["Female"]!=""){A+=","+B.data["Female"]}var F='<div "><img style = "padding:50px" src ="http://chart.apis.google.com/chart?cht=p3&chd=t:'+A+'&chs=350x150&chl=Male|Female"</img></div>';var C=new Wtf.Panel({id:"ResultGraphinnerPanel1",border:false,layout:"fit",html:F});Wtf.getCmp("gendreganalysisgraph").add(C);Wtf.getCmp("gendreganalysisgraph").doLayout()},onComboValChange:function(C,A,B){this.gendregionStore.load({params:{type:"applicationstatistics",programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d")}});this.nationStaticStore.load({params:{programid:this.programCombo.getValue(),userdate:this.userDate.getValue().format("Y-m-d")}})}});Wtf.EmployeeList=function(A){Wtf.EmployeeList.superclass.constructor.call(this,A)};Wtf.extend(Wtf.EmployeeList,Wtf.Panel,{onRender:function(A){Wtf.EmployeeList.superclass.onRender.call(this,A);this.designationSM=new Wtf.grid.CheckboxSelectionModel({singleSelect:true});this.designationCM=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),this.designationSM,{header:"Designation",dataIndex:"designation"},{header:"Current Requirement",dataIndex:"vacancies"},{header:"Vacancies",dataIndex:"requirement"},{header:"Designationid",dataIndex:"desigid",hidden:true}]);this.designationCM.defaultSortable=true;this.designationStore=new Wtf.data.Store({totalProperty:"Count",reader:new Wtf.data.KwlJsonReader({root:"data"},["designation","desigid","vacancies","requirement"]),autoLoad:false,url:"jspfiles/report.jsp",baseParams:{type:"designationlist"}});this.designationGrid=new Wtf.grid.GridPanel({ds:this.designationStore,cm:this.designationCM,border:false,sm:this.designationSM,loadMask:{msg:"Loading Designations..."},viewConfig:{forceFit:true},bbar:this.pgd=new Wtf.PagingSearchToolbar({pageSize:15,searchField:this.qPSdesignation,store:this.designationStore,displayInfo:true,displayMsg:"Displaying records {0} - {1} of {2}",emptyMsg:"No results to display",plugins:this.pPd=new Wtf.common.pPageSize({})})});this.designationStore.load({params:{start:this.pgd.cursor,limit:15}});this.employeeSM=new Wtf.grid.CheckboxSelectionModel({singleSelect:true});this.employeeCM=new Wtf.grid.ColumnModel([new Wtf.grid.RowNumberer(),{header:"Employee Name",dataIndex:"employeename"},{header:"Email Id",dataIndex:"emailid"}]);this.employeeRecord=Wtf.data.Record.create([{name:"employeename",type:"string"},{name:"emailid",type:"string"}]);this.employeeReader=new Wtf.data.KwlJsonReader({root:"data",totalProperty:"Count"},this.employeeRecord);this.employeeStore=new Wtf.data.Store({reader:this.employeeReader,autoLoad:false,url:"jspfiles/report.jsp",baseParams:{type:"employeelist"}});this.employeeGrid=new Wtf.grid.GridPanel({ds:this.employeeStore,cm:this.employeeCM,border:false,sm:this.employeeSM,loadMask:{msg:"Loading Employees..."},viewConfig:{forceFit:true},bbar:this.pg=new Wtf.PagingSearchToolbar({pageSize:15,searchField:this.qPSemployee,store:this.employeeStore,displayInfo:true,displayMsg:"Displaying records {0} - {1} of {2}",emptyMsg:"No results to display",plugins:this.pP=new Wtf.common.pPageSize({})})});this.employeeStore.load({params:{start:this.pg.cursor,limit:this.pP.value}});this.innerPanel=new Wtf.Panel({layout:"border",border:false,bodyStyle:"background:transparent;",items:[{region:"north",id:"northRegion_"+this.id,border:false,title:"Designations",height:350,layout:"fit",bodyStyle:"background:transparent;",items:[this.designationGrid],tbar:["Quick Search: ",this.qPSdesignation=new Wtf.KWLTagSearch({width:100,field:"designation"})]},{region:"center",title:"Employees",bodyStyle:"background:transparent;",id:"centerRegion_"+this.id,border:false,layout:"fit",items:[this.employeeGrid],tbar:["Quick Search: ",this.qPSemployee=new Wtf.KWLTagSearch({width:100,field:"employeename"})]}]});this.designationStore.on("datachanged",function(B){this.qPSdesignation.StorageChanged(B)},this);this.designationStore.on("load",function(B){this.qPSdesignation.StorageChanged(B);if(B.getCount()>0){this.designationSM.selectFirstRow()}else{this.employeeStore.removeAll()}},this);this.employeeStore.on("load",function(){this.qPSemployee.StorageChanged(this.employeeStore);var B=this.pP.combo.value;this.qPSemployee.setPage(B)},this);this.employeeStore.on("datachanged",function(){this.qPSemployee.StorageChanged(this.employeeStore);var B=this.pP.combo.value;this.qPSemployee.setPage(B)},this);this.designationSM.on("selectionchange",function(C){if(C.getSelected()){var B=this.pP.combo.value;this.employeeStore.baseParams={type:"employeelist",id:C.getSelected().get("desigid")};this.employeeStore.load({params:{start:0,limit:B}})}else{this.employeeStore.removeAll()}},this);this.add(this.innerPanel);this.innerPanel.doLayout();this.designationStore.load({})}})