This commit is contained in:
resicovenba 2017-11-22 20:40:14 +05:30
commit bca711f95b
5 changed files with 165 additions and 127 deletions

View File

@ -159,6 +159,8 @@ 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['UpdatedOn'] = date('Y-m-d H:i:s');
// store followup details for insert
$followup_details['TrackingID'] = $this->post('trackingID');
$followup_details['FollowupOn'] = $this->post('date');

View File

@ -136,7 +136,7 @@ class Calltracking_model extends CI_Model {
$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('LO.IsActive',$status);
$this->db->where('ST.IsActive',$status);
$staffDetails=$this->db->get();
if($staffDetails){
$result_staff = array();

View File

@ -23,10 +23,23 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
//get current date
$scope.hideDateSearch=true;
$scope.currentDate=$filter('date')(new Date(), 'dd-MM-yyyy');
$scope.myModel.date=$scope.currentDate;
$scope.search=$scope.currentDate;
$scope.myModel.searchDate=$scope.currentDate;
$scope.checkDate = function (value) {
if(value==null || value==undefined){
$scope.search='';
}
else{
$scope.filterSearch=$filter('date')(value, 'dd-MM-yyyy');
$scope.search=$scope.filterSearch;
}
}
/*
* edit branch details
* created by kms
@ -35,13 +48,13 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
localStorage.setItem('trackID', p.TrackingID);
localStorage.setItem('count', 0);
$rootScope.followupDetails=p;
/* $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode;
$rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2);
/* $rootScope.myModel1.status=$rootScope.followupDetails.StatusCode;
$rootScope.currentDate1=new Date().getFullYear() + '-' + ('0' + (new Date().getMonth() + 1)).slice(-2) + '-' + ('0' + new Date().getDate()).slice(-2);
$rootScope.myModel1.date=$rootScope.followupDetails.followupDetails[0].FollowupOn;*/
$rootScope.myModel1.date=$rootScope.followupDetails.followupDetails[0].FollowupOn;*/
/* $scope.editId = pid;*/
$state.go('app.trackingFollowup');
/* $scope.editId = pid;*/
$state.go('app.trackingFollowup');
};
/*
@ -63,6 +76,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
var firstError = null;
if (form.$invalid) {
var field = null, firstError = null;
for (field in form) {
if (field[0] != '$') {
@ -77,6 +91,7 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
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;
@ -148,58 +163,58 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.loading=false;
$scope.getLead = function (form,mobile) {
//call form success
if(form.mobilenumber.$valid){
$scope.loading=true;
/* $scope.ldloading2 = {};
//call form success
if(form.mobilenumber.$valid){
$scope.loading=true;
/* $scope.ldloading2 = {};
$scope.ldloading2[loading.replace('-', '_')] = true;*/
$scope.ldloading2[loading.replace('-', '_')] = true;*/
var lead = {
method: 'POST',
url: apiPoint.url + 'getTrackingLeadDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
mobileNumber:mobile
}
};
$http(lead).then(function (response) {
if (response.data.status==200) {
$scope.myModel.courseName=response.data.existLeadDetails.CourseID;
$scope.myModel.enquiryStatus=response.data.existLeadDetails.IsNewEnquiry;
$scope.activity=response.data.activityDetails;
$scope.status=response.data.statusDetails;
$scope.staffDetails=response.data.staffDetails;
$scope.university=response.data.universityDetails;
$scope.myModel.status=$scope.status[0].ListCode;
$scope.myModel.studentName=response.data.existLeadDetails.LeadName;
// find index for university drop down list
for(var i in $scope.university) {
if($scope.university[i].universityID==response.data.existLeadDetails.UniversityID){
$scope.myModel.universityName=$scope.university[i];
}
var lead = {
method: 'POST',
url: apiPoint.url + 'getTrackingLeadDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
mobileNumber:mobile
}
};
$http(lead).then(function (response) {
if (response.data.status==200) {
$scope.loading=false;
$scope.myModel.courseName=response.data.existLeadDetails.CourseID;
$scope.myModel.enquiryStatus=response.data.existLeadDetails.IsNewEnquiry;
$scope.activity=response.data.activityDetails;
$scope.status=response.data.statusDetails;
$scope.staffDetails=response.data.staffDetails;
$scope.university=response.data.universityDetails;
$scope.myModel.status=$scope.status[0].ListCode;
$scope.myModel.studentName=response.data.existLeadDetails.LeadName;
// find index for university drop down list
for(var i in $scope.university) {
if($scope.university[i].universityID==response.data.existLeadDetails.UniversityID){
$scope.myModel.universityName=$scope.university[i];
}
}
$scope.loading=false;
} else {
$scope.loading=false;
$scope.myModel.universityName="";
} else {
$scope.loading=false;
$scope.myModel.universityName="";
}
});
}
});
}
else{
$scope.loading=false;
}
}
else{
$scope.loading=false;
}
};
@ -218,50 +233,50 @@ app.controller('callTrackingCtrl', ["$scope","$rootScope","toaster", "$filter",
$scope.init = function (form,myModel,type) {
$scope.loader = true;
var getTrackDetails = {
method: 'POST',
url: apiPoint.url + 'getTrackingDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType
}
};
$http(getTrackDetails).then(function (response) {
var getTrackDetails = {
method: 'POST',
url: apiPoint.url + 'getTrackingDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID,
requestedDept: JSON.parse(localStorage.getItem('localObj')).localType
}
};
$http(getTrackDetails).then(function (response) {
if (response.data.status == 200 && response.data.trackingStatus == true) {
$scope.loader = false;
if (response.data.status == 200 && response.data.trackingStatus == true) {
$scope.loader = false;
$rootScope.trackingStatus = response.data.statusDetails;
$rootScope.trackingStatus = response.data.statusDetails;
$scope.data = response.data.trackingDetails;
$scope.data = response.data.trackingDetails;
// this for search box
/* $scope.search = {searchDate: ''};
$scope.tableParams = new ngTableParams({
page: 1,
count: 10,
filter: $scope.search
}, {
total: data.length,
getData: function ($defer, params) {
var orderedData = params.sorting() ? $filter('orderBy')(data, params.orderBy()) : data;
orderedData = params.filter() ? $filter('filter')(orderedData, params.filter().followupDate) : orderedData;
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});*/
// this for search box
/* $scope.search = {searchDate: ''};
$scope.tableParams = new ngTableParams({
page: 1,
count: 10,
filter: $scope.search
}, {
total: data.length,
getData: function ($defer, params) {
var orderedData = params.sorting() ? $filter('orderBy')(data, params.orderBy()) : data;
orderedData = params.filter() ? $filter('filter')(orderedData, params.filter().followupDate) : orderedData;
$defer.resolve(orderedData.slice((params.page() - 1) * params.count(), params.page() * params.count()));
}
});*/
} else {
$scope.loader = false;
} else {
$scope.loader = false;
$scope.branchInfo = '';
$scope.data='';
$scope.branchInfo = '';
$scope.data='';
}
});
}
});
}
@ -379,4 +394,3 @@ app.controller('callTrackingCtrl2', ["$scope","$rootScope","toaster", "$filter",
}]);

View File

@ -1,3 +1,13 @@
<style>
b.fa {
display: inline-block;
border-radius: 60px;
box-shadow: 0px 0px 2px #FF6600;
padding: 0.5em 0.6em;
}
</style>
<!-- start: PAGE TITLE -->
<section id="page-title">
<div class="row">
@ -99,15 +109,34 @@
});
</script>
<div class="col-md-3">
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search Date" />
<input type="text"
class="form-control "
ng-click="startOpen = !startOpen"
datepicker-popup="dd-MM-yyyy"
ng-model="myModel.searchDate"
is-open="startOpen"
ng-init="startOpen = false"
name="date"
datepicker-options="dateOptions"
placeholder="Select Date"
min-date="currentDate"
max-date="minStartDate"
close-text="Close" ng-change="checkDate(myModel.searchDate);">
<input class="form-control" type="text" ng-model="search" id="search" autofocus tabindex="1" placeholder="Search Date" ng-hide="hideDateSearch==true" />
</div>
<div class="col-md-3">
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="1" placeholder="Search Mobile Number" />
<input class="form-control" type="text" ng-model="search2" id="search2" autofocus tabindex="1" placeholder="Search Mobile/Name" />
</div>
<div class="col-md-3">
<!--<div class="col-md-3">
<input class="form-control" type="text" ng-model="search3" id="search3" autofocus tabindex="1" placeholder="Search Student Name" />
</div>
</div>-->
<br><br>
</div>
@ -176,18 +205,22 @@
<tr>
<th>S.No
</th>
<th ng-click="sort('TrackingID')">Tracking ID
<span class="glyphicon sort-icon" ng-show="sortKey=='TrackingID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('followupDetails')">Date
<span class="glyphicon sort-icon" ng-show="sortKey=='followupDetails'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('LeadName')">Student Name
<span class="glyphicon sort-icon" ng-show="sortKey=='LeadName'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('MobileNumber')">Mobile Number
<span class="glyphicon sort-icon" ng-show="sortKey=='MobileNumber'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th ng-click="sort('TrackingID')">Tracking ID
<span class="glyphicon sort-icon" ng-show="sortKey=='TrackingID'" ng-class="{'glyphicon-chevron-up':reverse,'glyphicon-chevron-down':!reverse}"></span>
</th>
<th>University</th>
<th>Course</th>
<th>Activity
</th>
<th>Assigned To
@ -197,16 +230,19 @@
</tr>
</thead>
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|filter:search3:strict|filter:search2:strict|itemsPerPage:5">
<tbody dir-paginate="p in data|orderBy:sortKey:reverse|filter:search:strict|filter:search2:strict|itemsPerPage:5">
<tr>
<td>{{$index+1}}</td>
<td><a href="#" class="text-orange" ng-click="setEditId(p);">{{p.followupDetails }}</a></td>
<td><a href="#" class="text-orange" ng-click="setEditId(p);">{{p.TrackingID}}</a></td>
<td>{{p.followupDetails }}</td>
<td>{{p.LeadName}}</td>
<td>{{p.MobileNumber}}</td>
<td>{{p.TrackingID}}</td>
<td>{{p.UniversityName}}</td>
<td>{{p.CourseName }}</td>
<td>{{p.ListName}}</td>
<td>{{p.Firstname}}</td>
<td><a href="#" class="text-orange" ng-click="setEditId(p);">Click To Follow Up</a></td>
<td><a href="#" class="text-orange" ng-click="setEditId(p);"><b class="fa fa-hover fa-phone " aria-hidden="true"></b>
</a></td>
</tr>
</tbody>
@ -235,7 +271,7 @@
<script>
$('#addtrack').click(function () {
$('#branchcode').focus();
$('#mobilenumber').focus();
});
</script>
@ -264,7 +300,7 @@
</label>
<input type="text" placeholder="Enter Mobile Number" ladda="ldloading1.zoom_in" data-style="zoom-in"
tabindex="5" class="form-control" name="mobilenumber" ng-minlength="10" ng-maxlength="12"
autofocus tabindex="1" class="form-control" name="mobilenumber" id="mobilenumber" ng-minlength="10" ng-maxlength="12"
ng-model="myModel.mobileNumber" ng-pattern="/^[0-9]*$/" required ng-change="getLead(Form,myModel.mobileNumber);"/>
<span class="error text-small block"
ng-if="Form.mobilenumber.$dirty && Form.mobilenumber.$invalid"
@ -293,7 +329,7 @@
</label>
<input type="text" placeholder="Enter Student Name"
tabindex="5" class="form-control" name="studentname"
tabindex="2" class="form-control" name="studentname"
ng-model="myModel.studentName" ng-pattern="/^[a-zA-Z.\s]*$/" required/>
<span class="error text-small block"
ng-if="Form.studentname.$dirty && Form.studentname.$error.required">Student name is required</span>
@ -318,7 +354,7 @@
<label>
University <span class="symbol required"></span>
</label>
<select class="form-control" name="university" tabindex="8" id="university"
<select class="form-control" name="university" tabindex="3" id="university"
ng-model="myModel.universityName"
ng-options="details.universityName for details in university"
required>
@ -346,7 +382,7 @@
<label>
Course Name <span class="symbol required"></span>
</label>
<select class="form-control" name="course" tabindex="9" id="course"
<select class="form-control" name="course" tabindex="4" id="course"
ng-model="myModel.courseName"
ng-options="courseDet.CourseID as courseDet.CourseName for courseDet in myModel.universityName.courseDetails" required>
<option value=""> Select Course</option>
@ -366,7 +402,7 @@
Date <span
class="symbol required"></span>
</label>
<input type="text" tabindex="6"
<input type="text"
class="form-control "
ng-click="startOpen = !startOpen"
datepicker-popup="dd-MM-yyyy"
@ -403,7 +439,7 @@
Activity <span
class="symbol required"></span>
</label>
<select class="form-control" name="activity" id="Box1" tabindex="1"
<select class="form-control" name="activity" id="Box1" tabindex="6"
ng-model="myModel.activity"
ng-options="source.ListCode as source.ListName for source in activity"
required>
@ -434,7 +470,7 @@
class="symbol required"></span>
</label>
<select class="form-control" name="assigned" id="Box2" tabindex="1"
<select class="form-control" name="assigned" id="Box2" tabindex="7"
ng-model="myModel.assignedTo"
ng-options="emp.loginId as emp.staffName for emp in staffDetails"
required>
@ -464,7 +500,7 @@
Status <span
class="symbol required"></span>
</label>
<select class="form-control" name="status" id="Box3" tabindex="1"
<select class="form-control" name="status" id="Box3" tabindex="8"
ng-model="myModel.status"
ng-options="checkStatus.ListCode as checkStatus.ListName for checkStatus in status"
required>
@ -486,7 +522,7 @@
</label>
<input type="text" placeholder="Enter Referred By Name"
tabindex="5" class="form-control" name="refered"
tabindex="9" class="form-control" name="refered"
ng-model="myModel.referedBy" ng-pattern="/^[a-zA-Z.\s]*$/"/>
<span class="error text-small block"
@ -498,7 +534,7 @@
<label>
Comments <span class="symbol required"></span>
</label>
<textarea placeholder="Enter Comments" tabindex="31"
<textarea placeholder="Enter Comments" tabindex="10"
class="form-control textdsc" name="comments"
ng-model="myModel.comments" required></textarea>
<span class="error text-small block"
@ -514,13 +550,13 @@
<div class="col-md-12">
<div class="pull-right">
<button type="submit" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
<button tabindex="11" type="submit" ladda="ldloading1.zoom_in" class="btn btn-wide btn-success" data-style="zoom-in">
Submit
</button>
<!-- <button type="submit" class="btn btn-success btn-o" tabindex="8">
Submit
</button>-->
<button type="reset" class="btn btn-warning btn-wide" tabindex="9"
<button type="reset" class="btn btn-warning btn-wide" tabindex="12"
ng-click="branchForm.reset(Form)">
Reset
</button>
@ -535,21 +571,7 @@
</tabset>
</div>
</div>
<!-- end: LIST GROUP -->

View File

@ -144,10 +144,10 @@
<div class="col-md-4 text-left">
<button type="submit" ladda="ldloading2.zoom_in" class="btn btn-sm btn-success" data-style="zoom-in" ng-click="updateFollowup(followupDetails,myModel1,'zoom-in');">
save
Save
</button>
<button type="submit" class="btn btn-sm btn-warning" ng-click="cancel();">
cancel
Cancel
</button>