diff --git a/Apollo/api/application/controllers/StudentView_Controller.php b/Apollo/api/application/controllers/StudentView_Controller.php index 0f995206..7eeb63bc 100755 --- a/Apollo/api/application/controllers/StudentView_Controller.php +++ b/Apollo/api/application/controllers/StudentView_Controller.php @@ -45,8 +45,10 @@ class StudentView_Controller extends REST_Controller { $requestedBy = $this->post('requestedBy'); $requestedFrom = $this->post('requestedFrom'); + $requestedBranch = $this->post('branchCode'); - $studentListDetails = $this->studentview_model->getStudentInfo($requestedBy,$requestedFrom);// Check if the employee exist + + $studentListDetails = $this->studentview_model->getStudentInfo($requestedBy,$requestedFrom,$requestedBranch);// Check if the employee exist if ($studentListDetails) { $studentListDetails['status'] = REST_Controller::HTTP_OK; // Set the response and exit diff --git a/Apollo/api/application/models/Batch_model.php b/Apollo/api/application/models/Batch_model.php index 62d49ffa..9d4121d3 100755 --- a/Apollo/api/application/models/Batch_model.php +++ b/Apollo/api/application/models/Batch_model.php @@ -117,7 +117,6 @@ class Batch_model extends CI_Model { * */ public function updateDefaultBatch($details=null){ - $setDefaultBatch['IsDefault']=false; $setDefaultBatch['UpdatedBy'] = $details['UpdatedBy']; $setDefaultBatch['UpdatedOn'] = $details['UpdatedOn']; @@ -128,6 +127,7 @@ class Batch_model extends CI_Model { if($upateStatus){ $this->db->where('BatchCode',$details['BatchCode']); $this->db->where('UniversityID',$details['UniversityID']); + $this->db->where('BranchCode',$details['BranchCode']); $upateAfterStatus=$this->db->update(BATCH, $details); $result['batchStatus'] = true; $result['message'] = "Successfully Batch details updated"; diff --git a/Apollo/api/application/models/Calltracking_model.php b/Apollo/api/application/models/Calltracking_model.php index 93cb0630..a70a0596 100755 --- a/Apollo/api/application/models/Calltracking_model.php +++ b/Apollo/api/application/models/Calltracking_model.php @@ -19,6 +19,7 @@ class Calltracking_model extends CI_Model { $this->db->from(LEAD_DETAILS.' as LD'); $this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID'); $this->db->where('LD.MobileNumber',$mobileNumber); + $this->db->where('LT.CreatedBranch',$branchID); $leadDet=$this->db->get()->last_row(); $result_array = []; if($leadDet){ @@ -31,6 +32,8 @@ class Calltracking_model extends CI_Model { $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); $this->db->where('ST.MobileNumber',$mobileNumber); + $this->db->where('STC.BranchID',$branchID); + $this->db->where('US.BranchCode',$branchID); $enrolledStudDet=$this->db->get()->last_row(); if($enrolledStudDet) { $leadDet['LeadName'] = $enrolledStudDet->Firstname; @@ -60,8 +63,8 @@ class Calltracking_model extends CI_Model { } } // store lead,university and course details in comman array - //$result_array['universityDetails']=$this->getUniversityDetails(); - $result_array['activityDetails']=$this->getActivityDetails($mobileNumber); + //$result_array['universityDetails']=$this->getUniversityDetails($branchID); + $result_array['activityDetails']=$this->getActivityDetails($mobileNumber,$branchID); // $result_array['statusDetails']=$this->getStatus(); $result_array['staffDetails']=$this->getStaff("1",$branchID,$userType,$requestedBy); return $result_array; @@ -72,10 +75,11 @@ class Calltracking_model extends CI_Model { * get university details * created by kms * */ - public function getUniversityDetails() + public function getUniversityDetails($branchID) { $this->db->select('UniversityID,UniversityName'); $this->db->where('IsActive','1'); + $this->db->where('BranchCode',$branchID); $this->db->order_by('UniversityID','ASC'); $unviversityDetails = $this->db->get(UNIVERSITY); @@ -86,7 +90,7 @@ class Calltracking_model extends CI_Model { $university_array['universityStatus'] = true; $university_array['universityID'] = $row->UniversityID; $university_array['universityName'] = $row->UniversityName; - $university_array['courseDetails']= $this->getCourseDetails($row->UniversityID); + $university_array['courseDetails']= $this->getCourseDetails($row->UniversityID,$branchID); $result_university[]=$university_array; } } @@ -108,11 +112,12 @@ class Calltracking_model extends CI_Model { * @params university id * created by kms * */ - public function getCourseDetails($universityID=null) + public function getCourseDetails($universityID=null,$branchID=null) { $this->db->select('CourseID,CourseName'); $this->db->where('UniversityID',$universityID); $this->db->where('IsActive','1'); + $this->db->where('BranchCode',$branchID); $this->db->order_by('CourseID','ASC'); $courseDetails = $this->db->get(COURSE); return $courseDetails->result(); @@ -123,7 +128,7 @@ class Calltracking_model extends CI_Model { * created by kms * */ - public function getActivityDetails($mobileNo=null) + public function getActivityDetails($mobileNo=null,$branchID=null) { $this->db->distinct(); $this->db->select('LT.ActivityStatus,LT.ActivityStatus'); @@ -132,6 +137,9 @@ class Calltracking_model extends CI_Model { $this->db->join(PICK_LIST_DETAILS.' as PLD', 'LT.StatusCode = PLD.ListCode'); $this->db->where('PLD.ListName !=','CLOSE'); $this->db->where('LD.MobileNumber',$mobileNo); + $this->db->where('LT.CreatedBranch',$branchID); + $this->db->where('PLD.BranchCode',$branchID); + $getExistActivity=$this->db->get(); $existArrayActivity=array(); if($getExistActivity->result()){ @@ -148,6 +156,7 @@ class Calltracking_model extends CI_Model { $this->db->select('ActivityID,ActivityName'); $this->db->where('IsActive','1'); + $this->db->where('BranchCode',$branchID); if($existArrayActivity){ $this->db->where_not_in('ActivityID',$existArrayActivity); } @@ -202,7 +211,7 @@ class Calltracking_model extends CI_Model { public function getStaff($status=null,$branchID=null,$userType=null,$requestedBy) { - if($userType != SUPER_ADMIN){ + // if($userType != SUPER_ADMIN OR $userType== SUPER_ADMIN){ $this->db->select('LO.ID,ST.StaffID,ST.Firstname'); $this->db->from(LOGIN.' as LO'); @@ -219,6 +228,9 @@ class Calltracking_model extends CI_Model { $this->db->where('STB.BranchCode',$branchID); $this->db->where('LO.ID',$requestedBy); } + if($userType== SUPER_ADMIN){ + $this->db->where('STB.BranchCode',$branchID); + } $staffDetails=$this->db->get(); if($staffDetails){ $result_staff = array(); @@ -233,7 +245,7 @@ class Calltracking_model extends CI_Model { else{ $result_staff[]=""; } - } + /* } else{ $this->db->select('BR.BranchCode,BR.BranchName'); $this->db->from(BRANCH.' as BR'); @@ -254,7 +266,7 @@ class Calltracking_model extends CI_Model { } - } + }*/ return $result_staff; } diff --git a/Apollo/api/application/models/Fees_status_model.php b/Apollo/api/application/models/Fees_status_model.php index 8e514810..c9671e7c 100755 --- a/Apollo/api/application/models/Fees_status_model.php +++ b/Apollo/api/application/models/Fees_status_model.php @@ -262,6 +262,7 @@ class Fees_status_model extends CI_Model $this->db->where('SFP.StudentID', $student['StudentID']); $this->db->where('SFP.IsActive','1'); $this->db->where('US.BranchCode',$student['BranchCode']); + $this->db->where('BA.BranchCode',$student['BranchCode']); $this->db->order_by('SFP.ID', 'DESC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ @@ -1587,18 +1588,18 @@ class Fees_status_model extends CI_Model * */ public function studentInfoForFeesStatus($studentID=null,$courseID=null){ // this sub query for avoid university duplicate id - $this->db->select('BranchID')->from(STUDENTCOURSE); + /* $this->db->select('BranchID')->from(STUDENTCOURSE); $this->db->where('StudentID',$studentID); - $subQuery = $this->db->get_compiled_select(); + $subQuery = $this->db->get_compiled_select();*/ // subquery end $this->db->select('ST.Firstname,ST.MobileNumber,US.UniversityName,CU.CourseName,STC.BranchID'); $this->db->from(STUDENTCOURSE.' as STC'); $this->db->join(STUDENTS.' as ST', 'ST.StudentID = STC.StudentID'); $this->db->join(COURSE.' as CU', 'CU.CourseID = STC.CourseID'); - $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID'); + $this->db->join(UNIVERSITY.' as US', 'US.UniversityID = STC.UniversityID AND STC.BranchID=US.BranchCode'); $this->db->where('ST.StudentID',$studentID); $this->db->where('STC.CourseID',$courseID); - $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); + // $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); $leadDet=$this->db->get()->last_row(); if($leadDet){ return $leadDet; diff --git a/Apollo/api/application/models/Studentview_model.php b/Apollo/api/application/models/Studentview_model.php index 9b9def61..bae4d182 100755 --- a/Apollo/api/application/models/Studentview_model.php +++ b/Apollo/api/application/models/Studentview_model.php @@ -16,7 +16,7 @@ class Studentview_model extends CI_Model * */ // get student list based on login user - public function getStudentInfo($requestedBy=null,$requestFrom=null) + public function getStudentInfo($requestedBy=null,$requestFrom=null,$requestedBranch=null) { if($requestFrom =='2'){ $this->db->select('ST.*'); @@ -28,7 +28,7 @@ class Studentview_model extends CI_Model $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch); } else{ $result['studentStatus'] = false; @@ -39,13 +39,15 @@ class Studentview_model extends CI_Model $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); + $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = ST.StudentID'); $this->db->where('ST.StudentID', $requestedBy); + $this->db->where('STC.BranchID', $requestedBranch); $studentDetails = $this->db->get()->first_row(); if($studentDetails){ $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch); } else{ $result['studentStatus'] = false; @@ -56,13 +58,15 @@ class Studentview_model extends CI_Model $this->db->select('ST.*'); $this->db->from( LOGIN . ' as LO'); $this->db->join( STUDENTS . ' as ST', 'LO.StaffID = ST.StudentID'); + $this->db->join( STUDENTCOURSE . ' as STC', 'STC.StudentID = ST.StudentID'); $this->db->where('ST.MobileNumber', $requestedBy); + $this->db->where('STC.BranchID', $requestedBranch); $studentDetails = $this->db->get()->first_row(); if($studentDetails){ $result['studentStatus'] = true; $result['studentDetails'] = $studentDetails; // get student course details - $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom); + $result['courseDetails'] = $this->getStudentCourse($studentDetails->StudentID,$requestFrom,$requestedBranch); } else{ $result['studentStatus'] = false; @@ -77,14 +81,22 @@ class Studentview_model extends CI_Model * get student course details * created by kms * */ - public function getStudentCourse($studentId=null,$requestFrom=null){ - + public function getStudentCourse($studentId=null,$requestFrom=null,$requestedBranch=null){ + // this sub query for avoid university duplicate id + /* $this->db->select('BranchID')->from(STUDENTCOURSE); + $this->db->where('StudentID',$studentId); + $subQuery = $this->db->get_compiled_select();*/ + // subquery end $this->db->select('SCU.EnrollmentID,CU.CourseID,CU.CourseName,US.UniversityID,US.UniversityName,US.UniversityShortName'); $this->db->from( STUDENTCOURSE . ' as SCU'); $this->db->join( COURSE . ' as CU', 'CU.CourseID = SCU.CourseID'); - $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID'); + $this->db->join( UNIVERSITY . ' as US', 'US.UniversityID = SCU.UniversityID AND SCU.BranchID=US.BranchCode'); // $this->db->join( SESSIONMASTER . ' as SM', 'SM.SessionID = SCU.SessionID'); - $this->db->where('SCU.StudentID', $studentId); + $this->db->where('SCU.StudentID',$studentId); + if($requestFrom!='2'){ + $this->db->where('CU.BranchCode',$requestedBranch); + } + // $this->db->where('US.BranchCode IN('. $subQuery.')', NULL, FALSE); $courseDetails = $this->db->get(); if($courseDetails->result()){ $studentCourseStatus['status'] = true; @@ -139,10 +151,10 @@ class Studentview_model extends CI_Model $this->db->join(SESSIONMASTER.' as SM1', 'SM1.SessionID = SFS.ToSessionName','left'); $this->db->join(STUDENTS_FEES_PAID.' as SFP','SFP.FeesId = SFS.FeesID','left'); $this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); - $this->db->join(BATCH.' as BA', 'BA.BatchCode = SFS.BatchCode'); + $this->db->join(BATCH.' as BA', 'BA.BatchCode = SFS.BatchCode AND SFS.BranchCode=BA.BranchCode'); $this->db->where('SFS.CourseID', $courseID); $this->db->where('SFS.StudentID', $studentID); - $this->db->where('SFP.IsActive', '1'); + // $this->db->where('SFP.IsActive', '1'); $this->db->order_by('SFS.FeesID', 'ASC'); $getFeeDetails = $this->db->get(); if($getFeeDetails->result()){ @@ -255,7 +267,7 @@ class Studentview_model extends CI_Model //$this->db->join(COURSE_FEES.' as CF', 'CF.ID = SFS.FeesType'); $this->db->where('SFS.CourseID', $courseID); $this->db->where('SFS.StudentID', $studentID); - $this->db->where('SFP.IsActive', '1'); + // $this->db->where('SFP.IsActive', '1'); $this->db->where_in('SFS.FeesType', $serachArray); $this->db->order_by('SFS.FeesID', 'ASC'); $getFeeDetails = $this->db->get(); diff --git a/Apollo/assets/js/controllers/callTrackingCtrl.js b/Apollo/assets/js/controllers/callTrackingCtrl.js index 5e9194c4..5d2f8b05 100755 --- a/Apollo/assets/js/controllers/callTrackingCtrl.js +++ b/Apollo/assets/js/controllers/callTrackingCtrl.js @@ -263,6 +263,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.ldloading1 = {}; $scope.ldloading1[loading.replace('-', '_')] = true; + /* hide this fun after branch level changes if($scope.userType !='R004'){ $scope.updateBranchID = JSON.parse(localStorage.getItem('localObj')).localBranchID; $scope.updateAssignTo = myModel.assignedTo; @@ -272,7 +273,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", $scope.updateBranchID = myModel.branch.BranchCode; $scope.updateAssignTo = myModel.assignedTo; - } + }*/ var addLead = { method: 'POST', @@ -287,8 +288,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", courseName: myModel.courseName, date: $scope.nextFollowupDate, activity: myModel.activity.activityID, - assignedTo: $scope.updateAssignTo, - + assignedTo: myModel.assignedTo, status: myModel.status, referedBy: myModel.referedBy, comments:myModel.comments, @@ -296,10 +296,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", address:myModel.address, enquiryStatus:myModel.enquiryStatus, createdBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - branchId: $scope.updateBranchID - - - + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID } }; @@ -1469,7 +1466,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", - if($scope.userType !='R004'){ + /* if($scope.userType !='R004'){ $scope.updateBranchID = JSON.parse(localStorage.getItem('localObj')).localBranchID; @@ -1478,7 +1475,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $scope.updateBranchID = myModel1.branch; - } + }*/ $rootScope.ldloading2 = {}; $rootScope.ldloading2[loading.replace('-', '_')] = true; @@ -1497,7 +1494,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", assignedTo: myModel1.assignStaff, comments: myModel1.comments, updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID, - branchId: $scope.updateBranchID, + branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID, address: myModel1.Address, alternateMobile: myModel1.AlternateMobile, referredBy: myModel1.ReferredBy, @@ -1560,7 +1557,10 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", $rootScope.myModel1.ReferredBy=$rootScope.followupDetails.ReferredBy; $rootScope.staffArray=''; $rootScope.staffDetails=response.data.staffDetails; - if($scope.userType =='R004'){ + + /* hide this fun after branch level changes + + if($scope.userType =='R004'){ // get deactive branch list $scope.checkBranchData = { BranchCode: $rootScope.followupDetails.CreatedBranch, @@ -1622,7 +1622,28 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter", } - } + }*/ + + // ref1 start after branch level changes + // get deactive staff details list + $scope.checkEmpData = { + loginId: $rootScope.followupDetails.AssignedTo, + staffName: $rootScope.followupDetails.Firstname +'-'+$rootScope.followupDetails.StaffID + }; + + if($rootScope.staffDetails){ + var empresult = $filter('filter')($rootScope.staffDetails, $scope.checkEmpData); + if(empresult.length==0){ + + $rootScope.staffDetails.push($scope.checkEmpData); + } + } + else{ + $rootScope.staffDetails=[]; + $rootScope.staffDetails.push($scope.checkEmpData); + } + + // ref1end after branch level changes @@ -1732,7 +1753,8 @@ app.controller('studentModalDemoCtrl', ["$scope", "$rootScope", "$modal", "$log" }, data: { requestedBy :studentDetails.MobileNumber, - requestedFrom: 3 + requestedFrom: 3, + branchCode:JSON.parse(localStorage.getItem('localObj')).localBranchID } }; $http(getcourse).then(function (response) { diff --git a/Apollo/assets/js/controllers/dashboardCtrl.js b/Apollo/assets/js/controllers/dashboardCtrl.js index 15f9e78d..2c0a5dc9 100755 --- a/Apollo/assets/js/controllers/dashboardCtrl.js +++ b/Apollo/assets/js/controllers/dashboardCtrl.js @@ -257,7 +257,8 @@ app.controller('studentModalDemoCtrl', ["$scope", "$rootScope", "$modal", "$log" }, data: { requestedBy :studentDetails.MobileNumber, - requestedFrom: 3 + requestedFrom: 3, + branchCode: JSON.parse(localStorage.getItem('localObj')).localBranchID, } }; $http(getcourse).then(function (response) { diff --git a/Apollo/assets/js/controllers/feesStatusCtrl.js b/Apollo/assets/js/controllers/feesStatusCtrl.js index bf6c46b1..b96beab5 100755 --- a/Apollo/assets/js/controllers/feesStatusCtrl.js +++ b/Apollo/assets/js/controllers/feesStatusCtrl.js @@ -2674,7 +2674,9 @@ app.controller('studentModalDemoCtrl', ["$scope", "$rootScope", "$modal", "$log" }, data: { requestedBy :studentDetails.MobileNumber, - requestedFrom: 3 + requestedFrom: 3, + branchCode : JSON.parse(localStorage.getItem('localObj')).localBranchID + } }; $http(getcourse).then(function (response) { diff --git a/Apollo/assets/views/callTrackingDetails.html b/Apollo/assets/views/callTrackingDetails.html index 7265d3ca..89917d86 100755 --- a/Apollo/assets/views/callTrackingDetails.html +++ b/Apollo/assets/views/callTrackingDetails.html @@ -428,7 +428,8 @@ -
+
-
+ <!–Thank You–> +
--> @@ -499,7 +500,7 @@ --> -
+ <!–Thank You–> + -->
diff --git a/Apollo/assets/views/callTrackingFollowup.html b/Apollo/assets/views/callTrackingFollowup.html index 1176f047..6394c1e2 100755 --- a/Apollo/assets/views/callTrackingFollowup.html +++ b/Apollo/assets/views/callTrackingFollowup.html @@ -180,7 +180,8 @@ - + + Assigned To - + --> - + + <!– –> - + --> Status