call tracking

This commit is contained in:
venbatechnologies@gmail.com 2018-11-16 14:58:10 +05:30
parent 2a83d48859
commit 1f7bed117b
11 changed files with 547 additions and 5 deletions

View File

@ -99,6 +99,8 @@ $route['autoTrackingDetails'] = 'Call_Tracking_Controller/autoTrackingDetails';
$route['getstaffcallDetails'] = 'Call_Tracking_Controller/getstaffcallDetails';
$route['getstaffCountDetails'] = 'Call_Tracking_Controller/getstaffCountDetails';
// university

View File

@ -522,7 +522,9 @@ public function getstaffcallDetails_post()
$myDate = $this->post('date');
$todaycalldetails = $this->Calltracking_model->GetStaffCallDetails($branchID,$myDate);
$staff = $this->post('staff');
$todaycalldetails = $this->Calltracking_model->GetStaffCallDetails($branchID,$myDate,$staff);
if($todaycalldetails)
@ -541,6 +543,34 @@ public function getstaffcallDetails_post()
}
public function getstaffCountDetails_post()
{
$branchID = $this->post('branch');
// $myDate = date('Y-m-d');
$myDate = $this->post('date');
$todaycountdetails = $this->Calltracking_model->GetStaffCountDetails($branchID,$myDate);
if($todaycountdetails)
{
$todaycountdetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($todaycountdetails, 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

@ -1638,7 +1638,7 @@ class Calltracking_model extends CI_Model {
}
public function GetStaffCallDetails($branchID,$myDate)
public function GetStaffCallDetails($branchID,$myDate,$staff)
{
$this->db->select('LeadName,LD.MobileNumber,IsNewEnquiry,StatusCode,Course,University,FollowupComments,FollowupOn,AssignedStaff,ListName,Firstname,Lastname');
$this->db->from('T_Lead_Tracking_Followup LTF');
@ -1649,6 +1649,7 @@ public function GetStaffCallDetails($branchID,$myDate)
$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->where('LTF.AssignedStaff',$staff);
$this->db->group_by('InteractionId');
$Details = $this->db->get()->result();
@ -1672,6 +1673,38 @@ public function GetStaffCallDetails($branchID,$myDate)
}
public function GetStaffCountDetails($branchID,$myDate)
{
$this->db->select('AssignedStaff,Firstname,Lastname,SD.StaffID,count(InteractionId) as count');
$this->db->from('T_Lead_Tracking_Followup LTF');
$this->db->join('T_Login L','L.ID=LTF.AssignedStaff');
$this->db->join('T_StaffDetails SD','SD.StaffID=L.StaffID');
$this->db->where("date_format(LTF.CreatedOn,'%Y-%m-%d')=",$myDate);
$this->db->where('SD.BranchCode',$branchID);
$this->db->group_by('AssignedStaff');
$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

@ -146,7 +146,8 @@
"details":"Add/View Leads",
"close":"Closed Leads",
"pending":"Open Leads",
"lead":"Daywise Leads"
"lead":"Daywise Leads",
"leadcount":"Staffwise Leads"
},
"daybook": {
"MAIN": "INCOME / EXPENSE",

View File

@ -117,6 +117,10 @@ app.constant('JS_REQUIRES', {
* call track
* */
'callTrackingCtrl': 'assets/js/controllers/callTrackingCtrl.js',
/*
* call track
* */
'staffleadCtrl': 'assets/js/controllers/staffleadCtrl.js',
/*
* status
* */

View File

@ -489,6 +489,14 @@ app.config(['$stateProvider', '$urlRouterProvider', '$controllerProvider', '$com
ncyBreadcrumb: {
label: 'Open leads'
}
}).state('app.call.leadcount', {
url: '/leadcount',
templateUrl: "assets/views/stafflead.html",
title: 'Staff leads',
resolve: loadSequence('spin', 'ladda', 'angular-ladda', 'staffleadCtrl','ngTable'),
ncyBreadcrumb: {
label: 'Staff leads'
}
}).state('app.daybook', {
url: '/daybook',
template: '<div ui-view class="fade-in-up"> <div style="margin: auto; width: 50%;padding: 10px;"> STUDENT STATUS UPDATE </div> </div>',

View File

@ -0,0 +1,257 @@
'use strict';
/*** controller***/
app.controller('staffleadCtrl', ["$scope","$rootScope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage" ,"$http", "$state","$modal","$log",
function ($scope,$rootScope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http,ipCookie ,$state,$modal,$log){
//function ($scope, apiPoint, $http, SweetAlert, $state,$modal, md5, ipCookie, $window, dateListDescService) {
// DataTables configurable options
$scope.filters = {
"from_date": "",
"to_date": "",
};
var localDetails = JSON.parse(localStorage.getItem('localObj'));
//var localDetails = ipCookie('cookiechk');
// console.log(localDetails);
// $scope.initHead = function() {
//console.log('rfd');
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');
}
}
// }
$scope.universitySearchData = '';
$scope.filters = {
"to_date": "",
};
$scope.init = function()
{
// console.log('in')
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;
$scope.GetstaffwiseCounts($scope.tod);
};
$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;
}
$scope.GetstaffwiseCounts($scope.tod);
}
$scope.GetstaffwiseCounts = function (date)
{
var getcountDetails = {
method: 'POST',
url: apiPoint.url + 'getstaffCountDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
branch:JSON.parse(localStorage.getItem('localObj')).localBranchID,
date:date,
}
};
$http(getcountDetails).then(function (response) {
// console.log(response.data.details);
if (response.data.status == 200 && response.data.details !='No records found!' ) {
$scope.SatffCountDetails=response.data.details;
$scope.callnodata=true;
$scope.calldata=false;
for(var i=0;i<$scope.SatffCountDetails.length;i++)
$scope.SatffCountDetails[i].SL_NO = i+1;
//console.log($scope.SatffCountDetails);
} else {
// swal("Failed!", "No details Availble", "warning");
$scope.calldata=true;
$scope.callnodata=false;
//console.log($scope.calldata);
}
});
}
$scope.closeDetails = function()
{
$scope.staffdet = '-1';
}
$scope.SatffCallDetails
$scope.staffdet = '-1';
$scope.AssignedStaff_id ='';
$scope.getLeadDetails = function (staff)
{
var assignedstaffid = staff.AssignedStaff;
var checkdate = $scope.tod;
$scope.AssignedStaff_id =assignedstaffid;
var getDetails = {
method: 'POST',
url: apiPoint.url + 'getstaffcallDetails/',
headers: {
'Content-Type': 'application/json'
},
data: {
branch:JSON.parse(localStorage.getItem('localObj')).localBranchID,
date:checkdate,
staff:assignedstaffid,
}
};
$http(getDetails).then(function (response)
{
if (response.data.status == 200 && response.data.details !='No records found!' ) {
$scope.SatffCallDetails=response.data.details;
$scope.calldetnodata=true;
$scope.calldetdata=false;
// console.log(response.data.details);
// console.log($scope.SatffCallDetails)
$scope.staffdet = $scope.SatffCallDetails[0].AssignedStaff;
//console.log($scope.staffdet)
for(var i=0;i<$scope.SatffCallDetails.length;i++)
$scope.SatffCallDetails[i].SL_NO = i+1;
} else {
// swal("Failed!", "No details Availble", "warning");
$scope.calldetdata=true;
$scope.calldetnodata=false;
}
});
}
}]);

View File

@ -0,0 +1,70 @@
<div class="row">
<div class="col-md-12">
<div ng-if="trackingEditLoading == true" class="text-center">
<!-- <img src="assets/images/ajax_loader_blue.gif" style="width: 5%; height: 30%"> -->
<h3>Fetching ...</h3>
</div>
<div ng-if="trackingdetails == false" class="text-center">
<h3>No Records Found</h3>
</div>
<div class="col-md-12">
<fieldset>
<legend>
Lead Details
</legend>
<!--list of course details : start-->
<div>
<table class="table table-hover">
<thead>
<tr>
<th>SlNo</th>
<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.SL_NO}}</td>
<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>
<div class="row">
<div class="col-md-12">
<div class="pull-right">
</div>
</div>
</div>
</div>
</fieldset>
<div style="float: right;">
<button type="reset" class="btn btn-warning btn-wide" tabindex="101" ng-click="closeDetails()">
Cancel
</button>
</div>
</div>
<!-- class="editRowTd" -->

View File

@ -671,7 +671,7 @@
<tab heading="View Details" id="viewdet">
<!-- <tab heading="View Details" id="viewdet">
<div class="row">
<div class="col-md-3" data-ng-controller="DatepickerDemoCtrl">
@ -730,7 +730,7 @@
</dir-pagination-controls> -->
</div>
</div>
</tab>
</tab> -->
</tabset>

View File

@ -270,6 +270,14 @@
<li ui-sref-active="active">
<a ui-sref="app.call.leadcount" ng-click="checkSuperAdmin()">
<span class="title" translate="sidebar.nav.tracking.leadcount"> Staff Lead DETAILS </span>
</a>
</li>
</ul>
</li>
<!--<li ng-class="{'active open':$state.includes('app.daybooksuperadmin')}">
@ -828,6 +836,14 @@
</li>
<li ui-sref-active="active">
<a ui-sref="app.call.leadcount" ng-click="checkAdmin()">
<span class="title" translate="sidebar.nav.tracking.leadcount"> Staff Lead DETAILS </span>
</a>
</li>
</ul>
</li>

View File

@ -0,0 +1,121 @@
<style>
b.fa {
display: inline-block;
border-radius: 60px;
box-shadow: 0px 0px 2px #FF6600;
padding: 0.5em 0.6em;
}
b.fa1 {
display: inline-block;
border-radius: 60px;
box-shadow: 0px 0px 2px green;
padding: 0.5em 0.6em;
}
.listCoutShow {
margin: 12px;
padding: 4px;
padding-left: 10px;
padding-right: 10px;
border: 1px solid #46b8da;
border-radius: 7px;
color: #FFF;
background-color: #46b8da;
text-align: center;
}
</style>
<!-- start: PAGE TITLE -->
<section id="page-title">
<div class="row">
<div class="col-sm-8">
<h1 class="mainTitle" translate="Staff lead details">{{ mainTitle }}</h1>
<span class="mainDescription">Staffwise leads. </span>
</div>
<!-- <div ncy-breadcrumb></div>-->
</div>
</section>
<!-- end: PAGE TITLE -->
<div class="container-fluid container-fullw bg-white" ng-controller="staffleadCtrl" data-ng-init="init(myModel)">
<div class="row">
<tabset class="tabbable">
<tab heading="Staffwise Leads" id="viewdet">
<div class="container-fluid container-fullw">
<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></br></div>
<div class="col-md-12">
<div ng-if="calldata">
<center> <h1>No Records Found !!</h1> </center>
</div>
</div>
<!-- {{staffdet}} {{p.AssignedStaff}} -->
<div ng-if="callnodata">
<table class="table table-hover">
<thead>
<tr>
<th>S.No</th>
<th>Staff Name</th>
<th>Call Count</th>
<th>Details</th>
</tr>
</thead>
<tbody dir-paginate="p in SatffCountDetails|filter:search:strict|itemsPerPage:10">
<tr >
<td>{{p.SL_NO}}</td>
<td>{{p.Firstname}} {{p.Lastname}}</td>
<td>{{p.count}}</td>
<td style="padding-left: 1px;">
<i class="fa fa-info-circle" tooltip="View Lead Details" ng-click="getLeadDetails(p);"></i>
</td>
</tr>
<tr ng-show="p.AssignedStaff == staffdet">
<td colspan="8" ng-include src="'assets/views/StaffLeadDetails.html'"></td>
</tr>
</tbody>
</table>
<!-- <dir-pagination-controls direction-links="true" boundary-links="true">
</dir-pagination-controls> -->
</div>
</div>
</div>
</tab>
</tabset>
</div>
</div>