diff --git a/Apollo/api/application/controllers/Reregister_Controller.php b/Apollo/api/application/controllers/Reregister_Controller.php index 2967a0f7..d4fbd091 100644 --- a/Apollo/api/application/controllers/Reregister_Controller.php +++ b/Apollo/api/application/controllers/Reregister_Controller.php @@ -160,7 +160,7 @@ class Reregister_Controller extends REST_Controller { $SemesterID = $this->post('SemNum'); $branchId = $this->post('branchId'); - $course = $this->post('Course'); + $course = $this->post(' Course '); foreach($SemesterID as $sem){ if(!empty($sem)){ $subjectDetails[] = $this->Reregister_model->getsubject($sem,$branchId,$course); diff --git a/Apollo/api/application/models/Reregister_model.php b/Apollo/api/application/models/Reregister_model.php index e1eb5271..3d922935 100644 --- a/Apollo/api/application/models/Reregister_model.php +++ b/Apollo/api/application/models/Reregister_model.php @@ -345,7 +345,8 @@ class Reregister_model extends CI_Model $this->db->where('T_Students_Fees_Status.BatchCode',$batch); $this->db->where('T_Students_Fees_Status.BranchCode',$branchId); $this->db->where('T_Students_Fees_Status.CourseID',$courseID); - + // $this->db->order_by('T_Students_Fees_Status.FeesID','DESC'); + // $this->db->limit(1); $res = $this->db->get(); $data = $res->result(); $result_array = array(); @@ -356,8 +357,8 @@ class Reregister_model extends CI_Model $prestu = ""; foreach($data as $r) { - // if($prestu != $r->StudentID) - // { + if($prestu != $r->StudentID) + { $studentdetails['StudentID'] = $r->StudentID; @@ -374,20 +375,22 @@ class Reregister_model extends CI_Model // if(!empty($studetdetails['FeeDetails'])){ $result[] = $studentdetails; //} - // $prestu = $r->StudentID; - // } + $prestu = $r->StudentID; + } //print_r($result_array); } - } + } + //print_r($result);die; //echo json_encode(urldecode($result));die; - //print_r($studentdetails);die; + //die; return $result; } function getFeeSemesterDetails($stuid,$bcode,$branchId,$courseID) { + $this->db->distinct(); $this->db->select("T_Course_Fees_Details.FeesType,T_Course_Fees_Details.ID as FeesID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem',substr(sem_Year,-1),if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year',substr(T_Course_Fees_Details.sem_Year,-1),false)) as SemID,if(substr(substr(T_Course_Fees_Details.sem_Year,-4),1,3) = 'sem','SEM',if(substr(substr(T_Course_Fees_Details.sem_Year,-5),1,4) = 'year','YEAR',false)) as SubType,T_Course_Fees_Details.Sem_Year,if(T_Course_Fees_Details.ProgramType = 'Y001','SEM',if(ProgramType = 'P001','REG',if(ProgramType = 'P002','LAT','FALSE'))) as Type"); $this->db->from('T_Students_Fees_Status'); //$this->db->join('T_StudentDetails','T_Students_Fees_Status.StudentID=T_StudentDetails.StudentID'); @@ -397,10 +400,11 @@ class Reregister_model extends CI_Model $this->db->where('T_Students_Fees_Status.CourseID',$courseID); $this->db->where('T_Students_Fees_Status.StudentID',$stuid); $this->db->where("T_Course_Fees_Details.FeesType !='F001'"); - $this->db->order_by('T_Course_Fees_Details.Sem_Year','DESC'); - $this->db->limit(1); + $this->db->order_by('T_Students_Fees_Status.FeesID','DESC'); + $this->db->limit(1); $res = $this->db->get(); + //print_r($res->result()); return $res->result(); } function getSubject($sem,$branch,$course){ diff --git a/Apollo/assets/js/controllers/reregistrationformCtrl.js b/Apollo/assets/js/controllers/reregistrationformCtrl.js index 6417b84f..5c272a13 100644 --- a/Apollo/assets/js/controllers/reregistrationformCtrl.js +++ b/Apollo/assets/js/controllers/reregistrationformCtrl.js @@ -16,6 +16,14 @@ app.controller('reregistrationformCtrl', ["$scope","$rootScope","toaster", "$fil } $scope.disable = true; $scope.init = function () { + $scope.Year = [ + {Year:"Year1",SemNum:1}, + {Year:"Year2",SemNum:3}, + {Year:"Year3",SemNum:5}, + {Year:"Year4",SemNum:7}, + + + ]; $scope.Sem = [ {Sem:"SEM1",SemNum:1}, {Sem:"SEM2",SemNum:2}, @@ -27,14 +35,7 @@ app.controller('reregistrationformCtrl', ["$scope","$rootScope","toaster", "$fil {Sem:"SEM8",SemNum:8}, ]; - $scope.Year = [ - {Year:"Year1",SemNum:1}, - {Year:"Year2",SemNum:3}, - {Year:"Year3",SemNum:5}, - {Year:"Year4",SemNum:7}, - - - ]; + // console.log($scope.Sem); var getUniv = { @@ -282,6 +283,7 @@ app.controller('reregistrationformCtrl', ["$scope","$rootScope","toaster", "$fil // console.log($rootScope.Student); // return false; $rootScope.sem = sem; + $rootScope.Year = sem; //console.log($rootScope.sem); $rootScope.Course = coursefiltered[0]; //console.log($rootScope.Course); @@ -309,13 +311,47 @@ app.controller('reregistrationformCtrl', ["$scope","$rootScope","toaster", "$fil }; $scope.generatePDF = function(){ // alert(); + var sem = ''; + // var semfiltered = ''; + var yearfiltered = angular.forEach($scope.Student,function(Student,key){ + //console.log($scope.Year); + if(Student.FeeDetails[0].SubType =="SEM"){ + sem = $scope.sem.filter((Semester)=>Semester.SemNum == $scope.sem[key]); + sem = "Sem/Year: SEM"+$scope.sem[key]; + }else{ + // yearfiltered = $scope.Year.filter((Year)=>Year.SemNum == $scope.Year[key]); + // console.log(yearfiltered); + // sem = "Sem/Year: SEM"+$scope.Year[key]; + if($scope.Year[key]==1){ + + console.log("1"); + sem = "Sem/Year: YEAR1"; + } + else if($scope.Year[key]==3){ + + console.log("1"); + sem = "Sem/Year: YEAR2"; + } + else if($scope.Year[key]==5){ + + console.log("1"); + sem = "Sem/Year: YEAR3"; + } + else{ + + + sem = "Sem/Year: YEAR4"; + } + } + $scope.universityAddress = $scope.university.Address; $scope.universitydetails = "Mobile: "+$scope.university.MobileNumber+",E-mail id:"+$scope.university.EmailID+ ",Website:-"; $scope.Enroll = "Enrolment No: "; - $scope.corseDetails = "Course Name: "+$scope.Course.CourseName+" specialization: "+$scope.Course.Specilization +"Sem/Year: SEM"+$scope.sem[key]; + $scope.corseDetails = "Course Name: "+$scope.Course.CourseName+" specialization: "+$scope.Course.Specilization +sem + $scope.StudentName = "Name of the Candidate: "+Student.Firstname +' '+ Student.Lastname; $scope.StudentFatername = "Father's Name: "+Student.Fathername; $scope.StudentMotherName = "Mother's Name: "+Student.MotherName; diff --git a/Apollo/assets/views/reregistration/reregistrationform.html b/Apollo/assets/views/reregistration/reregistrationform.html index 51848acb..7ae06b95 100644 --- a/Apollo/assets/views/reregistration/reregistrationform.html +++ b/Apollo/assets/views/reregistration/reregistrationform.html @@ -146,7 +146,7 @@
Course Name: {{Course.CourseName}} specialization {{Course.Specilization}} Sem/Year SEM{{sem[$index]}}
+Course Name: {{Course.CourseName}} specialization {{Course.Specilization}} Sem/Year SEM{{sem[$index]}} + + YEAR1 + YEAR2 + YEAR3 + YEAR4 + +
Examination Session: January June Semester Mode Yearly Mode