leads on particular day

This commit is contained in:
venbatechnologies@gmail.com 2018-11-12 16:27:59 +05:30
parent 28e251b36f
commit a9a761c17e
5 changed files with 251 additions and 1 deletions

View File

@ -97,6 +97,9 @@ $route['callAsImportantFlag'] = 'Call_Tracking_Controller/callAsImportantFlag';
$route['autoAddlead'] = 'Call_Tracking_Controller/autoAddlead';
$route['autoTrackingDetails'] = 'Call_Tracking_Controller/autoTrackingDetails';
$route['getstaffcallDetails'] = 'Call_Tracking_Controller/getstaffcallDetails';
// university
$route['insertUniversity'] = 'University_Controller/insertUniversity';

View File

@ -513,6 +513,34 @@ public function autoTrackingDetails_post(){
// ], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
// }
}
public function getstaffcallDetails_post()
{
$branchID = $this->post('branch');
// $myDate = date('Y-m-d');
$myDate = $this->post('date');
$todaycalldetails = $this->Calltracking_model->GetStaffCallDetails($branchID,$myDate);
if($todaycalldetails)
{
$todaycalldetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($todaycalldetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND);
}
}
/*
* End of call tracking
*/

View File

@ -1637,4 +1637,41 @@ class Calltracking_model extends CI_Model {
return $result;
}
public function GetStaffCallDetails($branchID,$myDate)
{
$this->db->select('LeadName,LD.MobileNumber,IsNewEnquiry,StatusCode,Course,University,FollowupComments,FollowupOn,AssignedStaff,ListName,Firstname,Lastname');
$this->db->from('T_Lead_Tracking_Followup LTF');
$this->db->join('T_Lead_Tracking LT','LT.TrackingID=LTF.TrackingID');
$this->db->join('T_Lead_Details LD','LD.LeadID=LT.LeadID');
$this->db->join('T_Login L','L.ID=LT.AssignedTo');
$this->db->join('T_StaffDetails SD','SD.StaffID=L.StaffID');
$this->db->join('T_PickListDetails PLD','PLD.ListCode = LTF.StatusName');
$this->db->where("date_format(LTF.CreatedOn,'%Y-%m-%d')=",$myDate);
$this->db->where('LT.CreatedBranch',$branchID);
$this->db->group_by('InteractionId');
$Details = $this->db->get()->result();
// print_r($this->db->last_query());die();
if($Details)
{
$result_array['searchst'] = true;
$result_array['details'] = $Details;
}
else
{
$result_array['searchst'] = false;
$result_array['details'] = "No records found!";
}
return $result_array;
}
}

View File

@ -567,7 +567,7 @@ $scope.trackingTodayno=0;
}
else if(response.data.trackingStatus == 1)
{
console.log('hai');
//console.log('hai');
}
else {
@ -591,6 +591,115 @@ $scope.trackingTodayno=0;
$scope.SatffCallDetails='';
$scope.calldata='';
$scope.GetstaffwiseDetails = function (date)
{
//console.log(date);
var getDetails = {
method: 'POST',
url: apiPoint.url + 'getstaffcallDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
branch:JSON.parse(localStorage.getItem('localObj')).localBranchID,
date:date,
}
};
$http(getDetails).then(function (response) {
console.log(response.data.details);
if (response.data.status == 200 && response.data.details !='No records found!' ) {
$scope.SatffCallDetails=response.data.details;
$scope.callnodata=true;
$scope.calldata=false;
} else {
// swal("Failed!", "No details Availble", "warning");
$scope.calldata=true;
$scope.callnodata=false;
console.log($scope.calldata);
}
});
}
$scope.filters = {
"to_date": "",
};
$scope.changeDate = function()
{
var to = $scope.filters.to_date;
//alert(to);
if(to !='')
{
var t = new Date(to),
month = '' + (t.getMonth() + 1),
day = '' + t.getDate(),
year = t.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
var to_dt = [year, month ,day].join('-');
$scope.tod = to_dt;
}
else
{
var date = new Date();
var t = new Date(date),
month = '' + (t.getMonth() + 1),
day = '' + t.getDate(),
year = t.getFullYear();
if (month.length < 2) month = '0' + month;
if (day.length < 2) day = '0' + day;
var to_dt = [year, month ,day].join('-');
$scope.tod = to_dt;
}
//console.log($scope.tod);
$scope.GetstaffwiseDetails($scope.tod);
}
@ -815,6 +924,14 @@ app.controller('callTrackingLeadCtrl', ["$scope","$rootScope","toaster", "$filte
}
}]);
/*
* close tracking controller
@ -1144,6 +1261,8 @@ app.controller('callTrackingPendingCtrl', ["$scope","$rootScope","toaster", "$fi
* */
$scope.init = function (myModel) {
//console.log('in')
/* if(isNaN(myModel.pendingDate)){
$scope.loadDate= $filter('date')(new Date(), 'yyyy-MM-dd');

View File

@ -668,6 +668,69 @@
</form>
</div>
</tab>
<tab heading="View Details" id="viewdet">
<div class="row">
<div class="col-md-3" data-ng-controller="DatepickerDemoCtrl">
<label> Date </label>
<input type="text" tabindex="1" class="form-control " ng-click="startOpen = !startOpen" datepicker-popup="dd-MM-yyyy" ng-model="filters.to_date"
is-open="startOpen" ng-init="startOpen = false" name="addDate" datepicker-options="dateOptions" placeholder="Select Date" close-text="Close" required="required" ng-change="changeDate()" show-button-bar="true" />
</div>
<div class="col-md-3">
<label for="form-field-select-2">Search</label>
<input class="form-control" type="text" ng-model="search" id="searchIn" autofocus tabindex="2" placeholder="Search" /><br><br>
</div>
</div>
<div>
</br>
</div>
<div ng-if="calldata">
<center> <h1>No Records Found !!</h1> </center>
</div>
<div data-ng-init="changeDate()">
<div ng-if="callnodata">
<table class="table table-hover">
<thead>
<tr>
<th>Staff Name</th>
<th>University</th>
<th>Course</th>
<th>Followup Date</th>
<th>Student Name</th>
<th>Mobile Number</th>
<th>Follow up Comments</th>
<th>Status</th>
</tr>
<tbody>
<tr dir-paginate="p in SatffCallDetails|filter:search:strict|itemsPerPage:10">
<td>{{p.Firstname}}{{p.Lastname}}</td>
<td>{{p.University}}</td>
<td>{{p.Course}}</td>
<td>{{p.FollowupOn}}</td>
<td>{{p.LeadName}}</td>
<td>{{p.MobileNumber}}</td>
<td>{{p.FollowupComments}}</td>
<td>{{p.ListName}}</td>
</tr>
</tbody>
</thead>
</table>
<!-- <dir-pagination-controls direction-links="true" boundary-links="true">
</dir-pagination-controls> -->
</div>
</div>
</tab>
</tabset>
</div>