diff --git a/Apollo/api/application/config/routes.php b/Apollo/api/application/config/routes.php index bf5c2175..ae79d2f2 100755 --- a/Apollo/api/application/config/routes.php +++ b/Apollo/api/application/config/routes.php @@ -350,4 +350,6 @@ $route['getStudentUnivFeeCompareDetails'] = 'Receive_Enrolment_Fees_Univ_Control $route['formIDFeeCompareDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/formIDFeeCompareDetails'; $route['getUnmatchedRecordDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnmatchedRecordDetails'; $route['getUniversitySessionDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUniversitySessionDetails'; -$route['getUnivCourseFromFileDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnivCourseFromFileDetails'; \ No newline at end of file +$route['getUnivCourseFromFileDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getUnivCourseFromFileDetails'; +$route['getExistStudentEnrolmentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/getExistStudentEnrolmentDetails'; +$route['addManualEnrolmentDetails'] = 'Receive_Enrolment_Fees_Univ_Controller/addManualEnrolmentDetails'; diff --git a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php index dc3a7ce5..7148fd98 100644 --- a/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php +++ b/Apollo/api/application/controllers/Receive_Enrolment_Fees_Univ_Controller.php @@ -34,6 +34,9 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $this->methods['receiveEnrolmentFromUniv_post']['limit'] = 500; // 500 requests per hour per user/key $this->methods['formIDFeeCompareDetails_post']['limit'] = 500; $this->methods['getUniversitySessionDetails_post']['limit'] = 500; + $this->methods['getExistStudentEnrolmentDetails_post']['limit'] = 1000; + + $this->methods['addManualEnrolmentDetails_post']['limit'] = 1000; // load the model $this->load->model('Receive_Enrolment_Fees_Univ_model', 'receive_model'); @@ -193,7 +196,66 @@ class Receive_Enrolment_Fees_Univ_Controller extends REST_Controller { $this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code } + + } + /* + * get exist enrolment student details + * created by kms + * */ + public function getExistStudentEnrolmentDetails_post(){ + $localData = $this->post('localDetails'); + $enrolmentID=$this->post('enrolmentID'); + $getEnrolmentDetails=$this->receive_model->getExistStudentEnrolmentDetails($enrolmentID,$localData); + if($getEnrolmentDetails['status']==true){ + $this->response($getEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else if($getEnrolmentDetails['status']==false){ + $this->response($getEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + + } + else{ + $this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } + /* + * add manual enrolment details + * cretaed by kms + * */ + public function addManualEnrolmentDetails_post(){ + $now = new DateTime(); + $now->setTimezone(new DateTimezone('Asia/Kolkata')); + $localData = $this->post('localDetails'); + $studentInfo=$this->post('studentInfo'); + $semDetails=$this->post('sem'); + $studentInfo['CreatedOn'] = $now->format('Y-m-d H:i:s'); + $studentInfo['FormID'] = $this->post('formID'); + $studentInfo['SemesterYear'] = $semDetails['sem']; + $studentInfo['FormType'] = $semDetails['FormType']; + $studentInfo['SessionName'] = $semDetails['SessionName']; + $studentInfo['EnrolmentNo'] = $this->post('enrolmentID'); + $studentInfo['CreatedBy'] = $localData['localUserID']; + $studentInfo['BranchCode'] = $localData['localBranchID']; + $studentInfo['ManualEntry'] = 1; + $addEnrolmentDetails=$this->receive_model->addManualEnrolmentDetails($studentInfo); + if($addEnrolmentDetails['status']==true){ + $this->response($addEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + } + else if($addEnrolmentDetails['status']==false){ + $this->response($addEnrolmentDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code + + + } + else{ + $this->response(['message' => 'No list were found', 'status' => false], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code + + } + } + public function getUnivCourseFromFileDetails_post(){ diff --git a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php index 0f429ebd..7b399aa4 100644 --- a/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php +++ b/Apollo/api/application/models/Receive_Enrolment_Fees_Univ_model.php @@ -476,25 +476,31 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { $results['stuFeeList_details'] = "details updated successfully."; return $results; } - public function getStudentUnivFeeCompareDetails($univCode=null,$session=null){ - $this->db->select('t1.FormID, t1.FormType, t1.SemesterYear, t1.EnrolmentNo,t1.CourseName,t1.RollNo, t4.*,t5.UniversityID, t5.UniversityName,t3.CourseID,t2.Amount as UniversityPaidAmount'); - $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as t1'); - $this->db->join(STUDENTCOURSE.' as t3', 't3.EnrollmentID = t1.EnrolmentNo'); - $this->db->join(STUDENTS.' as t4', 't4.StudentID = t3.StudentID'); - $this->db->join(UNIVERSITY.' as t5', 't5.UniversityID = t3.UniversityID'); - $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as t2', 't2.FormID = t1.FormID','left'); - //$this->db->where('t1.CourseCode', $courseCode); - $this->db->where('t1.UniversityCode', $univCode); + $this->db->distinct('ENU.FormID'); + $this->db->select('ENU.FormID, ENU.FormType, ENU.SemesterYear, ENU.EnrolmentNo,ENU.RollNo, ST.*,UN.UniversityID, UN.UniversityName,CM.CourseID,CM.CourseCode,CM.CourseName'); + $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); + $this->db->join(STUDENTCOURSE.' as STC', 'STC.EnrollmentID = ENU.EnrolmentNo'); + $this->db->join(COURSE.' as CM', 'CM.CourseID = STC.CourseID'); + $this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); + $this->db->join(UNIVERSITY.' as UN', 'UN.UniversityID = STC.UniversityID'); + // $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as t2', 't2.FormID = t1.FormID','left'); + //$this->db->where('t1.CourseCode', $courseCode); + $this->db->where('ENU.UniversityCode', $univCode); - $details = $this->db->get(); - $detailsList = $details->result(); - if($detailsList){ - foreach ($detailsList as $fetchStudentRow){ + $details = $this->db->get(); + $detailsList = $details->result(); + if($detailsList){ + foreach ($detailsList as $fetchStudentRow){ + // form id bases get student paid details + $getStudentsetFeesDetails=$this->getStudentsetFeesDetails($fetchStudentRow->StudentID,$fetchStudentRow->CourseID,$fetchStudentRow->SemesterYear,$session); + if(isset($getStudentsetFeesDetails['status']) AND $getStudentsetFeesDetails['status']==true ){ + $formResult['SessionName']=$getStudentsetFeesDetails['SessionName']; $formResult['FormID']=$fetchStudentRow->FormID; $formResult['FormType']=$fetchStudentRow->FormType; $formResult['SemesterYear']=$fetchStudentRow->SemesterYear; $formResult['EnrolmentNo']=$fetchStudentRow->EnrolmentNo; + $formResult['CourseCode']=$fetchStudentRow->CourseCode; $formResult['CourseName']=$fetchStudentRow->CourseName; $formResult['RollNo']=$fetchStudentRow->RollNo; $formResult['StudentID']=$fetchStudentRow->StudentID; @@ -515,179 +521,90 @@ class Receive_Enrolment_Fees_Univ_model extends CI_Model { $formResult['Qualification']=$fetchStudentRow->Qualification; $formResult['UniversityID']=$fetchStudentRow->UniversityID; $formResult['UniversityName']=$fetchStudentRow->UniversityName; - $formResult['UniversityPaidAmount']=$fetchStudentRow->UniversityPaidAmount; - - // form id bases get student paid details - $getStudentPaidDetails=$this->getFormIDStudentPaidDetails($fetchStudentRow->StudentID,$fetchStudentRow->CourseID,$fetchStudentRow->SemesterYear); - if(sizeof($getStudentPaidDetails)!=0){ - $formResult['StudentPaidAmount']=$getStudentPaidDetails['StudentPaidAmount']; - } - else{ - $formResult['StudentPaidAmount']=''; - } - - $mergeFormDetails[]=$formResult; - + $mergeFormDetails[]=$formResult; } - $resultArr['studentFeeCompareDetails'] = $mergeFormDetails; - $resultArr['formTypeStatus'] = true; - $resultArr['message'] = "Successfully data generated"; - } else { - $resultArr['studentFeeCompareDetails'] = []; - $resultArr['formTypeStatus'] = false; - $resultArr['message'] = "No record found"; + /* if(sizeof($getStudentPaidDetails)!=0){ + $formResult['StudentPaidAmount']=$getStudentPaidDetails['StudentPaidAmount']; + } + else{ + $formResult['StudentPaidAmount']=''; + }*/ + + + } + $resultArr['studentFeeCompareDetails'] = $mergeFormDetails; + $resultArr['formTypeStatus'] = true; + $resultArr['message'] = "Successfully data generated"; + } else { + $resultArr['studentFeeCompareDetails'] = []; + $resultArr['formTypeStatus'] = false; + $resultArr['message'] = "No record found"; + } return $resultArr; } /*form id bases get student paid details for getStudentUnivFeeCompareDetails methods*/ - public function getFormIDStudentPaidDetails($studentID=null,$courseID=null,$sem=null){ + public function getStudentsetFeesDetails($studentID=null,$courseID=null,$sem=null,$session=null){ // create array for find sem value $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4',12 => "DMC CHANGE SEM1",13 => "DMC CHANGE SEM2",14 => "DMC CHANGE SEM3",15 => "DMC CHANGE SEM4",16 => "DMC CHANGE SEM5",17 => "DMC CHANGE SEM6",18 => "DMC CHANGE SEM7",19 => "DMC CHANGE SEM8",20 => "DMC CHANGE YEAR1",21 => "DMC CHANGE YEAR2",22 => "DMC CHANGE YEAR3",23 => "DMC CHANGE YEAR4"); $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4","1","2","3","4","5","6","7","8","1","2","3","4"); $feesArray=array(); $this->db->select("CF.ID,CF.ProgramType,CF.Sem_Year"); - $this->db->from(COURSE_FEES . ' as CF'); - $this->db->where('CF.CourseID', $courseID); - $courseFeesDetails = $this->db->get(); - //this is for sem year type check fees - if ($courseFeesDetails->num_rows() > 1) { - foreach ($courseFeesDetails->result() as $fetchRow) { - $serachKey = array_search(strtoupper($fetchRow->Sem_Year), $keyArray); - if ($valueArray[$serachKey] == $sem) { - $this->db->select("SUM(BillAMount) as StudentPaidAmount"); - $this->db->from(STUDENTS_FEES_STATUS . ' as SFS'); - $this->db->join(STUDENTS_FEES_PAID . ' as SFP', 'SFP.FeesId = SFS.FeesID'); - $this->db->where('SFS.FeesType', $fetchRow->ID); - $this->db->where('SFS.StudentID', $studentID); - $this->db->where('SFP.IsActive', '1'); - $feesDetails = $this->db->get()->last_row(); - if ($feesDetails) { - $feesArray['StudentPaidAmount'] = $feesDetails->StudentPaidAmount; - break; - } else { - $feesArray['StudentPaidAmount'] = 0; - break; - } - } - - } - - } - else if($courseFeesDetails->num_rows()==1){ - foreach ($courseFeesDetails->result() as $fetchRow){ - $this->db->select("SUM(BillAMount) as StudentPaidAmount"); - $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); - $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID'); - $this->db->where('SFS.FeesType',$fetchRow->ID); - $this->db->where('SFS.StudentID',$studentID); - $this->db->where('SFP.IsActive','1'); + $this->db->from(COURSE_FEES . ' as CF'); + $this->db->where('CF.CourseID', $courseID); + $courseFeesDetails = $this->db->get(); + //this is for sem year type check fees + if ($courseFeesDetails->num_rows() > 1) { + foreach ($courseFeesDetails->result() as $fetchRow) { + $serachKey = array_search(strtoupper($fetchRow->Sem_Year), $keyArray); + if ($valueArray[$serachKey] == $sem) { + $this->db->select("SM.SessionName,SM.SessionID"); + $this->db->from(STUDENTS_FEES_STATUS . ' as SFS'); + $this->db->join(SESSIONMASTER . ' as SM' , 'SM.SessionID = SFS.SessionName'); + $this->db->where('SFS.FeesType', $fetchRow->ID); + $this->db->where('SFS.StudentID', $studentID); + $this->db->where('SFS.SessionName', $session); $feesDetails = $this->db->get()->last_row(); if ($feesDetails) { - $feesArray['StudentPaidAmount'] = $feesDetails->StudentPaidAmount; + $feesArray['status'] = true; + $feesArray['SessionName'] = $feesDetails->SessionName; + $feesArray['SessionID'] = $feesDetails->SessionID; break; } else { - $feesArray['StudentPaidAmount'] = 0; - break; - } - - } - } - else{ - $feesArray['StudentPaidAmount'] = 0; - } - return $feesArray; - } - /* - * form id bases get fees compare details - * created by kms - * */ - public function getFormIDFeeDetails($serachForm=null){ - // create array for find sem value - $keyArray = array(0 => 'SEM1', 1 => 'SEM2', 2 => 'SEM3', 3 => 'SEM4',4 => 'SEM5',5 => 'SEM6',6 => 'SEM7',7 => 'SEM8',8 => 'YEAR1',9 => 'YEAR2',10 => 'YEAR3',11 => 'YEAR4',12 => "DMC CHANGE SEM1",13 => "DMC CHANGE SEM2",14 => "DMC CHANGE SEM3",15 => "DMC CHANGE SEM4",16 => "DMC CHANGE SEM5",17 => "DMC CHANGE SEM6",18 => "DMC CHANGE SEM7",19 => "DMC CHANGE SEM8",20 => "DMC CHANGE YEAR1",21 => "DMC CHANGE YEAR2",22 => "DMC CHANGE YEAR3",23 => "DMC CHANGE YEAR4"); - $valueArray = array("1","2","3","4","5","6","7","8","1","2","3","4","1","2","3","4","5","6","7","8","1","2","3","4"); - if($serachForm['FormID']!=''){ - $this->db->select("ENU.FormID,ENU.SemesterYear,STC.StudentID,STC.BranchID,CF.ID,CF.ProgramType,CF.Sem_Year,FFRU.Amount as UniversityPaidAmount"); - $this->db->from(ENROLMENTRECEIVEDFROMUNIV.' as ENU'); - $this->db->join(STUDENTCOURSE.' as STC', 'STC.EnrollmentID = ENU.EnrolmentNo'); - $this->db->join(COURSE_FEES.' as CF', 'CF.CourseID = STC.CourseID'); - $this->db->join(FORMFEESRECEIVEDFROMUNIV.' as FFRU', 'FFRU.FormID = ENU.FormID'); - $this->db->where('ENU.FormID',$serachForm['FormID']); - $this->db->where('ENU.EnrolmentNo',$serachForm['EnrolmentNo']); - $studentCourseDetails = $this->db->get(); - - //this is for sem year type check fees - if($studentCourseDetails->num_rows()>1){ - foreach ($studentCourseDetails->result() as $fetchRow){ - $serachKey= array_search(strtoupper($fetchRow->Sem_Year),$keyArray); - if($valueArray[$serachKey]==$fetchRow->SemesterYear){ - $this->db->select("SUM(BillAMount) as StudentPaidAmount"); - $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); - $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID'); - $this->db->where('SFS.FeesType',$fetchRow->ID); - $this->db->where('SFS.StudentID',$fetchRow->StudentID); - $this->db->where('SFP.IsActive','1'); - $feesDetails = $this->db->get()->last_row(); - if($feesDetails){ - $feesArray['status']=true; - $feesArray['Message']="Fees paid both student and university"; - $feesArray['Type']=$fetchRow->Sem_Year; - $feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount; - $feesArray['StudentPaidAmount']=$feesDetails->StudentPaidAmount; - break; - } - else{ - $feesArray['status']=true; - $feesArray['Message']="University fees paid and student fees pending"; - $feesArray['Type']=$fetchRow->Sem_Year; - $feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount; - $feesArray['StudentPaidAmount']=0; + $feesArray['status'] = false; break; } } } - } - else if($studentCourseDetails->num_rows()==1){ - foreach ($studentCourseDetails->result() as $fetchRow){ - $this->db->select("SUM(BillAMount) as StudentPaidAmount"); - $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); - $this->db->join(STUDENTS_FEES_PAID.' as SFP', 'SFP.FeesId = SFS.FeesID'); - $this->db->where('SFS.FeesType',$fetchRow->ID); - $this->db->where('SFS.StudentID',$fetchRow->StudentID); - $this->db->where('SFP.IsActive','1'); - $feesDetails = $this->db->get()->last_row(); - if($feesDetails){ - $feesArray['status']=true; - $feesArray['Message']="Fees paid both student and university"; - $feesArray['Type']=$fetchRow->Sem_Year; - $feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount; - $feesArray['StudentPaidAmount']=$feesDetails->StudentPaidAmount; - break; - } - else{ - $feesArray['status']=true; - $feesArray['Message']="University fees paid and student fees pending"; - $feesArray['Type']=$fetchRow->Sem_Year; - $feesArray['UniversityPaidAmount']=$fetchRow->UniversityPaidAmount; - $feesArray['StudentPaidAmount']=0; - } + else if($courseFeesDetails->num_rows()==1){ + foreach ($courseFeesDetails->result() as $fetchRow){ + $this->db->select("SM.SessionName,SM.SessionID"); + $this->db->from(STUDENTS_FEES_STATUS.' as SFS'); + $this->db->join(SESSIONMASTER . ' as SM' , 'SM.SessionID = SFS.SessionName'); + $this->db->where('SFS.FeesType',$fetchRow->ID); + $this->db->where('SFS.StudentID',$studentID); + $this->db->where('SFS.SessionName', $session); + $feesDetails = $this->db->get()->last_row(); + if ($feesDetails) { + $feesArray['status'] = true; - } - } - else{ - $feesArray['status']=false; - $feesArray['Message']="Student record is mismatch because of enrolment number is not registered in student course details"; - - } + $feesArray['SessionName'] = $feesDetails->SessionName; + $feesArray['SessionID'] = $feesDetails->SessionID; + break; + } else { + $feesArray['status'] = false; + break; } - else{ - $feesArray['status']=false; - $feesArray['Message']="Please check form id"; - } - return $feesArray; + } + } + else{ + $feesArray['status'] = false; + } + return $feesArray; } /** * Unmached file details diff --git a/Apollo/api/application/models/Reports_model.php b/Apollo/api/application/models/Reports_model.php index 5f17090f..872cea01 100755 --- a/Apollo/api/application/models/Reports_model.php +++ b/Apollo/api/application/models/Reports_model.php @@ -444,7 +444,8 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se } public function app_pending($bat=null,$br=null,$u=null){ - $sql = "SELECT * FROM (SELECT + $sql = "SELECT + APFS.ID as id, APFS.Registration_Details_ID AS regid, APFS.ListCode as StatusCode, APFS.AppFormDate as StatusUpdationOn, @@ -463,14 +464,18 @@ left join BalFees bal on bal.student=sms.sid and bal.feestype=sms.cid and bal.se CFD.Sem_Year as Sem_Year, RD.RegistrationType as FormType, STU.StudentID as Student_id -FROM T_ApplicationFormStatus AS APFS LEFT JOIN T_Registration_Details AS RD ON RD.ID = APFS.Registration_Details_ID -LEFT JOIN T_PickListDetails AS PKL ON PKL.ListCode = APFS.ListCode LEFT JOIN T_StudentDetails AS STU ON STU.StudentID = RD.StudentID LEFT JOIN T_CourseMaster AS COUR ON COUR.CourseID = RD.CourseID LEFT JOIN T_Student_CourseDetails AS STU_COUR ON STU_COUR.StudentID = RD.StudentID AND STU_COUR.CourseID = RD.CourseID +FROM T_ApplicationFormStatus AS APFS +LEFT JOIN T_Registration_Details AS RD ON RD.ID = APFS.Registration_Details_ID +LEFT JOIN T_PickListDetails AS PKL ON PKL.ListCode = APFS.ListCode +LEFT JOIN T_StudentDetails AS STU ON STU.StudentID = RD.StudentID +LEFT JOIN T_CourseMaster AS COUR ON COUR.CourseID = RD.CourseID +LEFT JOIN T_Student_CourseDetails AS STU_COUR ON STU_COUR.StudentID = RD.StudentID AND STU_COUR.CourseID = RD.CourseID LEFT JOIN T_Course_Fees_Details AS CFD ON CFD.ID = RD.FeeType LEFT JOIN T_UniversityMaster AS UNIV ON UNIV.UniversityID = COUR.UniversityID LEFT JOIN (SELECT FeesId AS FeeID, min(CreatedOn), BillDate AS BILL FROM T_Students_Fees_PaidDetails GROUP BY FeesId) AS sfpd ON sfpd.FeeID = RD.Student_Fee_Status_Id -where COUR.UniversityID = '$u' and RD.BatchCode = '$bat'and STU_COUR.BranchID = '$br' and STU.IsActive = '1' -ORDER BY StatusUpdationOn DESC) x -GROUP BY x.regid"; +where STU.IsActive = '1' and APFS.ID in (select max(ID) from T_ApplicationFormStatus group by Registration_Details_ID) + + "; // SELECT * FROM (SELECT APFS.Registration_Details_ID AS regid, APFS.ListCode AS StatusCode, APFS.AppFormDate AS StatusUpdationOn, APFS.Comments AS StatusComments, PKL.ListName AS StatusName, concat(STU.Firstname,' ', STU.Lastname) AS StudentName, STU.Fathername AS FatherName, STU.MobileNumber AS Phone_number, COUR.CourseName AS CourseName, UNIV.UniversityName AS UniversityName, sfpd.BILL AS InitialPayDate, RD.Student_Fee_Status_Id AS FeesStatusID, STU_COUR.EnrollmentID AS EnrollmentNumber, CFD.Sem_Year AS Sem_Year, RD.RegistrationType AS FormType, STU.StudentID // FROM T_ApplicationFormStatus AS APFS LEFT JOIN T_Registration_Details AS RD ON RD.ID = APFS.Registration_Details_ID @@ -510,6 +515,20 @@ GROUP BY x.regid"; // LEFT JOIN (Select FeesId as FeeID, min(CreatedOn), BillDate as BILL FROM T_Students_Fees_PaidDetails group by FeesId) as sfpd on sfpd.FeeID = RD.Student_Fee_Status_Id // where COUR.UniversityID = '$u' and RD.BatchCode = '$bat'and STU_COUR.BranchID = '$br' and STU.IsActive = '1' // group by APFS.Registration_Details_ID"; + + if ($bat!= ''){ + + $sql.=" and RD.BatchCode = '".$bat."'"; + + } + if ($u!= ''){ + + $sql.=" and COUR.UniversityID = '".$u."'"; + + } + $sql.=" group by regid,Student_id "; + $sql.=" ORDER BY StatusUpdationOn DESC "; + $leadDet=$this->db->query($sql); $answer = $leadDet->result(); if (count($answer) > 0) { diff --git a/Apollo/assets/js/controllers/student_university_fee_compare.js b/Apollo/assets/js/controllers/student_university_fee_compare.js index 71357c3f..2ab1c705 100644 --- a/Apollo/assets/js/controllers/student_university_fee_compare.js +++ b/Apollo/assets/js/controllers/student_university_fee_compare.js @@ -15,7 +15,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil // load when html page load $scope.init = function () { - + var logcheck = JSON.parse(localStorage.getItem('localObj')); const LOCALTYPE = logcheck.localType; @@ -134,7 +134,7 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil }); - + $scope.Searchloader = false; $scope.studentData = false; @@ -278,8 +278,6 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil } $scope.receiveFormIdFeeDetails = function(details) { - console.log(details); - var updateUniversityEnrolment = { method: 'POST', url: apiPoint.url + 'insertFormIdUnivFeeDetails/', @@ -369,6 +367,120 @@ app.controller('student_university_fee_compareCtrl', ["$scope", "toaster", "$fil $scope.unMatchedRecordDetails=response.data.unMatchedRecordDetails; } }); + } + $scope.manualEnModel={ + "enrolmentNo": '', + "formID":"", + "sem":'', + }; + /* + * add manual enrolment details + * */ + $scope.enableEnrolment=false; + $scope.addManualEnrolemntDetails=function (values) { + if(values=='1'){ + $scope.enableEnrolment=!$scope.enableEnrolment; + } + else{ + $scope.enableEnrolment=!$scope.enableEnrolment; + } + + } + /* + * check enrolment exist or not in student details + * */ + $scope.semList=[]; + $scope.studentInfo=[]; + $scope.checkEnrolmentExistDetails=function (form,entryModel) { + $scope.semList=[]; + $scope.studentInfo=[]; + var getExistEnrol = { + method: 'POST', + url: apiPoint.url + 'getExistStudentEnrolmentDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + enrolmentID: entryModel + } + }; + $http(getExistEnrol).then(function (response) { + if (response.data.status == true) { + if(response.data.semDetails.length==0){ + swal("Warning","Already form enrolment is created for all semester", "warning"); + } + else{ + $scope.studentInfo=response.data.StudentInfo; + $scope.semList=response.data.semDetails; + } + + } else { + $scope.semList=[]; + $scope.studentInfo=[]; + swal("Failed",response.data.message, "error"); + + } + }); + + } + /* + * cancel manual entry for enrolment details + * */ + $scope.cancelManualEntry=function (form) { + $scope.semList=[]; + $scope.enableEnrolment=!$scope.enableEnrolment; + } + /* + * submit manual entry form details + * */ + $scope.manualEnrolmentSubmit = function (form) { + if($scope.manualEnModel.enrolmentNo=='' || $scope.manualEnModel.enrolmentNo==null || $scope.manualEnModel.enrolmentNo==undefined){ + swal("Wraning","Please enter enrolment id", "warning"); + + } + else if($scope.manualEnModel.sem=='' || $scope.manualEnModel.sem==null){ + swal("Wraning","Please select sem", "warning"); + + } + else if($scope.manualEnModel.formID=='' || $scope.manualEnModel.formID==null){ + swal("Wraning","Please enter form id", "warning"); + + } + else{ + var addEntry = { + method: 'POST', + url: apiPoint.url + 'addManualEnrolmentDetails/', + headers: { + 'Content-Type': 'application/json' + }, + data: { + localDetails: localDetail, + enrolmentID: $scope.manualEnModel.enrolmentNo, + formID: $scope.manualEnModel.formID, + sem: $scope.manualEnModel.sem, + studentInfo:$scope.studentInfo + } + }; + $http(addEntry).then(function (response) { + if (response.data.status == true) { + $scope.studentInfo=""; + $scope.semList=[]; + form.manualFormID.$setPristine(true); + form.manualSem.$setPristine(true); + swal("Success",response.data.message, "success"); + } else { + swal("Failed",response.data.message, "error"); + + } + }); + } + + + + + + } }]); diff --git a/Apollo/assets/js/directives/convert-words.js b/Apollo/assets/js/directives/convert-words.js index 53674596..5568af9a 100755 --- a/Apollo/assets/js/directives/convert-words.js +++ b/Apollo/assets/js/directives/convert-words.js @@ -184,4 +184,21 @@ app.service('dateListDescService', function() { }); return listDetails; } +}); +app.directive('numberOnly', function () { + return { + require: 'ngModel', + restrict: 'A', + link: function (scope, element, attrs, ctrl) { + ctrl.$parsers.push(function (input) { + if (input == undefined) return '' + var inputNumber = input.toString().replace(/[^0-9]/g, ''); + if (inputNumber != input) { + ctrl.$setViewValue(inputNumber); + ctrl.$render(); + } + return inputNumber; + }); + } + }; }); \ No newline at end of file diff --git a/Apollo/assets/views/student/studentUnivFeeCompareDetails.html b/Apollo/assets/views/student/studentUnivFeeCompareDetails.html index 0b9764ec..71cc90fd 100644 --- a/Apollo/assets/views/student/studentUnivFeeCompareDetails.html +++ b/Apollo/assets/views/student/studentUnivFeeCompareDetails.html @@ -43,7 +43,7 @@
- + +
+ +
+
+
+
+
+
+ + Add Enrolment Details + + +
+
+
+ + + + Enrolment no is required + Enter a valid enrolment no + +
+
+ +
+
+
+
+ + + Sem is required +
+ +
+ + + + Form id is required +
+
+
+ + + +
+
+
+ + +
+ +
+
+
+
+ +
@@ -104,6 +187,8 @@ FormID + Enrolment No + Form Type Student Name @@ -116,12 +201,7 @@ Sem/Year - Enrolment ID - - University Paid - - Student Paid - + @@ -129,6 +209,7 @@ {{p.FormID}} + {{p.EnrolmentNo}} {{p.FormType}} @@ -142,9 +223,7 @@ {{p.UniversityName}} {{p.CourseName}} {{p.SemesterYear}} - {{p.EnrolmentNo}} - {{p.UniversityPaidAmount}} - {{p.StudentPaidAmount}} +