From 4b9d01399a27e2b11572974d4b79dbcaab63450c Mon Sep 17 00:00:00 2001 From: resicovenba Date: Thu, 8 Feb 2018 15:03:29 +0530 Subject: [PATCH] student add screen changes:kdk --- .../models/StatusUpdation_model.php | 8 +-- .../api/application/models/Student_model.php | 58 +++++++++++-------- Apollo/assets/js/controllers/loginCtrl.js | 7 ++- Apollo/assets/js/controllers/sessionCtrl.js | 4 +- .../student/student_details_SuperAdmin.html | 2 +- 5 files changed, 46 insertions(+), 33 deletions(-) diff --git a/Apollo/api/application/models/StatusUpdation_model.php b/Apollo/api/application/models/StatusUpdation_model.php index fd7945ad..83490b73 100755 --- a/Apollo/api/application/models/StatusUpdation_model.php +++ b/Apollo/api/application/models/StatusUpdation_model.php @@ -105,9 +105,7 @@ class StatusUpdation_model extends CI_Model $cerNamtToMsg = 'MARK CARD'; $getSemYearMsg = $this->get_couser_sem_yr_msg($arr[0]['CourseID']); $mesg = "Status Update : $cerNamtToMsg $getSemYearMsg - $statuToMsg $dateToMsg."; - - - + // $mesg = "Status Update : $cerNamtToMsg - $statuToMsg $dateToMsg."; $this->smssend($arr, $mesg); } @@ -335,8 +333,8 @@ class StatusUpdation_model extends CI_Model FROM ".COURSE_FEES." as CF LEFT JOIN ".STUDENTS_FEES_STATUS." as SFS ON SFS.FeesType = CF.ID WHERE SFS.CourseID = '$reqData' - AND SFS.StudentID = '$stuFor' - AND CF.ProgramType ='Y001'"; + AND SFS.StudentID = '$stuFor'"; + // AND CF.ProgramType ='Y001'"; $queryDetails = $this->db->query($subQuery); $results['semYearResult'] = true; diff --git a/Apollo/api/application/models/Student_model.php b/Apollo/api/application/models/Student_model.php index f254861b..f2caf1db 100755 --- a/Apollo/api/application/models/Student_model.php +++ b/Apollo/api/application/models/Student_model.php @@ -164,8 +164,10 @@ class Student_model extends CI_Model // print_r($getSearchData);exit(); $this->db->select('*'); $this->db->from(STUDENTS); - $this->db->order_by('CreatedOn', 'DESC'); $this->db->where('BranchCode', $loginUserBranchId); + $this->db->group_by('user_id'); + $this->db->order_by('CreatedOn', 'DESC'); + $stuDetails = $this->db->get(); $checkArr = $stuDetails->result(); if (count($checkArr) > 0) { @@ -190,8 +192,8 @@ class Student_model extends CI_Model // $Batch = $getSearchData['Batch']; $Batch=''; $StuStatus = $getSearchData['Status']; -if($StuStatus == '' ){ - $subQuery = "SELECT S.* + if($StuStatus == '' ){ + $subQuery = "SELECT S.* 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 @@ -201,8 +203,8 @@ if($StuStatus == '' ){ AND S.BranchCode = '$loginUserBranchId' GROUP BY SC.StudentID ORDER BY S.CreatedOn"; -} else { - $subQuery = "SELECT S.* + } else { + $subQuery = "SELECT S.* 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 @@ -233,10 +235,14 @@ if($StuStatus == '' ){ // list for admin if($getSearchData["University"] === '' && $getSearchData["Course"] === '' && $getSearchData["Status"] === '') { // print_r($getSearchData);exit(); - $this->db->select('*'); - $this->db->from(STUDENTS); - $this->db->order_by('CreatedOn', 'DESC'); - $this->db->where('BranchCode', $loginUserBranchId); + + $this->db->select('t1.*'); + $this->db->from('' . STUDENTS . ' as t1'); + $this->db->join('' . STUDENTCOURSE . ' as t2', 't2.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(); if (count($checkArr) > 0) { @@ -257,35 +263,40 @@ if($StuStatus == '' ){ // $this->db->where('t2.CourseID', $getSearchData["Course"]); $University = $getSearchData['University']; - $Course = $getSearchData['Course']; + $Course = $getSearchData['Course']; // $Batch = $getSearchData['Batch']; - $Batch=''; - $StuStatus = $getSearchData['Status']; + $Batch=''; + $StuStatus = $getSearchData['Status']; - if($StuStatus == '' ){ - $subQuery = "SELECT S.* + if($StuStatus == '' ){ + $subQuery = "SELECT S.* 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 WHERE SC.UniversityID LIKE '%$University%' AND SC.CourseID LIKE '%$Course%' - AND S.BranchCode = '$loginUserBranchId' + AND SC.BranchID = '$loginUserBranchId' GROUP BY SC.StudentID ORDER BY S.CreatedOn"; -} else { - $subQuery = "SELECT S.* + // ### query branch code changed from student branch code to student course branch code + //AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' + } else { + $subQuery = "SELECT S.* 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 WHERE SC.UniversityID LIKE '%$University%' AND SC.CourseID LIKE '%$Course%' - AND S.IsActive = '$StuStatus' - AND S.BranchCode = '$loginUserBranchId' + AND S.IsActive = '$StuStatus' + AND SC.BranchID = '$loginUserBranchId' GROUP BY SC.StudentID - ORDER BY S.CreatedOn"; -} + ORDER BY S.CreatedOn"; + // ### query branch code changed from student branch code to student course branch code + //AND S.BranchCode = '$loginUserBranchId' -> SC.BranchCode = '$loginUserBranchId' + } + $stuDetails = $this->db->query($subQuery); // $stuDetails = $this->db->get(); @@ -465,8 +476,9 @@ if($StuStatus == '' ){ // add student public function add_student($Arr, $courseArr, $imagename, $imageSource, $size) { - if($this->getBranchActiveStatusforStuAdd($courseArr['BranchID']) === '1'){ - + // echo $this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'];exit(); + if($this->getBranchActiveStatusforStuAdd($courseArr['BranchID'])['branch_active_status'] === '1'){ + // echo 'in';exit(); if( $imageSource == '') { // add employee without image $imageNameDb = 'default.jpeg'; $Arr['ProfilePicPath'] = "student/".$imageNameDb; diff --git a/Apollo/assets/js/controllers/loginCtrl.js b/Apollo/assets/js/controllers/loginCtrl.js index cdb0641b..6c251642 100755 --- a/Apollo/assets/js/controllers/loginCtrl.js +++ b/Apollo/assets/js/controllers/loginCtrl.js @@ -4,7 +4,7 @@ * Simple table with sorting and filtering on AngularJS */ -app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', "SweetAlert", function ($scope, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, SweetAlert) { +app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootScope', '$cookies', 'md5', 'ipCookie', "SweetAlert", "$window", function ($scope, $http, apiPoint, $state, $rootScope, $cookies, md5, ipCookie, SweetAlert, $window) { /** * login details capture * by : kdk @@ -50,7 +50,7 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc $http(req).then(function (response) { if (response.data.loginStatus == true) { $scope.responseData = response.data.details; - + /* * After logined user details store to local client detail */ @@ -67,10 +67,11 @@ app.controller('loginCtrl', ["$scope", "$http", "API_POINTS", "$state", '$rootSc localStorage.setItem('localObj', JSON.stringify($scope.localStore)); if($scope.responseData.ListCode=='R001'){ $state.go('app.studentView'); - } else{ + // $window.location.reload(); $state.go('app.dashboard'); + // $window.location.reload(); } } else { diff --git a/Apollo/assets/js/controllers/sessionCtrl.js b/Apollo/assets/js/controllers/sessionCtrl.js index e5f89193..ab345fe6 100755 --- a/Apollo/assets/js/controllers/sessionCtrl.js +++ b/Apollo/assets/js/controllers/sessionCtrl.js @@ -12,6 +12,8 @@ app.controller('sessionCtrl', ["$scope", "$localStorage", "$state", 'ipCookie', var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetails = ipCookie('cookiechk'); + // $window.location.reload(); + $scope.getLoginDash = ''; if (localDetail != null) { @@ -128,6 +130,7 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage", var localDetail = JSON.parse(localStorage.getItem('localObj')); var localDetails = ipCookie('cookiechk'); $scope.init = function () { + // $window.location.reload(); if (localDetail != null) { $scope.getProfile(); } else { @@ -145,7 +148,6 @@ app.controller('topnavCtrl', ["$scope", "$http", "API_POINTS", "$localStorage", 'branchList': '', }; - // client side logined details $scope.getProfile = function () { var req = { diff --git a/Apollo/assets/views/student/student_details_SuperAdmin.html b/Apollo/assets/views/student/student_details_SuperAdmin.html index a194ba92..aa19ef54 100644 --- a/Apollo/assets/views/student/student_details_SuperAdmin.html +++ b/Apollo/assets/views/student/student_details_SuperAdmin.html @@ -808,7 +808,7 @@