From d54683b27e30dfafcce1f15c38ef25666f749a15 Mon Sep 17 00:00:00 2001 From: dineshkumarkannan Date: Mon, 27 Aug 2018 12:53:02 +0530 Subject: [PATCH] daybook pdf generated changes , certificate status update chnages : kdk --- .../models/StatusUpdation_model.php | 19 +++++++------ .../js/controllers/certificateStatusCtrl.js | 2 +- Apollo/assets/js/controllers/daybookCtrl.js | 14 +++++++++- .../assets/js/controllers/daybookadminCtrl.js | 16 +++++++---- .../js/controllers/daybooksuperadminCtrl.js | 27 +++++++++++++++---- .../assets/js/directives/pdf_make/pdfMake.js | 2 +- Apollo/assets/views/daybook/daybook.html | 10 +++++-- Apollo/assets/views/daybook/daybookadmin.html | 5 +++- .../views/daybook/daybooksuperadmin.html | 5 ++-- .../status-update/certificate_status.html | 6 ++--- 10 files changed, 77 insertions(+), 29 deletions(-) diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index 8e71ebeb..a540f673 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -64,7 +64,8 @@ class StatusUpdation_model extends CI_Model { $studentName = $this->getStudentName($arr[0]['StudentID']); $statuToMsg = $this->get_status_name_ListCode($arr[0]['ListCode']); if( $statuToMsg == 'received' || $statuToMsg == 'Received' || $statuToMsg == 'RECEIVED'){ - $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); + // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); + $cerNamtToMsg = $arr[0]['CertificationType']; $getSemYearMsg = $this->get_couser_name($arr[0]['CourseID']); $getSemYearANDType = "$getSemYearMsg $cerNamtToMsg"; // $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; @@ -72,7 +73,8 @@ class StatusUpdation_model extends CI_Model { $this->smssend($arr, $mesg); $this->mailsend($arr, $mesg, $cerNamtToMsg); } else if($statuToMsg == 'issued' || $statuToMsg == 'Issued' || $statuToMsg == 'ISSUED') { - $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); + // $cerNamtToMsg = $this->get_certificate_name($arr[0]['CertificationType']); + $cerNamtToMsg = $arr[0]['CertificationType']; $getSemYearMsg = $this->get_couser_name($arr[0]['CourseID']); $getSemYearANDType = "$getSemYearMsg $cerNamtToMsg"; // $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; @@ -155,16 +157,17 @@ class StatusUpdation_model extends CI_Model { // get certificate list public function get_certificate_list($branchId, $sutendDetail, $courseDetails) { // echo $sutendDetail, $courseDetails;exit(); - $this->db->select('CFR.*'); + $this->db->select('SFS.FeesType as certificateData'); $this->db->order_by('CreatedOn', 'DESC'); $this->db->from('T_Students_Fees_Status as SFS'); // $this->db->join('T_Course_Fees_Details as CFD', 'CFD.ID = SFS.FeeType'); // $this->db->join('T_Students_Fees_Status as SFS', 'SFS.StudentID = $sutendDetail'); - $this->db->join( '' . CERTIFICATION . ' as CFR', 'CFR.CertificateName = SFS.FeesType'); - $this->db->where('CFR.IsActive', 1); + // $this->db->join( '' . CERTIFICATION . ' as CFR', 'CFR.CertificateName = SFS.FeesType'); + $where = '(SFS.FeesType="PC" or SFS.FeesType = "DC" or SFS.FeesType = "TC" or SFS.FeesType = "MC" or SFS.FeesType = "OTHER")'; + $this->db->where($where); + $this->db->where('SFS.StudentID',$sutendDetail); $this->db->where('SFS.CourseID',$courseDetails); - $this->db->where('CFR.BranchCode', $branchId); $this->db->where('SFS.BranchCode', $branchId); $cerfDetails = $this->db->get(); $certificateDetails = $cerfDetails->result(); @@ -234,13 +237,13 @@ class StatusUpdation_model extends CI_Model { } else if ($reqDetailsFor == 'APPICATION_STATUS') { $searchFor = 'A001'; $searchTableFor = APPLICATION_STATUS; - $this->db->select('t1.*, t4.Firstname, t5.ListName, t6.CertificateName'); + $this->db->select('t1.*, t4.Firstname, t5.ListName, t1.CertificationType as CertificateName'); $this->db->from('' . $searchTableFor . ' as t1'); $this->db->where('t1.StudentID', $reqDetails['student']); $this->db->join('' . LOGIN . ' as t3', 't3.ID = t1.CreatedBy', 'LEFT'); $this->db->join('' . STAFF . ' as t4', 't4.StaffID = t3.StaffID', 'LEFT'); $this->db->join('' . PICK_LIST_DETAILS . ' as t5', 't5.ListCode = t1.ListCode', 'LEFT'); - $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); + // $this->db->join('' . CERTIFICATION . ' as t6', 't6.CertificationID = t1.CertificationType', 'LEFT'); $this->db->order_by('t1.CreatedOn', 'DESC'); $statusDetails = $this->db->get(); $prevStatusDetails = $statusDetails->result(); diff --git a/Apollo/assets/js/controllers/certificateStatusCtrl.js b/Apollo/assets/js/controllers/certificateStatusCtrl.js index 7ea95681..bd901815 100644 --- a/Apollo/assets/js/controllers/certificateStatusCtrl.js +++ b/Apollo/assets/js/controllers/certificateStatusCtrl.js @@ -103,7 +103,7 @@ app.controller('certificateStatusCtrl', ["$scope", "toaster", "$filter", "ngTabl }; $http(getCerfreg).then(function (response) { if (response.data.certificateStatus) { - $scope.certificateData = response.data.certificate_details; + $scope.certificateDatas = response.data.certificate_details; // alert(JSON.stringify($scope.certificateData)); } else { } diff --git a/Apollo/assets/js/controllers/daybookCtrl.js b/Apollo/assets/js/controllers/daybookCtrl.js index b972fc3c..dfd5d57e 100755 --- a/Apollo/assets/js/controllers/daybookCtrl.js +++ b/Apollo/assets/js/controllers/daybookCtrl.js @@ -191,7 +191,7 @@ $scope.dayBookApprovalAccess = ''; $scope.generatePFD = function (datas) { - + $scope.loadStaring = true; // daybookDetails.generatePFD(datas,$scope.searchData.date, $scope.searchData.dateTo); var o = {}; @@ -389,6 +389,18 @@ $scope.dayBookApprovalAccess = ''; if(returndata){ $scope.loadStaring = false; } + + pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(res) { + if(res === 'success'){ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + }else{ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + } + }); } diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js index 3b6f817a..253bfd4d 100755 --- a/Apollo/assets/js/controllers/daybookadminCtrl.js +++ b/Apollo/assets/js/controllers/daybookadminCtrl.js @@ -192,6 +192,7 @@ $scope.dayBookApprovalAccess = ''; $scope.generatePFD = function (datas) { + $scope.loadStaring = true; // daybookDetails.generatePFD(datas,$scope.searchData.date, $scope.searchData.dateTo); @@ -384,12 +385,17 @@ $scope.dayBookApprovalAccess = ''; // console.log("success"); // }); // alert(JSON.stringify(rows1)); - var returndata = pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(){ - return true; + pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(res) { + if(res === 'success'){ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + }else{ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + } }); - if(returndata){ - $scope.loadStaring = false; - } } diff --git a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js index 4afebd0b..85776bdd 100755 --- a/Apollo/assets/js/controllers/daybooksuperadminCtrl.js +++ b/Apollo/assets/js/controllers/daybooksuperadminCtrl.js @@ -474,12 +474,29 @@ $scope.loadStaring = true; }; // alert(JSON.stringify(rows1)); - var returndata = pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(){ - return true; + // var returndata = pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(){ + // return true; + // }); + // pdfMake.createPdf(docDefinition).getDataUrl(function(url) { alert('your pdf is done'); }); + pdfMake.createPdf(docDefinition).download('DAYBOOK DETAILS' + '( ' + $scope.searchData.date + ' - ' + $scope.searchData.dateTo + ' ).pdf', function(res) { + if(res === 'success'){ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + }else{ + $scope.$apply(function(){ + $scope.loadStaring = false; + }); + } }); - if(returndata){ - $scope.loadStaring = false; - } + + // if(returndata === 1){ + // $scope.loadStaring = false; + // } + + // if(returndata){ + // $scope.loadStaring = false; + // } // pdfMake.createPdf(docDefinition).print(); // $scope.loadStaring = false; diff --git a/Apollo/assets/js/directives/pdf_make/pdfMake.js b/Apollo/assets/js/directives/pdf_make/pdfMake.js index 91d3ae97..e5df7fd4 100644 --- a/Apollo/assets/js/directives/pdf_make/pdfMake.js +++ b/Apollo/assets/js/directives/pdf_make/pdfMake.js @@ -163,7 +163,7 @@ throw 'Could not generate blob'; } if (typeof cb === "function") { - cb(); + cb('success'); } return status; }); diff --git a/Apollo/assets/views/daybook/daybook.html b/Apollo/assets/views/daybook/daybook.html index d5b70884..03c674ac 100755 --- a/Apollo/assets/views/daybook/daybook.html +++ b/Apollo/assets/views/daybook/daybook.html @@ -102,14 +102,20 @@ } -
+
+ +
Generating...
+ +
-
+
+
diff --git a/Apollo/assets/views/daybook/daybookadmin.html b/Apollo/assets/views/daybook/daybookadmin.html index eccb9a8b..22e2ab26 100755 --- a/Apollo/assets/views/daybook/daybookadmin.html +++ b/Apollo/assets/views/daybook/daybookadmin.html @@ -102,16 +102,19 @@ }
+ +
Generating...
-
+
diff --git a/Apollo/assets/views/daybook/daybooksuperadmin.html b/Apollo/assets/views/daybook/daybooksuperadmin.html index 4604dcfa..b296327b 100755 --- a/Apollo/assets/views/daybook/daybooksuperadmin.html +++ b/Apollo/assets/views/daybook/daybooksuperadmin.html @@ -83,13 +83,14 @@
- + +
Generating...
-
diff --git a/Apollo/assets/views/status-update/certificate_status.html b/Apollo/assets/views/status-update/certificate_status.html index e6d00097..90611b4f 100644 --- a/Apollo/assets/views/status-update/certificate_status.html +++ b/Apollo/assets/views/status-update/certificate_status.html @@ -243,11 +243,11 @@ - + Certificate Type is Required @@ -358,7 +358,7 @@ Certificate Type is Required