From 2b83780bf8f1bf58b1ca7512318d7ddca84a3df5 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Fri, 6 Apr 2018 16:31:55 +0530 Subject: [PATCH] new three reports added --- Apollo/api/application/config/routes.php | 3 + Apollo/api/application/controllers/Report.php | 74 +++++++ .../api/application/models/Reports_model.php | 169 +++++++++++++++- Apollo/assets/i18n/en.json | 5 +- Apollo/assets/js/config.router.js | 18 ++ Apollo/assets/js/controllers/reportCtrl.js | 125 +++++++++++- Apollo/assets/views/partials/nav.html | 15 ++ .../views/report_certificate_status.html | 148 ++++++++++++++ Apollo/assets/views/report_expense.html | 118 +++++++++++ .../views/report_mark_certificate_status.html | 184 ++++++++++++++++++ .../assets/views/report_markcardstatus.html | 4 +- 11 files changed, 852 insertions(+), 11 deletions(-) create mode 100644 Apollo/assets/views/report_certificate_status.html create mode 100644 Apollo/assets/views/report_expense.html create mode 100644 Apollo/assets/views/report_mark_certificate_status.html diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index f8a3ce8f..32068b4b 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -255,4 +255,7 @@ $route['getCourseSubjectDetails'] = 'HallTickets_Controller/getCourseSubjectDeta $route['reportstatus'] = 'Report/status'; $route['reportbatchlist'] = 'Report/batch'; $route['reportmstatus'] = 'Report/mstatus'; +$route['reportcert_status'] = 'Report/cert_status'; +$route['reportmark_cert_status'] = 'Report/markcert_status'; +$route['reportexpense'] = 'Report/expense'; diff --git a/Apollo/api/application/controllers/Report.php b/Apollo/api/application/controllers/Report.php index 35a79e9d..3171b2ac 100644 --- a/Apollo/api/application/controllers/Report.php +++ b/Apollo/api/application/controllers/Report.php @@ -85,6 +85,80 @@ class Report extends REST_Controller { } + } + public function cert_status_post() + { + $bat = $this->post('bname'); + $br = $this->post('brname'); + $u = $this->post('univ'); + $getStatus = $this->report_model->certificate_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 markcert_status_post() + { + $bat = $this->post('bname'); + $br = $this->post('brname'); + $u = $this->post('univ'); + $from = $this->post('from'); + $to = $this->post('to'); + $getStatus = $this->report_model->mark_cert_status($bat,$br,$u,$from,$to); + //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 expense_post() + { + + $from = $this->post('from'); + $to = $this->post('to'); + $getStatus = $this->report_model->expense($from,$to); + //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() { diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 33dd1bf5..c1e70126 100644 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -159,17 +159,180 @@ class Reports_model extends CI_Model $leadDet=$this->db->query($sql); $mstatusDetails = $leadDet->result(); if (count($mstatusDetails) > 0) { - $results['statusList'] = true; + $results['mstatusList'] = true; $results['mstatusr'] = $mstatusDetails; } else { - $results['statusList'] = false; + $results['mstatusList'] = false; $results['mmessage'] = 'No record found'; } return $results; } - + public function certificate_status($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.cert_name as cert_name,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,CertificationType as cert_name,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); + $cert_statusDetails = $leadDet->result(); + if (count($cert_statusDetails) > 0) { + $results['cert_statusList'] = true; + $results['cert_status'] = $cert_statusDetails; + } else { + $results['cert_statusList'] = false; + $results['cert_message'] = 'No record found'; + } + + return $results; + + } + public function mark_cert_status($bat=null,$br=null,$u=null,$from=null,$to=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.cmts as cmts,sms.cid as scid,sfp.bdate as bdate,list.status as status,u.uname as uname,cm.course as course,sms.cert_name as cert_name,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,CertificationType as cert_name,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."'"; + + } + if ($from and $to != ''){ + $fromd= date("Y-m-d",strtotime($from)); + $tod=date("Y-m-d",strtotime($to)); + + $sql.="and sms.cdate >= '".$fromd."' + and sms.cdate <= '".$tod."'"; + + } + $sql.=" group by ssid,sem,fbatch"; + $sql.=" order by sl"; + + $leadDet=$this->db->query($sql); + $mcert_statusDetails = $leadDet->result(); + if (count($mcert_statusDetails) > 0) { + $results['markcert_statusList'] = true; + $results['markcert_status'] = $mcert_statusDetails; + } else { + $results['markcert_statusList'] = false; + $results['markcert_message'] = 'No record found'; + } + + return $results; + + } + public function expense($from=null,$to=null){ + + $sql = "SELECT exp.TypeName as exp_name,sum(dbm.Amount) as amount FROM T_Income_Outcome_Master exp + join T_DayBookMaster dbm on dbm.Type=exp.ID + where dbm.Name = 'I001' + "; + + if ($from and $to != ''){ + $fromd= date("d-m-Y",strtotime($from)); + $tod=date("d-m-Y",strtotime($to)); + + $sql.="and dbm.Date >= '".$fromd."' + and dbm.Date <= '".$tod."'"; + + } + $sql.=" group by exp_name"; + + + $leadDet=$this->db->query($sql); + $expense = $leadDet->result(); + if (count($expense) > 0) { + $results['expense_list'] = true; + $results['expense'] = $expense; + } else { + $results['expense_list'] = false; + $results['expense_message'] = '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 5616e629..cbeed4a3 100755 --- a/Apollo/assets/i18n/en.json +++ b/Apollo/assets/i18n/en.json @@ -79,7 +79,10 @@ "report": { "TITLE": "REPORTS", "studmatstatus": "STUDY MATERIAL STATUS ", - "mstatus": "MARK CARD STATUS " + "mstatus": "MARK CARD STATUS ", + "certificate_status": "CERTIFICATE STATUS ", + "certificate_mark_status": "MARKCARD/CERTIFICATE ISSUED STATUS ", + "expense": "EXPENSE REPORT " }, "student": { diff --git a/Apollo/assets/js/config.router.js b/Apollo/assets/js/config.router.js index 2495041b..55640407 100755 --- a/Apollo/assets/js/config.router.js +++ b/Apollo/assets/js/config.router.js @@ -589,6 +589,24 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), title: 'Mark Card Status Report', + }).state('app.reports.certificate', { + url: '/reportCtrl', + templateUrl: "assets/views/report_certificate_status.html", + resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Certificate Status Report', + + }).state('app.reports.mark_certificate', { + url: '/reportCtrl', + templateUrl: "assets/views/report_mark_certificate_status.html", + resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Markcard/Certificate Status Report', + + }).state('app.reports.expense', { + url: '/reportCtrl', + templateUrl: "assets/views/report_expense.html", + resolve: loadSequence('ui.select','reportCtrl','ngTable', 'ladda', 'angular-ladda'), + title: 'Expense Report', + }); // $locationProvider.html5Mode(true); diff --git a/Apollo/assets/js/controllers/reportCtrl.js b/Apollo/assets/js/controllers/reportCtrl.js index baa9c7b1..a24a7f77 100644 --- a/Apollo/assets/js/controllers/reportCtrl.js +++ b/Apollo/assets/js/controllers/reportCtrl.js @@ -11,8 +11,33 @@ app.controller('reportCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$s "name": "", "brname": "", "univ": "", + "from_date": "", + "to_date": "", }; + // // change from date(from date) + // $scope.changeDate = function () { + // if($scope.batch.from_date !== undefined) { + // var formate = "dd-MM-yyyy"; + // $scope.batch.from_date = $filter('date')(new Date($scope.batch.from_date), formate); + + // } else { + // $scope.searchData.date = ''; + + // } + // } + // // change to date(to date) + // $scope.changeToDate = function () { + // if($scope.batch.to_date !== undefined) { + // var formate = "dd-MM-yyyy"; + // $scope.batch.to_date = $filter('date')(new Date($scope.batch.to_date), formate); + // //$scope.getDayBookList(); + // } else { + // $scope.batch.to_date = ''; + // // $scope.getDayBookList(); + // } + // } + $scope.batch = function () { var bat = { method: 'POST', @@ -28,7 +53,7 @@ app.controller('reportCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$s $scope.batch = response.data.batch; $scope.branch = response.data.branch; $scope.univ = response.data.univ; - console.log($scope.branch); + //console.log($scope.branch); } else { } }); @@ -65,8 +90,8 @@ app.controller('reportCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$s } $scope.mSubmit = function() { //alert($scope.batch.name); - $scope.statusr = ''; - $scope.message = ''; + $scope.mstatusr = ''; + $scope.mmessage = ''; var msta = { method: 'POST', url: apiPoint.url + 'reportmstatus/', @@ -82,11 +107,101 @@ app.controller('reportCtrl', ["$scope", "API_POINTS", "$http", "SweetAlert", "$s }; $http(msta).then(function (response) { - if (response.data.statusList == true) { + if (response.data.mstatusList == true) { $scope.mstatusr = response.data.mstatusr; } else { - $scope.mmessage = response.data.message; + $scope.mmessage = response.data.mmessage; + } + + }); + +} +$scope.cert_Submit = function() { + //alert($scope.batch.name); + $scope.cert_status = ''; + $scope.cert_message = ''; + var msta = { + method: 'POST', + url: apiPoint.url + 'reportcert_status/', + 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.cert_statusList == true) { + $scope.cert_status = response.data.cert_status; + + } else { + $scope.cert_message = response.data.cert_message; + } + + }); + +} +$scope.mark_cert_Submit = function() { + //alert($scope.batch.name); + console.log($scope.batch); + $scope.markcert_status = ''; + $scope.markcert_message = ''; + var msta = { + method: 'POST', + url: apiPoint.url + 'reportmark_cert_status/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + bname : $scope.batch.name, + brname : $scope.batch.brname, + univ : $scope.batch.univ, + from : $scope.batch.from_date, + to : $scope.batch.to_date + } + + }; + + $http(msta).then(function (response) { + if (response.data.markcert_statusList == true) { + $scope.markcert_status = response.data.markcert_status; + + } else { + $scope.markcert_message = response.data.markcert_message; + } + + }); + +} +$scope.expense_Submit = function() { + + $scope.expense = ''; + $scope.expense_message = ''; + var msta = { + method: 'POST', + url: apiPoint.url + 'reportexpense/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + + from : $scope.batch.from_date, + to : $scope.batch.to_date + } + + }; + + $http(msta).then(function (response) { + if (response.data.expense_list == true) { + $scope.expense = response.data.expense; + + } else { + $scope.expense_message = response.data.expense_message; } }); diff --git a/Apollo/assets/views/partials/nav.html b/Apollo/assets/views/partials/nav.html index 13e71bae..56a6aaae 100755 --- a/Apollo/assets/views/partials/nav.html +++ b/Apollo/assets/views/partials/nav.html @@ -341,6 +341,21 @@ Mark Card Status +
  • + + Certificate Status + +
  • +
  • + + Markcard and Certificate Status + +
  • +
  • + + Expense Report + +
  • diff --git a/Apollo/assets/views/report_certificate_status.html b/Apollo/assets/views/report_certificate_status.html new file mode 100644 index 00000000..8a867a52 --- /dev/null +++ b/Apollo/assets/views/report_certificate_status.html @@ -0,0 +1,148 @@ +
    +
    +
    +

    Certificate Status Report

    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    + + +
    +
    + + + +
    +
    + +
    + + +
    +
    +
    + +
    + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    SL.NoDocument Fee Paid DateStudent IDStudent NameFather NameCourseSem/YearPhone NoUniversityBalance FeeCertificates NameCertificates StatusDate
    {{p.sl}}{{p.bdate}}{{p.ssid}}{{p.name}}{{p.father}}{{p.course}}{{p.syear}}({{p.sem}}){{p.phone}}{{p.univ}}{{p.balance}}{{p.cert_name}}{{p.status}}{{p.cdate}}
    +

    {{cert_message}}

    + +
    + + + +
    +
    \ No newline at end of file diff --git a/Apollo/assets/views/report_expense.html b/Apollo/assets/views/report_expense.html new file mode 100644 index 00000000..6c9b5301 --- /dev/null +++ b/Apollo/assets/views/report_expense.html @@ -0,0 +1,118 @@ +
    +
    +
    +

    Expense Report

    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + + +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + +
    + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + +
    SL.NoDescriptionTotal Amount
    {{$index + 1}}{{p.exp_name}}{{p.amount}}
    +

    {{expense_message}}

    + +
    + + + +
    +
    \ No newline at end of file diff --git a/Apollo/assets/views/report_mark_certificate_status.html b/Apollo/assets/views/report_mark_certificate_status.html new file mode 100644 index 00000000..505f68c9 --- /dev/null +++ b/Apollo/assets/views/report_mark_certificate_status.html @@ -0,0 +1,184 @@ +
    +
    +
    +

    Markcard/Certificate Issued Status Report

    +
    + +
    +
    + + +
    +
    +
    +
    +
    +
    + +
    +
    + + + +
    +
    + + + +
    +
    + + + +
    +
    +
    +
    + +
    + + + +
    +
    +
    + +
    + + + +
    +
    + + +
    +
    + + + +
    +
    +
    + + + +
    +
    +
    + +
    + +
    + + + + +
    +
    + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
    SL.NoDocument Fee Paid DateStudent IDStudent NameFather NameCourseSem/YearPhone NoUniversityBalance FeeMarkcard StatusDateMarkcard Issued CommentsCertificates NameCertificates StatusDateCertificate Issued Comments
    {{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}}{{p.cmts}}{{p.cert_name}}{{p.status}}{{p.cdate}}{{p.cmts}}
    +

    {{markcert_message}}

    + +
    + + + +
    +
    \ No newline at end of file diff --git a/Apollo/assets/views/report_markcardstatus.html b/Apollo/assets/views/report_markcardstatus.html index da2c3eaa..1e5399a4 100644 --- a/Apollo/assets/views/report_markcardstatus.html +++ b/Apollo/assets/views/report_markcardstatus.html @@ -89,7 +89,7 @@
    - + @@ -136,7 +136,7 @@ -

    {{message}}

    +

    {{mmessage}}