call tracking filter
This commit is contained in:
parent
b05c3e9496
commit
9c6020d2e3
@ -148,10 +148,14 @@ class Call_Tracking_Controller extends REST_Controller {
|
||||
$search['requestedDept'] = $this->post('requestedDept');
|
||||
// $search['branchID'] = $this->post('branchId');
|
||||
$search['searchDate'] = $this->post('searchDate');
|
||||
// print_r( $search['searchDate']);
|
||||
$search['CreatedBranch'] = $this->post('branchId');
|
||||
|
||||
$status=$this->post('status');
|
||||
|
||||
// $search['searchMobileNumber'] = $this->post('searchMobileNumber');
|
||||
// $search['searchName']= $this->post('searchName');
|
||||
$getTrackedDetails = $this->Calltracking_model->getTrackingDetails($search);
|
||||
$getTrackedDetails = $this->Calltracking_model->getTrackingDetails($search,$status);
|
||||
|
||||
if ($getTrackedDetails)
|
||||
{
|
||||
|
||||
@ -352,8 +352,9 @@ class Calltracking_model extends CI_Model {
|
||||
* created by kms
|
||||
* */
|
||||
|
||||
public function getTrackingDetails($search=null)
|
||||
public function getTrackingDetails($search=null,$status)
|
||||
{
|
||||
|
||||
$this->db->select('LTF.FollowupOn,LD.LeadID,LD.LeadName,LD.MobileNumber,LD.IsNewEnquiry,LT.TrackingID,LT.ActivityStatus,LT.AssignedTo,LT.StatusCode,LT.University,LT.Course,LT.AlternateMobile,LT.Address,LT.Flag,ST.StaffID,ST.Firstname,PLD1.ListCode as statusListCode,PLD1.ListName as statusListName,AV.ActivityID,AV.ActivityName');
|
||||
$this->db->from(LEAD_TRACKING_FOLLOWUP.' as LTF');
|
||||
$this->db->join(LEAD_TRACKING.' as LT','LT.TrackingID=LTF.TrackingID');
|
||||
@ -437,7 +438,16 @@ class Calltracking_model extends CI_Model {
|
||||
|
||||
}
|
||||
}
|
||||
if($status!=true)
|
||||
{
|
||||
$result_array['pendingTrackingDetails'] = $this->getPrevPendingTrackingDetails($search);
|
||||
// print_r( $result_array['pendingTrackingDetails']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result_array['pendingTrackingDetails']=1;
|
||||
}
|
||||
|
||||
|
||||
|
||||
return $result_array;
|
||||
|
||||
@ -60,6 +60,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
|
||||
|
||||
$scope.checkDate = function (value,type) {
|
||||
// console.log(value.searchDate);
|
||||
if(value.searchDate==null || value.searchDate==undefined){
|
||||
|
||||
$scope.myModel.search='';
|
||||
@ -68,33 +69,38 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
}
|
||||
else{
|
||||
if(type=='2'){
|
||||
|
||||
|
||||
$scope.myModel.search = $filter('date')(value.searchDate, 'yyyy-MM-dd');
|
||||
$scope.toMinDate = $filter('date')(value.searchDate, 'MM-dd-yyyy');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
$scope.searchDateArray(value);
|
||||
$scope.searchDateArray(value,type);
|
||||
|
||||
}
|
||||
/*
|
||||
* check to date
|
||||
* */
|
||||
$scope.checkToDate = function (value) {
|
||||
|
||||
$scope.status='';
|
||||
$scope.checkToDate = function (value,status) {
|
||||
$scope.status=status;
|
||||
if(value.searchDate==null || value.searchDate==undefined){
|
||||
swal("Failed!", 'Please Select From Date', "error");
|
||||
$scope.myModel.dateTo='';
|
||||
$scope.myModel.search='';
|
||||
$scope.toMinDate = '';
|
||||
}
|
||||
else{
|
||||
$scope.filterSearch=$filter('date')(value.searchDate, 'dd-MM-yyyy');
|
||||
$scope.search=$scope.filterSearch;
|
||||
|
||||
else{
|
||||
if(value.searchDate!=null && value.dateTo!=null && status=='true')
|
||||
{
|
||||
|
||||
$scope.filterSearch=$filter('date')(value.searchDate,value.dateTo);
|
||||
$scope.search=$scope.filterSearch;
|
||||
}
|
||||
}
|
||||
$scope.searchDateArray(value);
|
||||
$scope.searchDateArray(value,status);
|
||||
|
||||
}
|
||||
|
||||
@ -102,8 +108,8 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
/*
|
||||
* make a search date array
|
||||
*/
|
||||
$scope.searchDateArray=function (dateValue) {
|
||||
|
||||
$scope.searchDateArray=function (dateValue,status) {
|
||||
|
||||
var listDate = [];
|
||||
if((dateValue.search !=null && dateValue.search !=undefined) && (dateValue.dateTo !=null && dateValue.dateTo !=undefined && dateValue.dateTo !='')){
|
||||
var startDate =dateValue.search;
|
||||
@ -117,6 +123,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
var strDate = startDate;
|
||||
var arrayDate = $filter('date')(strDate, 'dd-MM-yyyy');
|
||||
listDate.push(arrayDate);
|
||||
|
||||
}
|
||||
else{
|
||||
while (strDate < endDate){
|
||||
@ -404,19 +411,19 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
* */
|
||||
$scope.init = function (myModel) {
|
||||
|
||||
|
||||
// console.log(myModel);
|
||||
var logcheck = JSON.parse(localStorage.getItem('localObj'));
|
||||
|
||||
const LOCALTYPE = logcheck.localType;
|
||||
if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R002' || LOCALTYPE=='R005')) {
|
||||
console.log("if");
|
||||
|
||||
}else {
|
||||
if(logcheck != null && LOCALTYPE !='R001') {
|
||||
console.log("else if");
|
||||
|
||||
$state.go('app.dashboard');
|
||||
} else {
|
||||
|
||||
console.log("else else");
|
||||
|
||||
//ipCookie.remove('cookiechk');
|
||||
window.localStorage.clear();
|
||||
$state.go('login.signin');
|
||||
@ -432,6 +439,9 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
$scope.data = [];
|
||||
if(myModel!='' && myModel!=undefined){
|
||||
$scope.finalSearchArry=myModel;
|
||||
|
||||
|
||||
|
||||
}
|
||||
else{
|
||||
$scope.finalSearchArry="";
|
||||
@ -449,7 +459,8 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
|
||||
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType,
|
||||
branchId: JSON.parse(localStorage.getItem('localObj')).localBranchID,
|
||||
searchDate: $scope.finalSearchArry
|
||||
searchDate: $scope.finalSearchArry,
|
||||
status: $scope.status
|
||||
}
|
||||
};
|
||||
$http(getTrackDetails).then(function (response) {
|
||||
@ -521,7 +532,11 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
|
||||
});
|
||||
localStorage.setItem('trackingList', JSON.stringify($scope.data));
|
||||
}
|
||||
|
||||
else if(response.data.trackingStatus == 1)
|
||||
{
|
||||
console.log('hai');
|
||||
}
|
||||
|
||||
else {
|
||||
$scope.loader = false;
|
||||
|
||||
@ -651,8 +666,7 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
|
||||
|
||||
//from date change
|
||||
$scope.checkDate = function (value) {
|
||||
|
||||
|
||||
|
||||
$scope.myModel.search = $filter('date')(value.leadDate, 'yyyy-MM-dd');
|
||||
|
||||
|
||||
@ -687,14 +701,14 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
|
||||
|
||||
const LOCALTYPE = logcheck.localType;
|
||||
if (logcheck != null && (LOCALTYPE == 'R003' || LOCALTYPE == 'R004' || LOCALTYPE == 'R005' || LOCALTYPE == 'R002')) {
|
||||
console.log("if");
|
||||
// console.log("if");
|
||||
}else {
|
||||
if(logcheck != null && LOCALTYPE !='R001') {
|
||||
console.log("else if");
|
||||
// console.log("else if");
|
||||
$state.go('app.dashboard');
|
||||
} else {
|
||||
|
||||
console.log("else else");
|
||||
// console.log("else else");
|
||||
//ipCookie.remove('cookiechk');
|
||||
window.localStorage.clear();
|
||||
$state.go('login.signin');
|
||||
|
||||
@ -92,7 +92,7 @@
|
||||
<input type="text" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="myModel.dateTo"
|
||||
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions"
|
||||
min-date="toMinDate"
|
||||
placeholder="Select To Date" close-text="Close" required="required" ng-change="checkToDate(myModel);" ng-readonly="true"
|
||||
placeholder="Select To Date" close-text="Close" required="required" ng-change="checkToDate(myModel,'true');" ng-readonly="true"
|
||||
show-button-bar="true" />
|
||||
|
||||
</div>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user