From 5aa9fc3e0de6a6eb053ba9de99807cbfe851f13e Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 23 Jan 2019 16:45:39 +0530 Subject: [PATCH] exam attendance issue no:1616 --- Apollo/api/application/config/database.php | 12 ++++---- .../controllers/HallTickets_Controller.php | 6 +++- .../application/models/Hallticket_model.php | 22 +++++++++++++-- .../js/controllers/examAttendanceCtrl.js | 22 +++++++++++---- .../views/hallticket/examAttendance.html | 28 ++++++++++++++++++- .../views/hallticket/examAttendancePDF.html | 22 +++++++++++++-- 6 files changed, 93 insertions(+), 19 deletions(-) diff --git a/Apollo/api/application/config/database.php b/Apollo/api/application/config/database.php index ed22f21b..7741a6d9 100755 --- a/Apollo/api/application/config/database.php +++ b/Apollo/api/application/config/database.php @@ -76,13 +76,13 @@ $query_builder = TRUE; $db['default'] = array( 'dsn' => '', 'hostname' => 'apollodec.com', - // 'username' => 'apollod4_DEV', - // 'password' => 'apollo1234', - // 'database' => 'apollod4_ApolloDECDev', + 'username' => 'apollod4_DEV', + 'password' => 'apollo1234', + 'database' => 'apollod4_ApolloDECDev', - 'username' => 'apollod4_SIT', - 'password' => 'apollosit1234', - 'database' => 'apollod4_ApolloDECNEWSIT', + // 'username' => 'apollod4_SIT', + // 'password' => 'apollosit1234', + // 'database' => 'apollod4_ApolloDECNEWSIT', // 'username' => 'apollod4_PROD', // 'password' => 'approd!2017', diff --git a/Apollo/api/application/controllers/HallTickets_Controller.php b/Apollo/api/application/controllers/HallTickets_Controller.php index 5dd3aacd..dc12fcf1 100644 --- a/Apollo/api/application/controllers/HallTickets_Controller.php +++ b/Apollo/api/application/controllers/HallTickets_Controller.php @@ -258,10 +258,14 @@ class HallTickets_Controller extends REST_Controller { $examDate = date_create($examDate); $examDate = date_format(date_add($examDate,date_interval_create_from_date_string("1 days")),'Y-m-d'); $batch = $this->post('batch'); + + $exam_attendance = $this->post('exam_attendance'); + + //echo $exam_attendance;die(); //echo $examDate; $universityID = $this->post('university'); //print_r($universityID);die(); - $result = $this->Hallticket_model->getExamAttendance_model($universityID['universityID'],$branchId,$centerName,$examDate,$batch); + $result = $this->Hallticket_model->getExamAttendance_model($universityID['universityID'],$branchId,$centerName,$examDate,$batch,$exam_attendance); if($result) { $data['status'] = REST_Controller::HTTP_OK; diff --git a/Apollo/api/application/models/Hallticket_model.php b/Apollo/api/application/models/Hallticket_model.php index 5eb88285..0baad647 100644 --- a/Apollo/api/application/models/Hallticket_model.php +++ b/Apollo/api/application/models/Hallticket_model.php @@ -1281,9 +1281,9 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) return $data; } - public function getExamAttendance_model($UID,$branchId,$centerName,$examDate,$batch) + public function getExamAttendance_model($UID,$branchId,$centerName,$examDate,$batch,$exam_attendance) { - + //echo $UID;die(); $sql = "SELECT DISTINCT T_Hallticket_Master.UniversityID,T_UniversityMaster.UniversityName,T_Hallticket_Master.CourseID,T_CourseMaster.CourseName,T_CourseMaster.CourseCode,T_Hallticket_Master.BatchCode,T_BatchMaster.BatchName,T_Hallticket_Master.BranchCode,T_Hallticket_Master.CenterID,T_CenterMaster.CenterName,T_Hallticket_Student_Details.StudentID,T_StudentDetails.Firstname,T_StudentDetails.Lastname,T_Hallticket_Student_Details.EnrollmentID,T_Hallticket_Student_Details.Sem_Year,T_Hallticket_Subject_Details.SubjectCode,T_SubjectMaster.SubjectName,T_SubjectMaster.SubjectCode,T_Hallticket_Subject_Details.ExamDate,T_Hallticket_Subject_Details.FromTime,T_Hallticket_Subject_Details.EndTime FROM T_Hallticket_Master @@ -1305,9 +1305,25 @@ public function getSubjectMappingDetails($universityID,$courseIDS,$branchId) WHERE T_Hallticket_Master.UniversityID = ? AND T_Hallticket_Master.BatchCode = ? AND T_Hallticket_Master.BranchCode = ? AND T_Hallticket_Master.CenterID = ? AND STR_TO_DATE(T_Hallticket_Subject_Details.ExamDate,'%Y-%m-%d') = STR_TO_DATE(?,'%Y-%m-%d')"; + + if ($exam_attendance == 'Morning') + { + + $sql.=" and substring(T_Hallticket_Subject_Details.FromTime,6,2) ='AM'"; + + } + + + if ($exam_attendance == 'AfterNoon') + { + + $sql.=" and substring(T_Hallticket_Subject_Details.FromTime,6,2) ='PM'"; + + } + $res = $this->db->query($sql,array($UID,$batch,$branchId,$centerName['CenterID'],$examDate)); $result = $res->result(); - //print_r($this->db->last_query()); + //print_r($this->db->last_query());die(); //echo "MODEL";print_r($result);die(); return $result; diff --git a/Apollo/assets/js/controllers/examAttendanceCtrl.js b/Apollo/assets/js/controllers/examAttendanceCtrl.js index dee07d07..13ceed55 100644 --- a/Apollo/assets/js/controllers/examAttendanceCtrl.js +++ b/Apollo/assets/js/controllers/examAttendanceCtrl.js @@ -8,7 +8,8 @@ app.controller('examAttendanceCtrl', ["$scope","$rootScope","toaster", "$filter" "batchName":"", "centerName":"", "examDate":"", - "universityName":"" + "universityName":"", + "examAttendance":"" }; $scope.pdfModel = { @@ -93,10 +94,11 @@ $scope.isLoaderTxt = "Loading..."; * created by kms * */ $scope.studentInfo=""; + $scope.ExamAttendancee=""; $scope.getExamAttendanceDetails = function (form,myModel) { - + //console.log(myModel);return false; if(myModel.universityName == '' || myModel.universityName == null || myModel.universityName == undefined){ swal('Select University','','warning'); return false; @@ -113,6 +115,11 @@ $scope.isLoaderTxt = "Loading..."; if(myModel.examDate == null || myModel.examDate == '' || myModel.examDate == undefined){ swal('Select Date of Examination','','warning'); return false; + } + + if(myModel.examAttendance == null || myModel.examAttendance == '' || myModel.examAttendance == undefined){ + swal('Select Timing of Examination','','warning'); + return false; } @@ -141,6 +148,8 @@ $scope.isLoaderTxt = "Loading..."; var examDate = myModel.examDate; var batch = myModel.batchName; var University =myModel.universityName; + var exam_attendance = myModel.examAttendance; + $scope.ExamAttendancee = exam_attendance; //alert(examDate); var getAttendance = { method: 'POST', @@ -156,6 +165,7 @@ $scope.isLoaderTxt = "Loading..."; requestedtBy: JSON.parse(localStorage.getItem('localObj')).localUserID, branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, requestedDept: JSON.parse(localStorage.getItem('localObj')).localType, + exam_attendance:exam_attendance, } }; $http(getAttendance).then(function (response) { @@ -211,6 +221,8 @@ $scope.isLoaderTxt = "Loading..."; $rootScope.pdfbatch = PDFBATCH; $rootScope.pdfexamdate = PDFEXAMDATE; $rootScope.pdfuname = UNAME; + $rootScope.ExamAttens = $scope.ExamAttendancee; + //console.log($rootScope.ExamAttens);return false; var Size = {width:800}; var modalInstance = $modal.open({ templateUrl: 'assets/views/hallticket/examAttendancePDF.html', @@ -254,7 +266,7 @@ $scope.isLoaderTxt = "Loading..."; var AttendanceTableID_PM = ""; $scope.pdfExamDateToDisplay = $filter('date')(new Date($rootScope.pdfexamdate),'dd-MM-yyyy'); - var fileNameAM = $rootScope.pdfuname+'-'+$rootScope.pdfcenter['CenterName']+"-"+$rootScope.pdfbatch+'- Attendance of '+$scope.pdfExamDateToDisplay+'Fore Noon Session.PDF'; + var fileNameAM = $rootScope.pdfuname+'-'+$rootScope.pdfcenter['CenterName']+"-"+$rootScope.pdfbatch+'- Attendance of '+$scope.pdfExamDateToDisplay+'ForeNoon Session.PDF'; var fileNamePM = $rootScope.pdfuname+'-'+$rootScope.pdfcenter['CenterName']+"-"+$rootScope.pdfbatch+'- Attendance of '+$scope.pdfExamDateToDisplay+'After Noon Session.PDF'; @@ -266,7 +278,7 @@ $scope.isLoaderTxt = "Loading..."; }; var doc1 = new jsPDF('l', 'pt'); doc1.autoTableSetDefaults({ - styles: {cellPadding: 3.0, fontSize: 6}, + styles: {cellPadding: 3.0, fontSize: 12}, headerStyles: {fillColor: [245, 245, 240], textColor: 0} }); @@ -294,7 +306,7 @@ $scope.isLoaderTxt = "Loading..."; var headerAM = function(data) { var heading = $rootScope.pdfuname+' '+$rootScope.pdfbatch+' Examination'+' '+'Center'+' '+$rootScope.pdfcenter['CenterName']; - var heading1='Attendance of '+$scope.pdfExamDateToDisplay+'Fore Noon Session'; + var heading1='Attendance of '+$scope.pdfExamDateToDisplay+'Forenoon Session'; doc1.setFontSize(9); doc1.setFontStyle('bold'); //doc1.text(60,30,heading); diff --git a/Apollo/assets/views/hallticket/examAttendance.html b/Apollo/assets/views/hallticket/examAttendance.html index 6fe0c18f..5c1538bb 100644 --- a/Apollo/assets/views/hallticket/examAttendance.html +++ b/Apollo/assets/views/hallticket/examAttendance.html @@ -94,7 +94,30 @@ is-open="startOpen" ng-init="startOpen = false" name="examdate" datepicker-options="dateOptions" placeholder="Select Examiniation Date" close-text="Close" required="required" ng-change=""/> - + + + + +
+ + + + +
+ + + + + +
@@ -115,6 +138,9 @@
+ + + diff --git a/Apollo/assets/views/hallticket/examAttendancePDF.html b/Apollo/assets/views/hallticket/examAttendancePDF.html index 7506ef6d..a2fc74ec 100644 --- a/Apollo/assets/views/hallticket/examAttendancePDF.html +++ b/Apollo/assets/views/hallticket/examAttendancePDF.html @@ -16,18 +16,19 @@ - + +
- +
{{pdfuname}} {{ pdfbatch }}- Examination {{pdfcenter.CenterName}} Center Attendance - {{pdfexamdate | date:"dd-MM-yyyy"}}
{{pdfuname}} {{ pdfbatch }}- Examination {{pdfcenter.CenterName}} Center Morning Attendance - {{pdfexamdate | date:"dd-MM-yyyy"}}
- +
@@ -43,6 +44,21 @@
+ + +
+
+ + + + + + + +
{{pdfuname}} {{ pdfbatch }}- Examination {{pdfcenter.CenterName}} Center AfterNoon Attendance - {{pdfexamdate | date:"dd-MM-yyyy"}}
+
+ +