This commit is contained in:
dineshkumarkannan 2018-04-25 09:12:11 +05:30
commit b736e17bcb
10 changed files with 111 additions and 57 deletions

View File

@ -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

View File

@ -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";

View File

@ -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;
}

View File

@ -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;

View File

@ -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();

View File

@ -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) {

View File

@ -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) {

View File

@ -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) {

View File

@ -428,7 +428,8 @@
</spinner>
</div>
<div class="col-md-3 form-group" ng-if="loading==false && userType !='R004'"
<!--&& userType !='R004'-->
<div class="col-md-3 form-group" ng-if="loading==false"
ng-class="{'has-error':Form.assigned.$dirty && Form.assigned.$invalid, 'has-success':Form.assigned.$valid}">
<label >
Assigned To <span
@ -461,7 +462,7 @@
</spinner>
</div>
<div class="col-md-3 form-group" ng-if="loading==false && userType =='R004'"
<!--<div class="col-md-3 form-group" ng-if="loading==false && userType =='R004'"
ng-class="{'has-error':Form.branch.$dirty && Form.branch.$invalid, 'has-success':Form.branch.$valid}">
<label >
Select Branch <span
@ -478,9 +479,9 @@
</select>
<span class="error text-small block"
ng-if="Form.branch.$dirty && Form.branch.$error.required && myModel.branch.length==0">Branch is required</span>
<!--<span class="success text-small block"-->
<!--ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>-->
</div>
&lt;!&ndash;<span class="success text-small block"&ndash;&gt;
&lt;!&ndash;ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>&ndash;&gt;
</div>-->
</div>
@ -499,7 +500,7 @@
</div>-->
<div class="col-md-3 form-group" ng-if="userType =='R004'"
<!--<div class="col-md-3 form-group" ng-if="userType =='R004'"
ng-class="{'has-error':Form.assigned.$dirty && Form.assigned.$invalid, 'has-success':Form.assigned.$valid}">
<label >
Assigned To <span
@ -516,9 +517,9 @@
</select>
<span class="error text-small block"
ng-if="Form.assigned.$dirty && Form.assigned.$error.required && myModel.assignedTo.length==0">Assigned to is required</span>
<!--<span class="success text-small block"-->
<!--ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>-->
</div>
&lt;!&ndash;<span class="success text-small block"&ndash;&gt;
&lt;!&ndash;ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>&ndash;&gt;
</div>-->
<div class="col-md-3 form-group"
ng-class="{'has-error':Form.altermobilenumber.$dirty && Form.altermobilenumber.$invalid, 'has-success':Form.altermobilenumber.$valid}">

View File

@ -180,7 +180,8 @@
</td>
</tr>
<tr ng-if="userType != 'R004'">
<!--ng-if="userType != 'R004'"-->
<tr>
<td>Assigned To</td>
<td>
<select class="form-control" name="status" id="Box4" tabindex="8"
@ -193,7 +194,7 @@
</select>
</td>
</tr>
<tr ng-if="userType == 'R004'">
<!-- <tr ng-if="userType == 'R004'">
<td>Select Branch</td>
<td>
<select class="form-control" name="status" id="Box43" tabindex="9"
@ -201,13 +202,13 @@
ng-options="checkBranch.BranchCode as checkBranch.BranchName for checkBranch in staffDetails" ng-change="changeBranch(myModel1.branch);"
required>
<!-- <option value="">Select Status</option>-->
&lt;!&ndash; <option value="">Select Status</option>&ndash;&gt;
</select>
</td>
</tr>
</tr>-->
<tr ng-if="userType == 'R004'">
<!--<tr ng-if="userType == 'R004'">
<td>Assigned To</td>
<td>
<select class="form-control" name="status" id="Box44" tabindex="10"
@ -215,11 +216,11 @@
ng-options="checkStaf.loginId as checkStaf.staffName for checkStaf in staffArray"
required>
<!-- <option value="">Select</option>-->
&lt;!&ndash; <option value="">Select</option>&ndash;&gt;
</select>
</td>
</tr>
</tr>-->
<tr>
<td>Status</td>
<!--