updateDetails : ps
This commit is contained in:
parent
8eaaf839ab
commit
f29fce0010
@ -93,7 +93,8 @@ $route['getRecentLeadDetails'] = 'Call_Tracking_Controller/getRecentLeadDetails'
|
||||
$route['getRecentCloseDetails'] = 'Call_Tracking_Controller/getRecentCloseDetails';
|
||||
$route['getRecentPendingDetails'] = 'Call_Tracking_Controller/getRecentPendingDetails';
|
||||
$route['callAsImportantFlag'] = 'Call_Tracking_Controller/callAsImportantFlag';
|
||||
$route['updateTrackingLeadDetails'] = 'Call_Tracking_Controller/updateTrackingLeadDetails';
|
||||
$route['getTrackingLeadDetails2'] = 'Call_Tracking_Controller/getTrackingLeadDetails2';
|
||||
$route['updateFollowupDetails2'] = 'Call_Tracking_Controller/updateFollowupDetails2';
|
||||
// auto call track
|
||||
$route['autoAddlead'] = 'Call_Tracking_Controller/autoAddlead';
|
||||
$route['autoTrackingDetails'] = 'Call_Tracking_Controller/autoTrackingDetails';
|
||||
|
||||
@ -587,10 +587,48 @@ public function getstaffCountDetails_post()
|
||||
/*
|
||||
* End of call tracking
|
||||
*/
|
||||
public function updateTrackingLeadDetails_post(){
|
||||
$details = $this->post();
|
||||
print_r($details);
|
||||
die();
|
||||
}
|
||||
public function updateFollowupDetails2_post()
|
||||
{
|
||||
$now = new DateTime();
|
||||
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
|
||||
$student = $this->post('student');
|
||||
|
||||
foreach($student as $index =>$student){
|
||||
|
||||
if($this->post('status') == '' || $this->post('status') == NULL){
|
||||
$status = $student['StatusCode'];
|
||||
}else{
|
||||
$status = $this->post('status');
|
||||
}
|
||||
$update_followup_details['TrackingID'] = $student['TrackingID'];
|
||||
$update_followup_details['UpdatedBy'] = $this->post('createdBy');
|
||||
$update_followup_details['StatusCode'] = $status;
|
||||
$update_followup_details['AssignedTo'] = $this->post('assignedTo');
|
||||
$update_followup_details['UpdatedOn'] = $now->format('Y-m-d H:i:s');
|
||||
$update_followup_details['CreatedBranch'] = $this->post('branchId');
|
||||
|
||||
// followup details for insert
|
||||
$followup_details['TrackingID'] = $student['TrackingID'];
|
||||
$followup_details['FollowupOn'] = $this->post('date');
|
||||
$followup_details['CreatedBy'] = $this->post('createdBy');
|
||||
$followup_details['FollowupComments'] = $this->post('comments');
|
||||
$followup_details['CreatedOn'] = $now->format('Y-m-d H:i:s');
|
||||
$followup_details['StatusName'] = $status;
|
||||
$followup_details['AssignedStaff'] = $this->post('assignedTo');
|
||||
$leadDetails['leadDetails'] = $this->Calltracking_model->updateFollowupDetails2($update_followup_details,$followup_details);
|
||||
}
|
||||
|
||||
if (sizeof($leadDetails)>0)
|
||||
{
|
||||
$leadDetails['status'] = REST_Controller::HTTP_OK;
|
||||
// Set the response and exit
|
||||
$this->response($leadDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
|
||||
}
|
||||
else {
|
||||
// Set the response and exit
|
||||
$this->response(['message' => 'Something went wrong.please try again!','status' => REST_Controller::HTTP_NOT_FOUND], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@ -1014,6 +1014,35 @@ $msg='Dear '.$name.', Thank you for enquiring with Apollo Distance Education Col
|
||||
|
||||
}
|
||||
|
||||
public function updateFollowupDetails2($updateDetails=null,$insertDetails=null)
|
||||
{
|
||||
|
||||
$deactivateStatus['IsActive']=false;
|
||||
$this->db->where('TrackingID',$updateDetails['TrackingID']);
|
||||
$this->db->update(LEAD_TRACKING_FOLLOWUP, $deactivateStatus);
|
||||
if($this->db->affected_rows() > '0') {
|
||||
$this->db->insert(LEAD_TRACKING_FOLLOWUP, $insertDetails);
|
||||
// this if for insert follow up details
|
||||
if ($this->db->affected_rows() == '1') {
|
||||
$this->db->where('TrackingID', $updateDetails['TrackingID']);
|
||||
$upateStatus = $this->db->update(LEAD_TRACKING, $updateDetails);
|
||||
$result['leadStatus'] = true;
|
||||
$result['message'] = "details updated";
|
||||
} else {
|
||||
$result['leadStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
}
|
||||
else{
|
||||
$activateStatus['IsActive']=true;
|
||||
$this->db->where('TrackingID',$updateDetails['TrackingID']);
|
||||
$this->db->update(LEAD_TRACKING_FOLLOWUP, $activateStatus);
|
||||
$result['leadStatus'] = false;
|
||||
$result['message'] = "Something went wrong.please try again";
|
||||
}
|
||||
|
||||
return $result;
|
||||
}
|
||||
// public function getStatusName($statusArr){
|
||||
// $arr = implode(',', $statusArr);
|
||||
// echo $arr;
|
||||
|
||||
@ -3,7 +3,7 @@
|
||||
* controllers for ng-table
|
||||
* Simple table with sorting and filtering on AngularJS
|
||||
*/
|
||||
app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$sessionStorage", "$http", "$state", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $sessionStorage, $http, $state) {
|
||||
app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$sessionStorage", "$http", "$state","$modal", function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $sessionStorage, $http, $state,$modal) {
|
||||
sessionStorage.setItem('searchName','');
|
||||
sessionStorage.setItem('searchMobile','');
|
||||
$scope.userType=JSON.parse(sessionStorage.getItem('localObj')).localType;
|
||||
@ -104,7 +104,6 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* make a search date array
|
||||
*/
|
||||
@ -359,7 +358,103 @@ if(checkresult != -1)
|
||||
};
|
||||
}
|
||||
};
|
||||
$scope.trackForm2 = {
|
||||
submit: function (form, myModel,loading,selectedStudents) {
|
||||
// console.log(form);
|
||||
// console.log(myModel);
|
||||
// console.log(selectedStudents);
|
||||
|
||||
if(isNaN(myModel.date)){
|
||||
$scope.nextFollowupDate = myModel.date;
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.getdate=new Date(myModel.date).toDateString();
|
||||
|
||||
$scope.nextFollowupDate = $filter('date')(new Date($scope.getdate), 'dd-MM-yyyy');
|
||||
}
|
||||
|
||||
var firstError = null;
|
||||
if (form.$invalid) {
|
||||
|
||||
var field = null, firstError = null;
|
||||
for (field in form) {
|
||||
if (field[0] != '$') {
|
||||
if (firstError === null && !form[field].$valid) {
|
||||
firstError = form[field].$name;
|
||||
}
|
||||
if (form[field].$pristine) {
|
||||
form[field].$dirty = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
angular.element('.ng-invalid[name=' + firstError + ']').focus();
|
||||
// swal("The form cannot be submitted because it contains validation errors!", "Errors are marked with a red, dashed border!", "error");
|
||||
} else {
|
||||
|
||||
$scope.ldloading1 = {};
|
||||
|
||||
$scope.ldloading1[loading.replace('-', '_')] = true;
|
||||
/* hide this fun after branch level changes
|
||||
if($scope.userType !='R004'){
|
||||
$scope.updateBranchID = JSON.parse(sessionStorage.getItem('localObj')).localBranchID;
|
||||
$scope.updateAssignTo = myModel.assignedTo;
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.updateBranchID = myModel.branch.BranchCode;
|
||||
$scope.updateAssignTo = myModel.assignedTo;
|
||||
|
||||
}*/
|
||||
|
||||
var updateFollowupDetails2 = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateFollowupDetails2/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
student:selectedStudents,
|
||||
date: $scope.nextFollowupDate,
|
||||
assignedTo: myModel.assignedTo,
|
||||
status: myModel.status,
|
||||
comments:myModel.comments,
|
||||
createdBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
||||
branchId: JSON.parse(sessionStorage.getItem('localObj')).localBranchID
|
||||
|
||||
}
|
||||
};
|
||||
$http(updateFollowupDetails2).then(function (response) {
|
||||
if (response.data.status==200 && response.data.leadDetails.leadStatus == true) {
|
||||
$rootScope.modalInstance.close();
|
||||
swal(" ", response.data.leadDetails.message, "success");
|
||||
$state.go($state.current, {}, { reload: true });
|
||||
} else {
|
||||
|
||||
swal(" ", response.data.leadDetails.message, "error");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
}
|
||||
},
|
||||
reset: function (form) {
|
||||
|
||||
$scope.myModel = angular.copy($scope.master);
|
||||
form.$setPristine(true);
|
||||
$scope.myModel = {
|
||||
"studentName": "",
|
||||
"mobileNumber": "",
|
||||
"universityName": "",
|
||||
"courseName": "",
|
||||
"activity": "",
|
||||
"assignedTo": "",
|
||||
"status": "",
|
||||
"referedBy": '',
|
||||
"comments":''
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* get student exist or not for add lead details
|
||||
@ -719,6 +814,8 @@ $scope.GetstaffwiseDetails($scope.tod);
|
||||
|
||||
$scope.$watch(function () {
|
||||
$scope.filteredItems = $scope.$eval(" data |filter:search2| filter:search3| filter:search4| filter:search5");
|
||||
// $scope.filteredItems = $scope.$eval(" data | filter:search3 ");
|
||||
// console.log($scope.filteredItems);
|
||||
});
|
||||
/**
|
||||
* Auto Call Tracking Sriram
|
||||
@ -734,6 +831,8 @@ $scope.GetstaffwiseDetails($scope.tod);
|
||||
var len2 = $scope.data.length;
|
||||
var len = $scope.filteredItems.length;
|
||||
console.log("len2",len2);
|
||||
console.log("len filter",len);
|
||||
console.log($scope.filteredItems);
|
||||
var i = 0;
|
||||
for(i=0;i<len;i++)
|
||||
{
|
||||
@ -794,52 +893,62 @@ $scope.GetstaffwiseDetails($scope.tod);
|
||||
console.log("donedon",$scope.selectedLeadID);
|
||||
}
|
||||
$scope.calltracking = function(){
|
||||
console.log('Function',$scope.selectedLeadID);
|
||||
if($scope.selectedLeadID ==''){
|
||||
swal('Select Check box','','warning');
|
||||
return false;
|
||||
}else{
|
||||
$scope.controller = 'ng-controller="callTrackingCtrl"';
|
||||
var lead = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'updateCallTrackingDetails/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
||||
lead:$scope.selectedLeadID,
|
||||
branchID:JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
||||
userType:JSON.parse(sessionStorage.getItem('localObj')).localType,
|
||||
}
|
||||
};
|
||||
$http(lead).then(function (response) {
|
||||
if (response.data.status==200) {
|
||||
$rootScope.modalInstance = $modal.open({
|
||||
templateUrl: 'assets/views/autoCalltracking2.html',
|
||||
controller: 'callTrackingCtrl',
|
||||
size: size,
|
||||
resolve: {
|
||||
pdfitems: function () {
|
||||
return $scope.activity;
|
||||
}
|
||||
// console.log($scope.selectedStudentsID);
|
||||
// swal('testing','','warning');
|
||||
// return true;
|
||||
//$rootScope.student = $scope.selectedStudentsID;
|
||||
if($scope.selectedLeadID ==''){
|
||||
swal('Select Check box','','warning');
|
||||
return false;
|
||||
}else{
|
||||
$scope.controller = 'ng-controller="callTrackingCtrl"';
|
||||
var lead = {
|
||||
method: 'POST',
|
||||
url: apiPoint.url + 'getTrackingLeadDetails/',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
},
|
||||
data: {
|
||||
requestedBy: JSON.parse(sessionStorage.getItem('localObj')).localUserID,
|
||||
branchID:JSON.parse(sessionStorage.getItem('localObj')).localBranchID,
|
||||
userType:JSON.parse(sessionStorage.getItem('localObj')).localType,
|
||||
}
|
||||
};
|
||||
$http(lead).then(function (response) {
|
||||
if (response.data.status==200) {
|
||||
console.log('Here',response.data);
|
||||
console.log('$scope.search3.ActivityName',$scope);
|
||||
$rootScope.activity = response.data.activityDetails;
|
||||
$rootScope.status = response.data.statusDetails;
|
||||
$rootScope.staffDetails = response.data.staffDetails;
|
||||
$rootScope.studentDetails = $scope.selectedLeadID;
|
||||
// $scope.modalopen($scope.activity);
|
||||
$rootScope.modalInstance = $modal.open({
|
||||
templateUrl: 'assets/views/autoCalltracking2.html',
|
||||
controller: 'callTrackingCtrl',
|
||||
// size: size,
|
||||
|
||||
resolve: {
|
||||
pdfitems: function () {
|
||||
return $scope.activity;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$rootScope.modalInstance.result.then(function (selectedItem) {
|
||||
$scope.selected = selectedItem;
|
||||
}, function () {
|
||||
$log.info('Modal dismissed at: ' + new Date());
|
||||
});
|
||||
}
|
||||
else{
|
||||
$log.warn('Problem in Modal : ' + new Date());
|
||||
// ('Modal dismissed at: ' + new Date());
|
||||
}
|
||||
});
|
||||
$scope.selected = selectedItem;
|
||||
}, function () {
|
||||
// $log.info('Modal dismissed at: ' + new Date());
|
||||
console.log('Call track Modal dismissed at: ' + new Date());
|
||||
});
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
}]);
|
||||
|
||||
/*
|
||||
@ -2333,5 +2442,3 @@ app.controller('ModalInstanceCtrl1', ["$scope", "$modalInstance", "items1","Word
|
||||
}]);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -208,6 +208,7 @@ $scope.generateButtonStatus = false;
|
||||
if(val)
|
||||
{
|
||||
// $scope.disable = false;
|
||||
console.log('$scope.filteredItems',$scope.filteredItems);
|
||||
var len = $scope.filteredItems.length;
|
||||
var i = 0;
|
||||
for(i=0;i<len;i++)
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<div class="container-fluid container-fullw bg-white" controller>
|
||||
<form name="Form" id="form" novalidate ng-submit="trackForm.submit(Form, myModel, 'zoom-in',studentDetails)" method="post">
|
||||
<form name="Form" id="form" novalidate ng-submit="trackForm2.submit(Form, myModel, 'zoom-in',studentDetails)" method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<fieldset>
|
||||
@ -11,12 +11,9 @@
|
||||
<div class="row">
|
||||
|
||||
<div data-ng-controller="DatepickerDemoCtrl">
|
||||
<div class="col-md-3 form-group"
|
||||
<div class="col-md-4 form-group"
|
||||
ng-class="{'has-error':Form.date.$dirty && Form.date.$invalid, 'has-success':Form.date.$valid}">
|
||||
<label>
|
||||
Followup Date <span
|
||||
class="symbol required"></span>
|
||||
</label>
|
||||
<label> Followup Date <span class="symbol required"></span></label>
|
||||
<input type="text"
|
||||
class="form-control "
|
||||
ng-click="startOpen = !startOpen"
|
||||
@ -34,10 +31,9 @@
|
||||
ng-if="Form.date.$dirty && Form.date.$error.required">Followup date is required.</span>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" ng-if="loading==true">
|
||||
<!-- <div class="col-md-3" ng-if="loading==true">
|
||||
<spinner name="html5spinner">
|
||||
<div class="overlay"></div>
|
||||
<div class="spinner">
|
||||
@ -47,28 +43,26 @@
|
||||
<div class="please-wait">Please Wait...</div>
|
||||
</spinner>
|
||||
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="col-md-3 form-group"
|
||||
ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">
|
||||
<label >
|
||||
Status <span
|
||||
class="symbol required"></span>
|
||||
</label>
|
||||
<select class="form-contro-l" name="status" id="Box3" tabindex="7"
|
||||
ng-model="myModel.status"
|
||||
required >
|
||||
<option value="">Select Status</option>
|
||||
<option ng-repeat="checkStatus in myModel.activity.activityStatus" value="{{checkStatus.ListCode}}">{{checkStatus.ListName}}</option>
|
||||
</select>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.status.$dirty && Form.status.$error.required && myModel.status.length==0">Status is required</span>
|
||||
<div class="col-md-4 form-group" ng-class="{'has-error':Form.status.$dirty && Form.status.$invalid, 'has-success':Form.status.$valid}">
|
||||
<label> Status Name </label>
|
||||
|
||||
<select class="form-control" name="status" id="Box3" tabindex="7"
|
||||
ng-model="myModel.status"
|
||||
>
|
||||
<option value="">Select Status</option>
|
||||
<option ng-repeat="checkStatus in myModel.activity.activityStatus" value="{{checkStatus.ListCode}}">{{checkStatus.ListName}}</option>
|
||||
</select>
|
||||
</div>
|
||||
<!-- <span class="error text-small block"
|
||||
ng-if="Form.status.$dirty && Form.status.$error.required && myModel.status.length==0">Status is required</span> -->
|
||||
<!--<span class="success text-small block"-->
|
||||
<!--ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>-->
|
||||
</div>
|
||||
<!-- </div> -->
|
||||
|
||||
|
||||
<div class="col-md-3" ng-if="loading==true && userType !='R004'">
|
||||
<!--<div class="col-md-3" ng-if="loading==true && userType !='R004'">
|
||||
<spinner name="html5spinner">
|
||||
<div class="overlay"></div>
|
||||
<div class="spinner">
|
||||
@ -79,8 +73,9 @@
|
||||
</spinner>
|
||||
|
||||
</div>
|
||||
<!--&& userType !='R004'-->
|
||||
<div class="col-md-3 form-group"
|
||||
&& userType !='R004'-->
|
||||
|
||||
<div class="col-md-4 form-group"
|
||||
ng-class="{'has-error':Form.assigned.$dirty && Form.assigned.$invalid, 'has-success':Form.assigned.$valid}">
|
||||
<label >
|
||||
Assigned To <span
|
||||
@ -100,16 +95,18 @@
|
||||
<!--<span class="success text-small block"-->
|
||||
<!--ng-if="Form.assigned.$valid && myModel.assigned.length!=0">Thank You</span>-->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div>
|
||||
<label >Comments</label><span class="symbol required"></span>
|
||||
<textarea tabindex="12" class="form-control text-dark" placeholder="Enter a comments" rows="2" ng-model="myModel1.comments"></textarea>
|
||||
<span class="error text-small block"
|
||||
ng-if="Form.assigned.$dirty && Form.assigned.$error.required && myModel.assignedTo.length==0">Assigned to is required</span>
|
||||
<div class="row">
|
||||
<div class="col-md-12 form-group" >
|
||||
<label >Comments</label>
|
||||
<textarea tabindex="12" class="form-control text-dark" placeholder="Enter a comments" rows="2" ng-model="myModel.comments"></textarea>
|
||||
<!-- <span class="error text-small block"
|
||||
ng-if="Form.assigned.$dirty && Form.assigned.$error.required">Assigned to is required</span> -->
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3" ng-if="loading==true && userType =='R004'">
|
||||
<div class="col-md-12" ng-if="loading==true && userType =='R004'">
|
||||
<spinner name="html5spinner">
|
||||
<div class="overlay"></div>
|
||||
<div class="spinner">
|
||||
@ -132,10 +129,10 @@
|
||||
Submit
|
||||
</button>
|
||||
|
||||
<button type="reset" class="btn btn-warning btn-wide" tabindex="14"
|
||||
ng-click="trackForm.reset(Form);Form.$setPristine()">
|
||||
<!-- <button type="reset" class="btn btn-warning btn-wide" tabindex="14"
|
||||
ng-click="trackForm2.reset(Form);Form.$setPristine()">
|
||||
Reset
|
||||
</button>
|
||||
</button> -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -99,7 +99,7 @@
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="2" placeholder="Search anything" />
|
||||
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="2" placeholder="Search anything" ng-change="change(search2, '{{search2}}')"/>
|
||||
</div>
|
||||
<!-- Search By Activity-->
|
||||
<div class="col-md-2 col-md">
|
||||
@ -164,7 +164,6 @@
|
||||
<fieldset>
|
||||
<div class="col-md-1 col-md-offset-10">
|
||||
<button class="btn btn-success btn-o" ng-click="calltracking()">Call Tracking</button>
|
||||
<!-- ng-click="calltracking()" -->
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user