From 22b9a4ea94d898463f7541edb52344d81399c971 Mon Sep 17 00:00:00 2001 From: resicovenba Date: Thu, 22 Mar 2018 16:52:32 +0530 Subject: [PATCH] student enrollment changes: kdk --- .../api/application/models/Student_model.php | 28 ++++++++++--------- .../assets/js/controllers/daybookadminCtrl.js | 1 - Apollo/assets/js/controllers/studentCtrl.js | 2 ++ .../student/editStudentCourseDetails.html | 2 +- .../views/student/editStudentDetails.html | 22 ++++----------- 5 files changed, 24 insertions(+), 31 deletions(-) diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index 50fdf76a..c86fd2e8 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -326,14 +326,13 @@ class Student_model extends CI_Model // print_r($getSearchData);exit(); - $this->db->select('t1.*'); + $this->db->select("t1.*, IF(t3.ID > 0, '1' , '0') as Fee_paid_exist"); $this->db->from('' . STUDENTS . ' as t1'); $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.StudentID = t1.StudentID', 'LEFT'); + $this->db->join('' . STUDENTS_FEES_PAID . ' as t3', 't3.StudentID = t1.StudentID', 'LEFT'); $this->db->where('t2.BranchID', $loginUserBranchId); $this->db->group_by('t2.StudentID'); - // $this->db->from(STUDENTS); - $this->db->order_by('t2.CreatedOn', 'DESC'); $stuDetails = $this->db->get(); $checkArr = $stuDetails->result(); @@ -366,10 +365,10 @@ class Student_model extends CI_Model $StuStatus = $getSearchData['Status']; if ($StuStatus == '') { if ($University != '' && $Course == '') { - $subQuery = "SELECT S.* + $subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON - SC.CourseID = C.CourseID + SC.CourseID = C.CourseID LEFT JOIN ". STUDENTS_FEES_PAID ." as SFP ON SFP.StudentID = S.StudentID WHERE SC.UniversityID = '$University' AND SC.BranchID = '$loginUserBranchId' @@ -377,10 +376,10 @@ class Student_model extends CI_Model ORDER BY S.CreatedOn"; } else if ($University != '' && $Course != '') { - $subQuery = "SELECT S.* + $subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON - SC.CourseID = C.CourseID + SC.CourseID = C.CourseID LEFT JOIN ". STUDENTS_FEES_PAID ." as SFP ON SFP.StudentID = S.StudentID WHERE SC.CourseID = '$Course' AND SC.UniversityID = '$University' AND SC.BranchID = '$loginUserBranchId' @@ -395,10 +394,10 @@ class Student_model extends CI_Model } else { if ($University != '' && $Course == '') { - $subQuery = "SELECT S.* + $subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON - SC.CourseID = C.CourseID + SC.CourseID = C.CourseID LEFT JOIN ". STUDENTS_FEES_PAID ." as SFP ON SFP.StudentID = S.StudentID WHERE SC.UniversityID = '$University' AND SC.BranchID = '$loginUserBranchId' @@ -407,10 +406,10 @@ class Student_model extends CI_Model ORDER BY S.CreatedOn"; } else if ($University != '' && $Course != '') { - $subQuery = "SELECT S.* + $subQuery = "SELECT S.*, IF(SFP.ID > 0, '1' , '0') as Fee_paid_exist FROM " . STUDENTS . " as S LEFT JOIN " . STUDENTCOURSE . " as SC ON SC.StudentID = S.StudentID LEFT JOIN " . UNIVERSITY . " as U ON SC.UniversityID = U.UniversityID LEFT JOIN " . COURSE . " as C ON - SC.CourseID = C.CourseID + SC.CourseID = C.CourseID LEFT JOIN ". STUDENTS_FEES_PAID ." as SFP ON SFP.StudentID = S.StudentID WHERE SC.CourseID = '$Course' AND SC.UniversityID = '$University' AND SC.BranchID = '$loginUserBranchId' @@ -452,13 +451,16 @@ class Student_model extends CI_Model // echo $req['localBranchID'];exit(); - $this->db->select('t1.*,t2.UniversityName,t3.CourseName,t3.CourseCode,t4.SessionName'); + $this->db->select("t1.*,t2.UniversityName,t3.CourseName,t3.CourseCode,t4.SessionName, IF(t6.ID > 0, '1' , '0') as Fee_paid_exist"); $this->db->from('' . STUDENTCOURSE . ' as t1'); $this->db->join('' . UNIVERSITY . ' as t2', 't2.UniversityID = t1.UniversityID', 'LEFT'); $this->db->join('' . COURSE . ' as t3', 't3.CourseID = t1.CourseID', 'LEFT'); $this->db->join('' . SESSIONMASTER . ' as t4', 't4.SessionID = t1.SessionID', 'LEFT'); + $this->db->join(''.STUDENTS_FEES_STATUS.' as t5', 't5.StudentID = '.$studentId.' AND t5.CourseID = t1.CourseID', 'LEFT'); + $this->db->join(''.STUDENTS_FEES_PAID.' as t6', 't6.FeesId = t5.FeesID', 'LEFT'); $this->db->where('t1.BranchID', $req['localBranchID']); - $this->db->where('StudentID', $studentId); + $this->db->where('t1.StudentID', $studentId); + $this->db->group_by('t1.StudentID'); $courseDetails = $this->db->get(); $checkArr = $courseDetails->result(); if (count($checkArr) > 0) { diff --git a/Apollo/assets/js/controllers/daybookadminCtrl.js b/Apollo/assets/js/controllers/daybookadminCtrl.js index 0426c6d2..eaef3d8a 100755 --- a/Apollo/assets/js/controllers/daybookadminCtrl.js +++ b/Apollo/assets/js/controllers/daybookadminCtrl.js @@ -65,7 +65,6 @@ $scope.dayBookApprovalAccess = ''; return true; } }); - } // $scope.getApproveLoad = function() { diff --git a/Apollo/assets/js/controllers/studentCtrl.js b/Apollo/assets/js/controllers/studentCtrl.js index 9c5cfba0..d26162c9 100755 --- a/Apollo/assets/js/controllers/studentCtrl.js +++ b/Apollo/assets/js/controllers/studentCtrl.js @@ -51,6 +51,7 @@ app.controller('studentCtrl', ["$scope", "toaster", "$filter", "ngTableParams", // load when html page load $scope.init = function () { + $scope.localUserType = localDetails.localType; $scope.todayDate = new Date(); var nowInMS = new Date().getTime(), sixteenYearsInMS = 1000 * 60 * 60 * 24 * 365 * 16, @@ -1423,6 +1424,7 @@ app.controller('studentSuperAdminCtrl', ["$scope", "toaster", "$filter", "ngTabl $scope.viewStudentDetailsPage = false; // load when html page load $scope.init = function () { + $scope.localUserType = localDetails.localType; if (localDetail != null) { if (localDetails.localType === 'R004') { $scope.getBranchList(); diff --git a/Apollo/assets/views/student/editStudentCourseDetails.html b/Apollo/assets/views/student/editStudentCourseDetails.html index e8384e7c..94925da8 100755 --- a/Apollo/assets/views/student/editStudentCourseDetails.html +++ b/Apollo/assets/views/student/editStudentCourseDetails.html @@ -44,7 +44,7 @@ {{s.Specilization2}} {{s.DOJ}} - + diff --git a/Apollo/assets/views/student/editStudentDetails.html b/Apollo/assets/views/student/editStudentDetails.html index 2777b1d4..b0cad34a 100755 --- a/Apollo/assets/views/student/editStudentDetails.html +++ b/Apollo/assets/views/student/editStudentDetails.html @@ -103,9 +103,7 @@ - -
@@ -115,7 +113,7 @@ + ng-disabled="p.Fee_paid_exist == 1 && localUserType == 'R002'" id="primaryPhone1" required/> Mobile Number is required. Enter a Valid Phone Number
@@ -124,7 +122,7 @@ First Name + ng-disabled="p.Fee_paid_exist == 1 && localUserType == 'R002'" capitalize-first ng-pattern="/^[a-zA-Z.\s]*$/" required/> First Name is required Invalid First Name
@@ -133,7 +131,7 @@ Last Name + ng-disabled="p.Fee_paid_exist == 1 && localUserType == 'R002'" capitalize-first ng-pattern="/^[a-zA-Z.\s]*$/" required/> Last Name is required Invalid Last Name @@ -179,7 +177,6 @@ Alternate Mobile Number is required. Enter a Valid Phone Number -
@@ -242,7 +237,6 @@
-
@@ -286,7 +280,6 @@
-
+ ng-disabled="p.Fee_paid_cound > 0" ng-pattern="/^[a-zA-Z.\s]*$/" /> Invalid Referred By
@@ -358,8 +350,8 @@ Refer's Mobile Number + ng-disabled="p.Fee_paid_cound > 0" ng-model="p.ReferersMobileNumber" ng-minlength="10" + ng-maxlength="12" ng-pattern="/^[0-9]*$/" /> Refer's Mobile Number is required. Enter a Valid Phone Number
@@ -416,7 +408,6 @@ -
@@ -446,7 +437,6 @@ -