diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index bb3b650f..f8a3ce8f 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -251,3 +251,8 @@ $route['updateSessionScheduleDetails'] = 'SessionSchedule_Controller/updateSessi // halltickets $route['getCourseSubjectDetails'] = 'HallTickets_Controller/getCourseSubjectDetails'; +//Reports +$route['reportstatus'] = 'Report/status'; +$route['reportbatchlist'] = 'Report/batch'; +$route['reportmstatus'] = 'Report/mstatus'; + diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php new file mode 100644 index 00000000..35a79e9d --- /dev/null +++ b/Apollo/api/application/controllers/Report.php @@ -0,0 +1,117 @@ +load->model('Reports_model', 'report_model'); + + } + + + + + public function status_post() + { + $bat = $this->post('bname'); + $br = $this->post('brname'); + $u = $this->post('univ'); + $getStatus = $this->report_model->status($bat,$br,$u); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } + public function mstatus_post() + { + $bat = $this->post('bname'); + $br = $this->post('brname'); + $u = $this->post('univ'); + $getStatus = $this->report_model->mstatus($bat,$br,$u); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } + public function batch_post() + { + + $getStatus = $this->report_model->batch(); + //print_r($getStatus); + if ($getStatus) + { + $getStatus['status'] = REST_Controller::HTTP_OK; + // Set the response and exit + $this->response($getStatus, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + } + else + { + // Set the response and exit + $this->response([ + 'message' => 'No records found!', + 'status' => REST_Controller::HTTP_NOT_FOUND + ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + } + + + } + + + + + + +} \ No newline at end of file diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php new file mode 100644 index 00000000..33dd1bf5 --- /dev/null +++ b/Apollo/api/application/models/Reports_model.php @@ -0,0 +1,175 @@ +db->query($sql); + $statusDetails = $leadDet->result(); + if (count($statusDetails) > 0) { + $results['statusList'] = true; + $results['statusr'] = $statusDetails; + } else { + $results['statusList'] = false; + $results['message'] = 'No record found'; + } + + return $results; + + } + public function batch(){ + + + $sql = "SELECT BatchCode as batch,BatchName as bname FROM T_BatchMaster + group by batch;"; + $b=$this->db->query($sql); + $batch = $b->result(); + if (count($batch) > 0) { + $results['batchlist'] = true; + $results['batch'] = $batch; + } else { + $results['batchlist'] = false; + $results['message'] = 'No record found'; + } + $sql = "SELECT BranchCode as brcode,BranchName as bname FROM T_BranchMaster"; + $b=$this->db->query($sql); + $batch = $b->result(); + if (count($batch) > 0) { + $results['branchlist'] = true; + $results['branch'] = $batch; + } else { + $results['branchlist'] = false; + $results['message'] = 'No record found'; + } + $sql = "SELECT UniversityID as uid,UniversityName as uname FROM T_UniversityMaster"; + $b=$this->db->query($sql); + $batch = $b->result(); + if (count($batch) > 0) { + $results['univlist'] = true; + $results['univ'] = $batch; + } else { + $results['univlist'] = false; + $results['message'] = 'No record found'; + } + return $results; + + } + public function mstatus($bat=null,$br=null,$u=null){ + + $sql = "select @s:=@s+1 sl,sms.sid as ssid,std.name as name,std.father as father,br.bname as bname,ifnull(b.batch,'-') as batch,std.phone as phone,sms.cid as scid,sfp.bdate as bdate,list.status as status,u.uname as uname,cm.course as course,sms.sem as sem,sms.cdate as cdate,sfs.batch as fbatch,sfs.cid as fcid,cfd.syear as syear,sum(sfs.cf) as crsfee,sum(sfs.stf) as stf,sum(sfs.others) as others,(sum(sfs.cf) + sum(sfs.stf) + sum(sfs.others)) as total,ifnull(sfp.bamount,0) as bamount,(sum(sfs.cf) + (sum(sfs.stf) + sum(sfs.others)) - ifnull(sfp.bamount,0)) as balance + from + (SELECT StudentID as sid,CourseID as cid,BranchCode as branch,CDate as cdate,ListCode as lcode,Comments as cmts,Sem as sem FROM T_CertificationStatus) as sms + left join + (SELECT FeesID as fid,BatchCode as batch,StudentID as sid,CourseID as cid,FeesType as ftype,sum(CourseFees) as cf,Sum(STFOrWR) as stf,sum(Others) as others FROM T_Students_Fees_Status + group by sid,batch) as sfs on sfs.sid=sms.sid + left join + (SELECT StudentID as sid,FeesId as fid,BillDate as bdate,sum(BillAmount) as bamount + FROM T_Students_Fees_PaidDetails, (SELECT @s:= 0) AS s + group by sid,fid,bdate) as sfp on sfp.sid=sfs.sid and sfp.fid=sfs.fid + left join + (SELECT ID as cid,CourseID as ccid,FeesType as ftype,Sem_Year as syear FROM T_Course_Fees_Details) as cfd + on cfd.cid=sms.cid + left join + (SELECT CourseID as cid,UniversityID as uid,CourseName as course FROM T_CourseMaster) as cm + on cm.cid=sfs.cid + left join + (SELECT UniversityID as uid,UniversityName as uname FROM T_UniversityMaster) as u + on u.uid=cm.uid + left join + (SELECT ListCode as lcode,ListName as status FROM T_PickListDetails) as list + on list.lcode=sms.lcode + left join + (SELECT StudentID as sid,MobileNumber as phone,FirstName as name,Fathername as father FROM T_StudentDetails) as std on std.sid=sms.sid + left join + (SELECT BatchCode as bcode,BatchName as batch FROM T_BatchMaster) as b on b.bcode=sfs.batch + left join + (SELECT BranchCode as brcode,BranchName as bname FROM T_BranchMaster) as br on br.brcode=sms.branch + where std.name != 'null' + "; + if ($br!= ''){ + + $sql.=" and sms.branch = '".$br."'"; + + } + if ($bat!= ''){ + + $sql.=" and b.bcode = '".$bat."'"; + + } + if ($u!= ''){ + + $sql.=" and u.uid = '".$u."'"; + + } + $sql.=" group by ssid,sem,fbatch"; + $sql.=" order by sl"; + $leadDet=$this->db->query($sql); + $mstatusDetails = $leadDet->result(); + if (count($mstatusDetails) > 0) { + $results['statusList'] = true; + $results['mstatusr'] = $mstatusDetails; + } else { + $results['statusList'] = false; + $results['mmessage'] = 'No record found'; + } + + return $results; + + } + + + +} \ No newline at end of file diff --git a/Apollo/assets/i18n/en.json b/Apollo/assets/i18n/en.json index f928729f..5616e629 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -75,6 +75,12 @@ "SESSIONMASTER":"SESSION DETAILS", "SESSIONSCHEDULE": "SESSION SCHEDULE", "HALLTICKET": "GENERATE HALLTICKET" + }, + "report": { + "TITLE": "REPORTS", + "studmatstatus": "STUDY MATERIAL STATUS ", + "mstatus": "MARK CARD STATUS " + }, "student": { "MAIN": "STUDENTS", diff --git a/Apollo/assets/js/config.constant.js b/Apollo/assets/js/config.constant.js index fc8b7fc2..20444113 100755 --- a/Apollo/assets/js/config.constant.js +++ b/Apollo/assets/js/config.constant.js @@ -176,7 +176,9 @@ app.constant('JS_REQUIRES', { //*** Filters - 'htmlToPlaintext': 'assets/js/filters/htmlToPlaintext.js' + 'htmlToPlaintext': 'assets/js/filters/htmlToPlaintext.js', + // reports + 'reportCtrl':'assets/js/controllers/reportCtrl.js' }, //*** angularJS Modules modules: [{ diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 0a0cbfe1..2495041b 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -570,6 +570,25 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com }).state('error.500', { url: '/500', templateUrl: "assets/views/utility_500.html", + }).state('app.reports', { + url: '/reports', + template: '
', + title: 'Reports', + ncyBreadcrumb: { + label: 'Reports' + } + }).state('app.reports.studymaterial', { + url: '/reportCtrl', + templateUrl: "assets/views/report_studymaterialstatus.html", + resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Study Material Status Report', + + }).state('app.reports.markcard', { + url: '/reportCtrl', + templateUrl: "assets/views/report_markcardstatus.html", + resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Mark Card Status Report', + }); // $locationProvider.html5Mode(true); diff --git a/Apollo/assets/js/controllers/reportCtrl.js b/Apollo/assets/js/controllers/reportCtrl.js new file mode 100644 index 00000000..baa9c7b1 --- /dev/null +++ b/Apollo/assets/js/controllers/reportCtrl.js @@ -0,0 +1,100 @@ +'use strict'; +/*** controller for Wizard Form example***/ +app.controller('reportCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$state", 'md5', 'ipCookie', '$window', + function ($scope, apiPoint, $http, SweetAlert, $state, md5, ipCookie, $window) { + + + + + + $scope.batch = { + "name": "", + "brname": "", + "univ": "", + }; + + $scope.batch = function () { + var bat = { + method: 'POST', + url: apiPoint.url + 'reportbatchlist/', + headers: { + 'Content-Type': 'application/json' + } + + }; + + $http(bat).then(function (response) { + if (response.data) { + $scope.batch = response.data.batch; + $scope.branch = response.data.branch; + $scope.univ = response.data.univ; + console.log($scope.branch); + } else { + } + }); + } + + $scope.onSubmit = function() { + //alert($scope.batch.name); + $scope.statusr = ''; + $scope.message = ''; + var sta = { + method: 'POST', + url: apiPoint.url + 'reportstatus/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + bname : $scope.batch.name, + brname : $scope.batch.brname, + univ : $scope.batch.univ + } + + }; + + $http(sta).then(function (response) { + if (response.data.statusList == true) { + $scope.statusr = response.data.statusr; + + } else { + $scope.message = response.data.message; + } + + }); + + } + $scope.mSubmit = function() { + //alert($scope.batch.name); + $scope.statusr = ''; + $scope.message = ''; + var msta = { + method: 'POST', + url: apiPoint.url + 'reportmstatus/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + bname : $scope.batch.name, + brname : $scope.batch.brname, + univ : $scope.batch.univ + } + + }; + + $http(msta).then(function (response) { + if (response.data.statusList == true) { + $scope.mstatusr = response.data.mstatusr; + + } else { + $scope.mmessage = response.data.message; + } + + }); + +} + + }]); + + + + diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index fa26f58c..13e71bae 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -319,6 +319,32 @@ +| SL.No | +Intial Payment Paid Date | +Student ID | +Student Name | +Father Name | +Course | +Sem/Year | +Phone No | +University | +Balance Fee | +Mark Card Status | +Date | + +
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{p.sl}} | +{{p.bdate}} | +{{p.ssid}} | +{{p.name}} | +{{p.father}} | +{{p.course}} | +{{p.syear}}({{p.sem}}) | +{{p.phone}} | +{{p.univ}} | +{{p.balance}} | +{{p.status}} | +{{p.cdate}} | +
| SL.No | +Intial Payment Paid Date | +Student ID | +Student Name | +Father Name | +Course | +Sem/Year | +Phone No | +University | +Balance Fee | +Study Material Status | +Date | + +
|---|---|---|---|---|---|---|---|---|---|---|---|
| {{p.sl}} | +{{p.bdate}} | +{{p.ssid}} | +{{p.name}} | +{{p.father}} | +{{p.course}} | +{{p.syear}}({{p.sem}}) | +{{p.phone}} | +{{p.univ}} | +{{p.balance}} | +{{p.status}} | +{{p.date}} | +
| #",r.forEach(function(e){t+=" | "+e});for(var a=0,s=e.length;a| "+(a+1),r.forEach(function(r){t+=" | ",e[a][r]==+e[a][r]?(t+=' | ',t+=void 0===e[a][r]?"NULL":e[a][r],t+=" "):t+=void 0===e[a][r]?"NULL":"string"==typeof e[a][r]?e[a][r]:ce(e[a][r])});t+=" |
|---|
"+ce(e)+"
";return t}function m(e,t,r){if(!(r<=0)){var n=t-e.scrollTop,a=n/r*10;setTimeout(function(){e.scrollTop!==t&&(e.scrollTop=e.scrollTop+a,m(e,t,r-10))},10)}}function S(e,t,r,n,a,s){function i(e){for(var t="",r=0,n=10240;r"+A.pretty(e)+""),Array.isArray(a))if(0===a.length)i+="[ ]
";else if("object"!=typeof a[0]||Array.isArray(a[0]))for(var o=0,u=a.length;o"+g(a[o])+"";else i+=g(a);else i+=g(a);s.innerHTML+=i}},A.clear=function(){var e=A.options.logtarget;if(C.isNode||C.isMeteorServer)console.clear&&console.clear();else{var t;t="output"===e?document.getElementsByTagName("output")[0]:"string"==typeof e?document.getElementById(e):e,t.innerHTML=""}},A.write=function(e){var t=A.options.logtarget;if(C.isNode||C.isMeteorServer)console.log&&console.log(e);else{var r;r="output"===t?document.getElementsByTagName("output")[0]:"string"==typeof t?document.getElementById(t):t,r.innerHTML+=e}},A.prompt=function(e,t,r){if(C.isNode)throw new Error("The prompt not realized for Node.js");var n=0;if("string"==typeof e&&(e=document.getElementById(e)),"string"==typeof t&&(t=document.getElementById(t)),t.textContent=A.useid,r){A.prompthistory.push(r),n=A.prompthistory.length;try{var a=Date.now();A.log(r),A.write(''+(Date.now()-a)+" ms
")}catch(e){A.write(""+olduseid+"> "+sql+"
"),A.write(''+e+"
")}}var s=e.getBoundingClientRect().top+document.getElementsByTagName("body")[0].scrollTop;m(document.getElementsByTagName("body")[0],s,500),e.onkeydown=function(r){if(13===r.which){var a=e.value,s=A.useid;e.value="",A.prompthistory.push(a),n=A.prompthistory.length;try{var i=Date.now();A.log(a),A.write('
'+(Date.now()-i)+" ms
")}catch(e){A.write(""+s+"> "+A.pretty(a,!1)+"
"),A.write(''+e+"
")}e.focus(),t.textContent=A.useid;var o=e.getBoundingClientRect().top+document.getElementsByTagName("body")[0].scrollTop;m(document.getElementsByTagName("body")[0],o,500)}else 38===r.which?(n--,n<0&&(n=0),A.prompthistory[n]&&(e.value=A.prompthistory[n],r.preventDefault())):40===r.which&&(n++,n>=A.prompthistory.length?(n=A.prompthistory.length,e.value=""):A.prompthistory[n]&&(e.value=A.prompthistory[n],r.preventDefault()))}},Q.BeginTransaction=function(e){return Q.extend(this,e)},Q.BeginTransaction.prototype.toString=function(){return"BEGIN TRANSACTION"},Q.BeginTransaction.prototype.execute=function(e,t,r){return A.databases[e].engineid?A.engines[A.databases[A.useid].engineid].begin(e,r):(r&&r(1),1)},Q.CommitTransaction=function(e){return Q.extend(this,e)},Q.CommitTransaction.prototype.toString=function(){return"COMMIT TRANSACTION"},Q.CommitTransaction.prototype.execute=function(e,t,r){return A.databases[e].engineid?A.engines[A.databases[A.useid].engineid].commit(e,r):(r&&r(1),1)},Q.RollbackTransaction=function(e){return Q.extend(this,e)},Q.RollbackTransaction.prototype.toString=function(){return"ROLLBACK TRANSACTION"},Q.RollbackTransaction.prototype.execute=function(e,t,r){return A.databases[e].engineid?A.engines[A.databases[e].engineid].rollback(e,r):(r&&r(1),1)},A.options.tsql&&(A.stdfn.OBJECT_ID=function(e,t){void 0===t&&(t="T"),t=t.toUpperCase();var r=e.split("."),n=A.useid,a=r[0];2==r.length&&(n=r[0],a=r[1]);var s=A.databases[n].tables;n=A.databases[n].databaseid;for(var i in s)if(i==a){if(s[i].view&&"V"==t)return n+"."+i;if(!s[i].view&&"T"==t)return n+"."+i;return}}),A.options.mysql,(A.options.mysql||A.options.sqlite)&&(A.from.INFORMATION_SCHEMA=function(e,t,r,n,a){if("VIEWS"==e||"TABLES"==e){var s=[];for(var i in A.databases){var o=A.databases[i].tables;for(var u in o)(o[u].view&&"VIEWS"==e||!o[u].view&&"TABLES"==e)&&s.push({TABLE_CATALOG:i,TABLE_NAME:u})}return r&&(s=r(s,n,a)),s}throw new Error("Unknown INFORMATION_SCHEMA table")}),A.options.postgres,A.options.oracle,A.options.sqlite,A.into.SQL=function(e,t,r,n,a){var s;"object"==typeof e&&(t=e,e=void 0);var i={};if(A.utils.extend(i,t),void 0===i.tableid)throw new Error("Table for INSERT TO is not defined.");var o="";0===n.length&&"object"==typeof r[0]&&(n=Object.keys(r[0]).map(function(e){return{columnid:e}}));for(var u=0,c=r.length;u",void 0!==i.caption){var a=i.caption;"string"==typeof a&&(a={title:a}),e+="
",e+="",e+=""}();e=A.utils.autoExtFilename(e,"xls",t);var u=A.utils.saveFile(e,o);return a&&(u=a(u)),u},A.into.XLSXML=function(e,t,r,n,a){t=t||{},"object"==typeof e&&(t=e,e=void 0);var s={};t&&t.sheets?s=t.sheets:s.Sheet1=t,e=A.utils.autoExtFilename(e,"xls",t);var i=A.utils.saveFile(e,function(){function e(e){var t="";for(var r in e){t+="<"+r;for(var n in e[r])t+=" ",t+="x:"==n.substr(0,2)?n:"ss:",t+=n+'="'+e[r][n]+'"';t+="/>"}var s=D(t);return o[s]||(o[s]={styleid:u},a+='",u++),"s"+o[s].styleid}var a="",i=" ",o={},u=62;for(var c in s){var l=s[c];void 0!==l.columns?n=l.columns:0==n.length&&r.length>0&&"object"==typeof r[0]&&(n=Array.isArray(r[0])?r[0].map(function(e,t){return{columnid:t}}):Object.keys(r[0]).map(function(e){return{columnid:e}})),n.forEach(function(e,t){void 0!==l.column&&G(e,l.column),void 0===e.width&&(l.column&&void 0!==l.column.width?e.width=l.column.width:e.width=120),"number"==typeof e.width&&(e.width=e.width),void 0===e.columnid&&(e.columnid=t),void 0===e.title&&(e.title=""+e.columnid.trim()),l.headers&&Array.isArray(l.headers)&&(e.title=l.headers[idx])}),i+='",n.forEach(function(t,r){e+=" ",e+=""),e+="",r&&r.length>0&&r.forEach(function(r,a){if(!(a>i.limit)){e+="",void 0!==t.title&&(e+="function"==typeof t.title?t.title(i,t,r):t.title),e+=" "}),e+="",n.forEach(function(n,o){var u={};G(u,i.cell),G(u,s.cell),void 0!==i.column&&G(u,i.column.cell),G(u,n.cell),i.cells&&i.cells[a]&&i.cells[a][o]&&G(u,i.cells[a][o]);var c=r[n.columnid];"function"==typeof u.value&&(c=u.value(c,i,r,n,u,a,o));var l=u.typeid;"function"==typeof l&&(l=l(c,i,r,n,u,a,o)),void 0===l&&("number"==typeof c?l="number":"string"==typeof c?l="string":"boolean"==typeof c?l="boolean":"object"==typeof c&&c instanceof Date&&(l="date"));var h="";"money"==l?h='mso-number-format:"\\#\\,\\#\\#0\\\\ _р_\\.";white-space:normal;':"number"==l?h=" ":"date"==l?h='mso-number-format:"Short Date";':t.types&&t.types[l]&&t.types[l].typestyle&&(h=t.types[l].typestyle),h=h||'mso-number-format:"\\@";',e+=" "}}),e+="",e+="";var d=u.format;if(void 0===c)e+="";else if(void 0!==d)if("function"==typeof d)e+=d(c);else{if("string"!=typeof d)throw new Error("Unknown format type. Should be function or string");e+=c}else e+="number"==l||"date"==l?c.toString():"money"==l?(+c).toFixed(2):c;e+=" "}),e+="',n.forEach(function(e,t){i+='
=b)return f;if(c)return c=!1,d;var t=E;if(e.charCodeAt(t)===h){for(var r=t;r++0){var s=this.exprs.map(function(e){return ce(new Function("params,alasql,p","var y;return "+e.toJS("({})","",null)).bind(n)(t,A))});console.log.apply(console,s)}else if(this.select){var i=this.select.execute(e,t);console.log(ce(i))}else console.log();return r&&(a=r(a)),a},Q.Source=function(e){return Q.extend(this,e)},Q.Source.prototype.toString=function(){var e="SOURCE";return this.url&&(e+=" '"+this.url+" '"),e},Q.Source.prototype.execute=function(e,t,r){var n;return x(this.url,!!r,function(e){return n=A(e),r&&(n=r(n)),n},function(e){throw e}),n},Q.Require=function(e){return Q.extend(this,e)},Q.Require.prototype.toString=function(){var e="REQUIRE";return this.paths&&this.paths.length>0&&(e+=this.paths.map(function(e){return e.toString()}).join(",")),this.plugins&&this.plugins.length>0&&(e+=this.plugins.map(function(e){return e.toUpperCase()}).join(",")),e},Q.Require.prototype.execute=function(e,t,r){var n=this,a=0,s="";return this.paths&&this.paths.length>0?this.paths.forEach(function(e){x(e.value,!!r,function(e){a++,s+=e,a{table}
'};
+ var csvDelimiter = ",";
+ var csvNewLine = "\r\n";
+ var base64 = function(s) {
+ return window.btoa(window.unescape(encodeURIComponent(s)));
+ };
+ var format = function(s, c) {
+ return s.replace(new RegExp("{(\\w+)}", "g"), function(m, p) {
+ return c[p];
+ });
+ };
+
+ var get = function(element) {
+ if (!element.nodeType) {
+ return document.getElementById(element);
+ }
+ return element;
+ };
+
+ var fixCSVField = function(value) {
+ var fixedValue = value;
+ var addQuotes = (value.indexOf(csvDelimiter) !== -1) || (value.indexOf('\r') !== -1) || (value.indexOf('\n') !== -1);
+ var replaceDoubleQuotes = (value.indexOf('"') !== -1);
+
+ if (replaceDoubleQuotes) {
+ fixedValue = fixedValue.replace(/"/g, '""');
+ }
+ if (addQuotes || replaceDoubleQuotes) {
+ fixedValue = '"' + fixedValue + '"';
+ }
+
+ return fixedValue;
+ };
+
+ var tableToCSV = function(table) {
+ var data = "SEP="+csvDelimiter+csvNewLine;
+ var i, j, row, col;
+ var columnStart = 0;
+ for (i = 0; i < table.rows.length; i=i+1) {
+ row = table.rows[i];
+ var rowData = '';
+
+ //Checking ng table style for filters
+ if(row.className.indexOf('ng-table-filters') !== -1) {
+ continue;
+ }
+
+ //remove first column having check box in angular JS, in future will provide option from UI to control
+ if(table.rows[0].cells[0].textContent.trim() === '') {
+ columnStart = 1;
+ }else {
+ columnStart = 0;
+ }
+
+ for (j = columnStart; j < row.cells.length; j=j+1) {
+ col = row.cells[j];
+ rowData = rowData + fixCSVField(col.textContent.trim()) + (j ? csvDelimiter : ' ');
+ }
+ rowData = rowData.slice(0, rowData.length - 1); //remove last semicolon
+ data += rowData + csvNewLine;
+ }
+ return data;
+ };
+
+ var tableToHTML = function(table) {
+ var data = "";
+ var i, j, row, col;
+ var columnStart = 5;
+ for (i = 0; i < table.rows.length; i=i+1) {
+ row = table.rows[i];
+ var rowData = '';
+
+ //Checking ng table style for filters
+ if(row.className.indexOf('ng-table-filters') !== -1) {
+ continue;
+ }
+
+ //remove first column having check box in angular JS, in future will provide option from UI to control
+ if(table.rows[0].cells[0].textContent.trim() === '') {
+ columnStart = 1;
+ }else {
+ columnStart = 0;
+ }
+
+ for (j = columnStart; j < row.cells.length; j=j+1) {
+ col = row.cells[j];
+ if (i === 0) {
+ rowData += '' + col.textContent.trim() + ' ';
+ } else {
+ rowData += '' + col.textContent.trim() + ' ';
+ }
+ }
+ data += '' + rowData + ' ';
+ }
+ // return data;
+ };
+
+ function createDownloadLink(anchor, base64data, exporttype, filename) {
+ var blob;
+ if (window.navigator.msSaveBlob) {
+ blob = b64toBlob(base64data, exporttype);
+ window.navigator.msSaveBlob(blob, filename);
+ return false;
+ } else if(window.URL.createObjectURL) {
+ blob = b64toBlob(base64data, exporttype);
+ var blobUrl = window.URL.createObjectURL(blob, exporttype, filename);
+ anchor.href = blobUrl;
+ } else {
+ var hrefvalue = "data:" + exporttype + ";base64," + base64data;
+ anchor.download = filename;
+ anchor.href = hrefvalue;
+ }
+
+ // Return true to allow the link to work
+ return true;
+ }
+
+ var ee = {
+ /** @export */
+ excel: function(anchor, table, name) {
+ table = get(table);
+
+ var htmlTableData = tableToHTML(table);
+
+ var ctx = {worksheet: name || 'Worksheet', table: htmlTableData};
+ var b64 = base64(format(template.excel, ctx));
+ return createDownloadLink(anchor, b64, 'application/vnd.ms-excel',name+'.xls');
+ },
+ /** @export */
+ csv: function(anchor, table, name, delimiter, newLine) {
+ if (delimiter !== undefined && delimiter) {
+ csvDelimiter = delimiter;
+ }
+ if (newLine !== undefined && newLine) {
+ csvNewLine = newLine;
+ }
+
+ table = get(table);
+ var csvData = tableToCSV(table);
+ var b64 = base64(csvData);
+ return createDownloadLink(anchor,b64,'application/csv',name+'.csv');
+ }
+ };
+
+ return ee;
+}());
+
+ // AMD support
+ if (typeof define === 'function' && define.amd) {
+ define(function () { return ngTableExcelExport; });
+ // CommonJS and Node.js module support.
+ } else if (typeof exports !== 'undefined') {
+ // Support Node.js specific `module.exports` (which can be a function)
+ if (typeof module !== 'undefined' && module.exports) {
+ exports = module.exports = ngTableExcelExport;
+ }
+ // But always support CommonJS module 1.1.1 spec (`exports` cannot be a function)
+ exports.ngTableExcelExport = ngTableExcelExport;
+ } else {
+ global.ngTableExcelExport = ngTableExcelExport;
+ }
+})(this);
diff --git a/Apollo/bower_components/ng-table-excel-export/ng-table-excel-export.min b/Apollo/bower_components/ng-table-excel-export/ng-table-excel-export.min
new file mode 100644
index 00000000..7f9b185a
--- /dev/null
+++ b/Apollo/bower_components/ng-table-excel-export/ng-table-excel-export.min
@@ -0,0 +1,15 @@
+/**
+ * ngTableExcelExport 1.0.0
+ * JavaScript export to Excel or CSV from HTML tables automatically in the browser and also compatible with all browsers.
+ *
+ * @author: Murugavel Ramachandran (blsrm@yahoo.com)
+ * @url: https://github.com/blsrm/ngTableExcelExport
+ *
+ */
+/*jslint browser: true, bitwise: true, vars: true, white: true */
+/*global define, exports, module */
+(function(m){var g=function(){function g(h,a,e){a=a||"";e=e||512;h=window.atob(h);var c=[],b;for(b=0;b"+d.textContent.trim()+" ");c+=""+l+" "}}a=
+window.btoa(window.unescape(encodeURIComponent(m(' \x3c!--[if gte mso 9]>{table}
',
+{worksheet:e||"Worksheet",table:c}))));return q(h,a,"application/vnd.ms-excel",e+".xls")},csv:function(h,a,e,c,b){void 0!==c&&c&&(n=c);void 0!==b&&b&&(p=b);a=a.nodeType?a:document.getElementById(a);c="SEP="+n+p;var f,k,d;for(b=0;b"+d.textContent.trim()+" ");c+=""+l+" "}}a=
+window.btoa(window.unescape(encodeURIComponent(m(' \x3c!--[if gte mso 9]>{table}
',
+{worksheet:e||"Worksheet",table:c}))));return q(h,a,"application/vnd.ms-excel",e+".xls")},csv:function(h,a,e,c,b){void 0!==c&&c&&(n=c);void 0!==b&&b&&(p=b);a=a.nodeType?a:document.getElementById(a);c="SEP="+n+p;var f,k,d;for(b=0;b