This commit is contained in:
resicovenba 2018-01-18 18:19:38 +05:30
commit cae1beaa2c
6 changed files with 88 additions and 13 deletions

View File

@ -56,7 +56,9 @@ class Call_Tracking_Controller extends REST_Controller {
{
$requestedBy = $this->post('requestedBy');
$mobileNumber = $this->post('mobileNumber');
$getLeadDetails = $this->Calltracking_model->getLeadDetails($requestedBy,$mobileNumber);
$branchID = $this->post('branchID');
$loginType = $this->post('userType');
$getLeadDetails = $this->Calltracking_model->getLeadDetails($requestedBy,$mobileNumber,$branchID,$loginType);
if ($getLeadDetails)
{
@ -139,7 +141,7 @@ class Call_Tracking_Controller extends REST_Controller {
{
$search['requestedBy'] = $this->post('requestedBy');
$search['requestedDept'] = $this->post('requestedDept');
$search['branchID'] = $this->post('branchId');
// $search['branchID'] = $this->post('branchId');
$search['searchDate'] = $this->post('searchDate');
$search['CreatedBranch'] = $this->post('branchId');
// $search['searchMobileNumber'] = $this->post('searchMobileNumber');
@ -176,6 +178,7 @@ class Call_Tracking_Controller extends REST_Controller {
$update_followup_details['TrackingID'] = $this->post('trackingID');
$update_followup_details['UpdatedBy'] = $this->post('updatedBy');
$update_followup_details['StatusCode'] = $this->post('status');
$update_followup_details['AssignedTo'] = $this->post('assignedTo');
$update_followup_details['UpdatedOn'] = $now->format('Y-m-d H:i:s');
// store followup details for insert
@ -217,6 +220,8 @@ class Call_Tracking_Controller extends REST_Controller {
$get_details['TrackingID'] = $this->post('trackingID');
$get_details['UpdatedBy'] = $this->post('updatedBy');
$get_details['CreatedBranch'] = $this->post('branchId');
$get_details['requestedDept'] = $this->post('requestedDept');
$getLoadDetails = $this->Calltracking_model->getLoadFollowupDetails($get_details);
if ($getLoadDetails)
@ -245,6 +250,8 @@ class Call_Tracking_Controller extends REST_Controller {
{
$search['requestedBy'] = $this->post('requestedBy');
$search['BranchID'] = $this->post('branchId');
$search['requestedDept'] = $this->post('requestedDept');
$getdashBoardCallDetails = $this->Calltracking_model->getDashboardTrackingDetails($search);
if ($getdashBoardCallDetails)
{

View File

@ -13,7 +13,7 @@ class Calltracking_model extends CI_Model {
* @params mobile number,requestedby
* created by kms
* */
public function getLeadDetails($requestedBy=null,$mobileNumber=null)
public function getLeadDetails($requestedBy=null,$mobileNumber=null,$branchID=null,$userType=null)
{
$this->db->select('LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address');
$this->db->from(LEAD_DETAILS.' as LD');
@ -63,7 +63,7 @@ class Calltracking_model extends CI_Model {
//$result_array['universityDetails']=$this->getUniversityDetails();
$result_array['activityDetails']=$this->getActivityDetails();
// $result_array['statusDetails']=$this->getStatus();
$result_array['staffDetails']=$this->getStaff("1");
$result_array['staffDetails']=$this->getStaff("1",$branchID,$userType,$requestedBy);
return $result_array;
}
@ -175,12 +175,19 @@ class Calltracking_model extends CI_Model {
*
* */
public function getStaff($status=null)
public function getStaff($status=null,$branchID=null,$userType=null,$requestedBy)
{
$this->db->select('LO.ID,ST.StaffID,ST.Firstname');
$this->db->from(LOGIN.' as LO');
$this->db->join(STAFF.' as ST', 'ST.StaffID = LO.StaffID');
$this->db->where('ST.IsActive',$status);
if($userType== ADMIN){
$this->db->where('ST.BranchCode',$branchID);
$this->db->where('LO.ListCode !=',SUPER_ADMIN);
}
if($userType== EMPLOYEE){
$this->db->where('LO.ID',$requestedBy);
}
$staffDetails=$this->db->get();
if($staffDetails){
$result_staff = array();
@ -264,6 +271,11 @@ class Calltracking_model extends CI_Model {
$this->db->where('LT.CreatedBranch', $search['CreatedBranch']);
}
if ($search['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $search['requestedBy']);
}
if($search['searchDate']!='' OR $search['searchDate']!=null){
/* if(sizeof($search['searchDate']) == '1'){
$this->db->where('LTF.FollowupOn <= ', $search['searchDate'][0]);
@ -348,6 +360,11 @@ class Calltracking_model extends CI_Model {
if($search['CreatedBranch'] !='All'){
$this->db->where('LT.CreatedBranch', $search['CreatedBranch']);
}
if ($search['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $search['requestedBy']);
}
if(($search['searchDate']!='' OR $search['searchDate']!=null) AND sizeof($search['searchDate']) == '1'){
@ -492,6 +509,11 @@ class Calltracking_model extends CI_Model {
if($trackingID['CreatedBranch'] !='All'){
$this->db->where('LT.CreatedBranch', $trackingID['CreatedBranch']);
}
if ($trackingID['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $trackingID['UpdatedBy']);
}
$leadDet=$this->db->get();
@ -520,7 +542,7 @@ class Calltracking_model extends CI_Model {
$tracking_array["AlternateMobile"]=$row->AlternateMobile;
$tracking_array["Address"]=$row->Address;
$tracking_array["followupDetails"]=$this->getTrackingFollowup($row->TrackingID);
$tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber,$trackingID['CreatedBranch']);
$tracking_array["collectTrackedID"]=$this->getStudentTrackedID($row->MobileNumber,$trackingID['CreatedBranch'],$trackingID['requestedDept'],$trackingID['UpdatedBy']);
$result[]=$tracking_array;
@ -528,6 +550,9 @@ class Calltracking_model extends CI_Model {
}
$result_array['trackingDetails']=$result;
$result_array['statusDetails']=$this->getStatus($activityID);
$result_array['staffDetails']=$this->getStaff("1",$trackingID['CreatedBranch'],$trackingID['requestedDept'],$trackingID['UpdatedBy']);
$result_array['trackingDetails']=$result;
}
@ -546,7 +571,7 @@ class Calltracking_model extends CI_Model {
* @params mobile number
* created by kms
* */
public function getStudentTrackedID($stuMobile=null,$branchId=null)
public function getStudentTrackedID($stuMobile=null,$branchId=null,$reqDept=null,$updatedBy=null)
{
$this->db->distinct();
$this->db->select('LT.TrackingID,LT.LeadID,AV.ActivityID,AV.ActivityName,PLD.ListName');
@ -555,9 +580,15 @@ class Calltracking_model extends CI_Model {
$this->db->join(ACTIVITY.' as AV', 'AV.ActivityID = LT.ActivityStatus');
$this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.StatusCode');
$this->db->where('LD.MobileNumber',$stuMobile);
if($branchId !='All'){
$this->db->where('LT.CreatedBranch', $branchId);
}
if ($reqDept == EMPLOYEE){
$this->db->where('LT.AssignedTo', $updatedBy);
}
$this->db->order_by('LT.TrackingID','ASC');
@ -634,6 +665,11 @@ class Calltracking_model extends CI_Model {
if($search['BranchID'] !='All'){
$this->db->where('LT.CreatedBranch', $search['BranchID']);
}
if ($search['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $search['requestedBy']);
}
$this->db->where('LTF.FollowupOn',$todayDate);
$trackDetails=$this->db->get();
@ -680,6 +716,11 @@ class Calltracking_model extends CI_Model {
if($search['BranchID'] !='All'){
$this->db->where('LT.CreatedBranch', $search['BranchID']);
}
if ($search['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $search['requestedBy']);
}
$this->db->like('LD.CreatedOn', $todayDate, 'after');
$trackDetails=$this->db->get();
@ -727,6 +768,11 @@ class Calltracking_model extends CI_Model {
if($search['BranchID'] !='All'){
$this->db->where('LT.CreatedBranch', $search['BranchID']);
}
if ($search['requestedDept'] == EMPLOYEE){
$this->db->where('LT.AssignedTo', $search['requestedBy']);
}
$trackDetails=$this->db->get();

View File

@ -267,7 +267,9 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
mobileNumber:mobile
mobileNumber:mobile,
branchID:JSON.parse(localStorage.getItem('localObj')).localBranchID,
userType:JSON.parse(localStorage.getItem('localObj')).localType,
}
};
$http(lead).then(function (response) {
@ -1190,6 +1192,7 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
trackingID: followupDetails.TrackingID,
date: $scope.nextFollowupDate,
status: myModel1.status,
assignedTo: myModel1.assignStaff,
comments: myModel1.comments,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
@ -1219,7 +1222,9 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
data: {
trackingID: trackID,
updatedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
}
};
@ -1234,8 +1239,11 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
$rootScope.modifyDate1 = moment();
$rootScope.modifyDate1.add(30, 'days');
$rootScope.futureDate1 = $filter('date')($scope.modifyDate1, 'dd-MM-yyyy');
$rootScope.myModel1.status=$rootScope.followupDetails.StatusCode;
// $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode;
$rootScope.trackingStatus=response.data.statusDetails;
$rootScope.myModel1.assignStaff=$rootScope.followupDetails.AssignedTo;
$rootScope.staffDetails=response.data.staffDetails;
} else {
swal("Failed!", response.data.message, "error");
}

View File

@ -21,7 +21,8 @@ app.controller('dashboardCtrl', ["$scope","$rootScope", "toaster", "$filter", "n
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType
}
};

View File

@ -151,13 +151,26 @@
</td>
</tr>
<tr>
<td>Assigned To</td>
<td>
<select class="form-control" name="status" id="Box4" tabindex="1"
ng-model="myModel1.assignStaff"
ng-options="checkStaf.loginId as checkStaf.staffName for checkStaf in staffDetails"
required>
<!-- <option value="">Select Status</option>-->
</select>
</td>
</tr>
<tr>
<td>Status</td>
<!--
<td><span class="label label-sm label-info">{{followupDetails.statusListName}}</span></td>
-->
<td>
<select class="form-control" name="status" id="Box3" tabindex="1"
<select class="form-control" name="status" id="Box3" tabindex="2"
ng-model="myModel1.status"
ng-options="checkStatus.ListCode as checkStatus.ListName for checkStatus in trackingStatus"
required>

View File

@ -123,7 +123,7 @@
<div class="panel-scroll height-180" perfect-scrollbar wheel-propagation="false" suppress-scroll-x="true" ng-if="emptyDataLead==false">
<table class="table table-hover">
<thead>
<tr><td colspan="5" style="background:#DD5A82;color:#fff !important">Total Entries :{{leadDetails.length}}</td></tr>
<tr><td colspan="6" style="background:#DD5A82;color:#fff !important">Total Entries :{{leadDetails.length}}</td></tr>
<tr>
<th>Tracking ID</th>
<th>Lead Name</th>