This commit is contained in:
resicovenba 2017-11-30 11:01:48 +05:30
commit d84a7c874e
5 changed files with 192 additions and 319 deletions

View File

@ -88,6 +88,10 @@ defined('SUPER_ADMIN') OR define('SUPER_ADMIN','R004');
defined('ADMIN') OR define('ADMIN','R003');
defined('EMPLOYEE') OR define('EMPLOYEE','R002');
defined('STUDENT') OR define('STUDENT','R001');
//status code
defined('OPEN') OR define('OPEN','S001');
defined('CLOSE') OR define('CLOSE','S002');
defined('REOPEN') OR define('REOPEN','S003');
//encript database table name
defined('LOGIN') OR define('LOGIN','T_Login');
defined('BRANCH') OR define('BRANCH','T_BranchMaster');

View File

@ -38,7 +38,7 @@ class Call_Tracking_Controller extends REST_Controller {
$this->methods['getTrackingDetails_post']['limit'] = 1000; // 50 requests per hour per user/key
$this->methods['updateFollowupDetails_post']['limit'] = 1000; // 50 requests per hour per user/key
$this->methods['loadFollowupDetails_post']['limit'] = 1000; // 50 requests per hour per user/key
$this->methods['getDashboardCallTrack_post']['limit'] = 1000; // 50 requests per hour per user/key
// load the model
$this->load->model('Calltracking_model', 'Calltracking_model');
@ -225,7 +225,32 @@ class Call_Tracking_Controller extends REST_Controller {
}
/*
* get dash board call track details
* created by kms
* */
public function getDashboardCallTrack_post()
{
$search['requestedBy'] = $this->post('requestedBy');
$getdashBoardCallDetails = $this->Calltracking_model->getDashboardTrackingDetails($search);
if ($getdashBoardCallDetails)
{
$getdashBoardCallDetails['status'] = REST_Controller::HTTP_OK;
// Set the response and exit
$this->response($getdashBoardCallDetails, REST_Controller::HTTP_OK); // OK (200) being the HTTP response code
}
else
{
// Set the response and exit
$this->response([
'message' => 'No records found!',
'status' => REST_Controller::HTTP_NOT_FOUND
], REST_Controller::HTTP_NOT_FOUND); // NOT_FOUND (404) being the HTTP response code
}
}
}

View File

@ -398,6 +398,47 @@ class Calltracking_model extends CI_Model {
$studeTrackID = $this->db->get();
return $studeTrackID->result();
}
/*
* used to get dash board call track details
* created by kms
* */
public function getDashboardTrackingDetails($serach=null)
{
$now = new DateTime();
$now->setTimezone(new DateTimezone('Asia/Kolkata'));
$todayFollowupDate=$now->format('d-m-Y');
$follouwpDetails=$this->todayFollowupDetails($todayFollowupDate,'S001');
if($follouwpDetails){
$result_array['todayStatus']=true;
$result_array['todayFolloupDetails']=$follouwpDetails;
}
else{
$result_array['todayStatus']=false;
$result_array['todayFolloupDetails']="";
}
/* $follouwpPendingDetails=$this->getPendingFollowupDetails($todayFollowupDate,'S001');
print_r($follouwpPendingDetails);die();*/
return $result_array;
}
/*
* get date wise followup details
* @params date and status and check status
* */
public function todayFollowupDetails($todayDate=null,$status=null)
{
$this->db->distinct();
$this->db->select('LD.LeadName,LD.MobileNumber,LT.TrackingID,LT.LeadID,PLD.ListCode,PLD.ListName,LTF.FollowupOn,LT.StatusCode,PLD1.ListName as statusListName');
$this->db->from(LEAD_DETAILS.' as LD');
$this->db->join(LEAD_TRACKING.' as LT', 'LT.LeadID = LD.LeadID');
$this->db->join(LEAD_TRACKING_FOLLOWUP.' as LTF', 'LTF.TrackingID = LT.TrackingID');
$this->db->join(PICK_LIST_DETAILS.' as PLD', 'PLD.ListCode = LT.ActivityStatus');
$this->db->join(PICK_LIST_DETAILS.' as PLD1', 'PLD1.ListCode = LT.StatusCode');
$this->db->where('LTF.FollowupOn',$todayDate);
$this->db->where('LT.StatusCode',$status);
$this->db->order_by('LT.TrackingID','ASC');
return $this->db->get()->result();
}
}

View File

@ -1,304 +1,43 @@
'use strict';
/**
* controllers used for the dashboard
*/
app.controller('SparklineCtrl', ["$scope", function ($scope) {
$scope.sales = [600, 923, 482, 1211, 490, 1125, 1487];
$scope.earnings = [400, 650, 886, 443, 502, 412, 353];
$scope.referrals = [4879, 6567, 5022, 5890, 9234, 7128, 4811];
}]);
/**
* controllers for ng-table
* Simple table with sorting and filtering on AngularJS
*/
app.controller('VisitsCtrl', ["$scope", function ($scope) {
app.controller('dashboardCtrl', ["$scope","toaster", "$filter", "ngTableParams", "API_POINTS", "$localStorage", "$http", "$state", function ($scope,toaster, $filter, ngTableParams, apiPoint, $localStorage, $http, $state) {
/*
* used to get dash board call track details
* this method called from view ng-init directive
* created by kms
* */
$scope.todayFolloupDetails="";
$scope.initCallTracking = function () {
var getCallTrack = {
method: 'POST',
url: apiPoint.url + 'getDashboardCallTrack/',
headers: {
'Content-Type': 'application/json'
},
data: {
requestedBy: JSON.parse(localStorage.getItem('localObj')).localUserID
}
};
$http(getCallTrack).then(function (response) {
if (response.data.status==200) {
if(response.data.todayStatus){
$scope.todayFolloupDetails=response.data.todayFolloupDetails;
}
else{
$scope.todayFolloupDetails='EMPTY';
}
$scope.data = {
labels: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.2)',
strokeColor: 'rgba(220,220,220,1)',
pointColor: 'rgba(220,220,220,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: [65, 59, 80, 81, 56, 55, 40, 84, 64, 120, 132, 87]
},
{
label: 'My Second dataset',
fillColor: 'rgba(151,187,205,0.2)',
strokeColor: 'rgba(151,187,205,1)',
pointColor: 'rgba(151,187,205,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(151,187,205,1)',
data: [28, 48, 40, 19, 86, 27, 90, 102, 123, 145, 60, 161]
}
]
};
} else {
$scope.options = {
$scope.todayFolloupDetails='EMPTY';
maintainAspectRatio: false,
// Sets the chart to be responsive
responsive: true,
///Boolean - Whether grid lines are shown across the chart
scaleShowGridLines: true,
//String - Colour of the grid lines
scaleGridLineColor: 'rgba(0,0,0,.05)',
//Number - Width of the grid lines
scaleGridLineWidth: 1,
//Boolean - Whether the line is curved between points
bezierCurve: false,
//Number - Tension of the bezier curve between points
bezierCurveTension: 0.4,
//Boolean - Whether to show a dot for each point
pointDot: true,
//Number - Radius of each point dot in pixels
pointDotRadius: 4,
//Number - Pixel width of point dot stroke
pointDotStrokeWidth: 1,
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
pointHitDetectionRadius: 20,
//Boolean - Whether to show a stroke for datasets
datasetStroke: true,
//Number - Pixel width of dataset stroke
datasetStrokeWidth: 2,
//Boolean - Whether to fill the dataset with a colour
datasetFill: true,
// Function - on animation progress
onAnimationProgress: function () { },
// Function - on animation complete
onAnimationComplete: function () { },
//String - A legend template
legendTemplate: '<ul class="tc-chart-js-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'
}
});
};
}]);
app.controller('SalesCtrl', ["$scope", function ($scope) {
// Chart.js Data
$scope.data = {
labels: ['January', 'February', 'March', 'April', 'May', 'June', 'July'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.5)',
strokeColor: 'rgba(220,220,220,0.8)',
highlightFill: 'rgba(220,220,220,0.75)',
highlightStroke: 'rgba(220,220,220,1)',
data: [65, 59, 80, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
fillColor: 'rgba(151,187,205,0.5)',
strokeColor: 'rgba(151,187,205,0.8)',
highlightFill: 'rgba(151,187,205,0.75)',
highlightStroke: 'rgba(151,187,205,1)',
data: [28, 48, 40, 19, 86, 27, 90]
}
]
};
// Chart.js Options
$scope.options = {
maintainAspectRatio: false,
// Sets the chart to be responsive
responsive: true,
//Boolean - Whether the scale should start at zero, or an order of magnitude down from the lowest value
scaleBeginAtZero: true,
//Boolean - Whether grid lines are shown across the chart
scaleShowGridLines: true,
//String - Colour of the grid lines
scaleGridLineColor: "rgba(0,0,0,.05)",
//Number - Width of the grid lines
scaleGridLineWidth: 1,
//Boolean - If there is a stroke on each bar
barShowStroke: true,
//Number - Pixel width of the bar stroke
barStrokeWidth: 2,
//Number - Spacing between each of the X value sets
barValueSpacing: 5,
//Number - Spacing between data sets within X values
barDatasetSpacing: 1,
//String - A legend template
legendTemplate: '<ul class="tc-chart-js-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].fillColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'
};
}]);
app.controller('OnotherCtrl', ["$scope", function ($scope) {
// Chart.js Data
$scope.data = [
{
value: 300,
color: '#F7464A',
highlight: '#FF5A5E',
label: 'Red'
},
{
value: 50,
color: '#46BFBD',
highlight: '#5AD3D1',
label: 'Green'
},
{
value: 100,
color: '#FDB45C',
highlight: '#FFC870',
label: 'Yellow'
}
];
$scope.total = 450;
// Chart.js Options
$scope.options = {
// Sets the chart to be responsive
responsive: false,
//Boolean - Whether we should show a stroke on each segment
segmentShowStroke: true,
//String - The colour of each segment stroke
segmentStrokeColor: '#fff',
//Number - The width of each segment stroke
segmentStrokeWidth: 2,
//Number - The percentage of the chart that we cut out of the middle
percentageInnerCutout: 50, // This is 0 for Pie charts
//Number - Amount of animation steps
animationSteps: 100,
//String - Animation easing effect
animationEasing: 'easeOutBounce',
//Boolean - Whether we animate the rotation of the Doughnut
animateRotate: true,
//Boolean - Whether we animate scaling the Doughnut from the centre
animateScale: false,
//String - A legend template
legendTemplate: '<ul class="tc-chart-js-legend"><% for (var i=0; i<segments.length; i++){%><li><span style="background-color:<%=segments[i].fillColor%>"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>'
};
}]);
app.controller('LastCtrl', ["$scope", function ($scope) {
// Chart.js Data
$scope.data = {
labels: ['Eating', 'Drinking', 'Sleeping', 'Designing', 'Coding', 'Cycling', 'Running'],
datasets: [
{
label: 'My First dataset',
fillColor: 'rgba(220,220,220,0.2)',
strokeColor: 'rgba(220,220,220,1)',
pointColor: 'rgba(220,220,220,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(220,220,220,1)',
data: [65, 59, 90, 81, 56, 55, 40]
},
{
label: 'My Second dataset',
fillColor: 'rgba(151,187,205,0.2)',
strokeColor: 'rgba(151,187,205,1)',
pointColor: 'rgba(151,187,205,1)',
pointStrokeColor: '#fff',
pointHighlightFill: '#fff',
pointHighlightStroke: 'rgba(151,187,205,1)',
data: [28, 48, 40, 19, 96, 27, 100]
}
]
};
// Chart.js Options
$scope.options = {
// Sets the chart to be responsive
responsive: true,
//Boolean - Whether to show lines for each scale point
scaleShowLine: true,
//Boolean - Whether we show the angle lines out of the radar
angleShowLineOut: true,
//Boolean - Whether to show labels on the scale
scaleShowLabels: false,
// Boolean - Whether the scale should begin at zero
scaleBeginAtZero: true,
//String - Colour of the angle line
angleLineColor: 'rgba(0,0,0,.1)',
//Number - Pixel width of the angle line
angleLineWidth: 1,
//String - Point label font declaration
pointLabelFontFamily: '"Arial"',
//String - Point label font weight
pointLabelFontStyle: 'normal',
//Number - Point label font size in pixels
pointLabelFontSize: 10,
//String - Point label font colour
pointLabelFontColor: '#666',
//Boolean - Whether to show a dot for each point
pointDot: true,
//Number - Radius of each point dot in pixels
pointDotRadius: 3,
//Number - Pixel width of point dot stroke
pointDotStrokeWidth: 1,
//Number - amount extra to add to the radius to cater for hit detection outside the drawn point
pointHitDetectionRadius: 20,
//Boolean - Whether to show a stroke for datasets
datasetStroke: true,
//Number - Pixel width of dataset stroke
datasetStrokeWidth: 2,
//Boolean - Whether to fill the dataset with a colour
datasetFill: true,
//String - A legend template
legendTemplate: '<ul class="tc-chart-js-legend"><% for (var i=0; i<datasets.length; i++){%><li><span style="background-color:<%=datasets[i].strokeColor%>"></span><%if(datasets[i].label){%><%=datasets[i].label%><%}%></li><%}%></ul>'
};
}]);

View File

@ -1,37 +1,101 @@
<!-- start :Script for Countdown designby:SA-->
<script>
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery)}(function(a){"use strict";function b(a){if(a instanceof Date)return a;if(String(a).match(g))return String(a).match(/^[0-9]*$/)&&(a=Number(a)),new Date(a);throw new Error("Couldn't cast `"+a+"` to a date object.")}function c(a){return function(b){var c=b.match(/%(-|!)?[A-Z]{1}(:[^;]+;)?/gi);if(c)for(var e=0,f=c.length;f>e;++e){var g=c[e].match(/%(-|!)?([a-zA-Z]{1})(:[^;]+;)?/),i=new RegExp(g[0]),j=g[1]||"",k=g[3]||"",l=null;g=g[2],h.hasOwnProperty(g)&&(l=h[g],l=Number(a[l])),null!==l&&("!"===j&&(l=d(k,l)),""===j&&10>l&&(l="0"+l.toString()),b=b.replace(i,l.toString()))}return b=b.replace(/%%/,"%")}}function d(a,b){var c="s",d="";return a&&(a=a.replace(/(:|;|\s)/gi,"").split(/\,/),1===a.length?c=a[0]:(d=a[0],c=a[1])),1===Math.abs(b)?d:c}var e=100,f=[],g=[];g.push(/^[0-9]*$/.source),g.push(/([0-9]{1,2}\/){2}[0-9]{4}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g.push(/[0-9]{4}(\/[0-9]{1,2}){2}( [0-9]{1,2}(:[0-9]{2}){2})?/.source),g=new RegExp(g.join("|"));var h={Y:"years",m:"months",w:"weeks",d:"days",D:"totalDays",H:"hours",M:"minutes",S:"seconds"},i=function(b,c,d){this.el=b,this.$el=a(b),this.interval=null,this.offset={},this.setFinalDate(c),this.instanceNumber=f.length,f.push(this),this.$el.data("countdown-instance",this.instanceNumber),d&&(this.$el.on("update.countdown",d),this.$el.on("stoped.countdown",d),this.$el.on("finish.countdown",d)),this.start()};a.extend(i.prototype,{start:function(){if(null!==this.interval)throw new Error("Countdown is already running!");var a=this;this.update(),this.interval=setInterval(function(){a.update.call(a)},e)},stop:function(){clearInterval(this.interval),this.interval=null,this.dispatchEvent("stoped")},pause:function(){this.stop.call(this)},resume:function(){this.start.call(this)},remove:function(){this.stop(),delete f[this.instanceNumber]},setFinalDate:function(a){this.finalDate=b(a)},update:function(){return 0===this.$el.closest("html").length?(this.remove(),void 0):(this.totalSecsLeft=this.finalDate.valueOf()-(new Date).valueOf(),this.totalSecsLeft=Math.ceil(this.totalSecsLeft/1e3),this.totalSecsLeft=this.totalSecsLeft<0?0:this.totalSecsLeft,this.offset={seconds:this.totalSecsLeft%60,minutes:Math.floor(this.totalSecsLeft/60)%60,hours:Math.floor(this.totalSecsLeft/60/60)%24,days:Math.floor(this.totalSecsLeft/60/60/24)%7,totalDays:Math.floor(this.totalSecsLeft/60/60/24),weeks:Math.floor(this.totalSecsLeft/60/60/24/7),months:Math.floor(this.totalSecsLeft/60/60/24/30),years:Math.floor(this.totalSecsLeft/60/60/24/365)},0===this.totalSecsLeft?(this.stop(),this.dispatchEvent("finish")):this.dispatchEvent("update"),void 0)},dispatchEvent:function(b){var d=a.Event(b+".countdown");d.finalDate=this.finalDate,d.offset=a.extend({},this.offset),d.strftime=c(this.offset),this.$el.trigger(d)}}),a.fn.countdown=function(){var b=Array.prototype.slice.call(arguments,0);return this.each(function(){var c=a(this).data("countdown-instance");if(void 0!==c){var d=f[c],e=b[0];i.prototype.hasOwnProperty(e)?d[e].apply(d,b.slice(1)):null===String(e).match(/^[$A-Z_][0-9A-Z_$]*$/i)?d.setFinalDate.call(d,e):a.error("Method %s does not exist on jQuery.countdown".replace(/\%s/gi,e))}else new i(this,b[0],b[1])})}});
</script>
<!-- end :Script for Countdown -->
<style>
a {
color:#5b5b60;
}
</style>
<!-- start: DASHBOARD TITLE -->
<section id="page-title" class="padding-top-15 padding-bottom-15">
<div class="row">
<div class="col-sm-7">
<h1 class="mainTitle" translate="dashboard.WELCOME" translate-values="{ appName: app.name }">{{ mainTitle }}</h1>
<span class="mainDescription"></span>
</div>
</div>
</div>
</section>
<!-- end: DASHBOARD TITLE -->
<!-- start: FEATURED BOX LINKS -->
<div class="container-fluid container-fullw bg-white">
<div class="col-sm-12">
<div class="panel panel-white no-radius text-center">
<div class="container-fluid container-fullw bg-white" ng-controller="dashboardCtrl">
<div class="row" data-ng-init="initCallTracking()">
<div class="col-sm-6">
<div class="panel panel-white" id="panel6">
<div class="panel-heading panel-white">
<h4 class="panel-title text-green">Today Follow Up Details</h4>
<ct-paneltool class="panel-tools" tool-refresh="load1" ng-click="initCallTracking()"></ct-paneltool>
</div>
<div class="panel-body">
<span class="fa-stack fa-2x"> <i class="fa fa-square fa-stack-2x text-primary"></i> <i class="fa fa-smile-o fa-stack-1x fa-inverse"></i> </span>
<h2 class="StepTitle">Something awesome is coming soon</h2>
<p class="text-small">We are building something very cool stay tuned and be patient. your patience will be well paid</p>
<div id="countdown" style="font-size: 48px;color: #000;line-height: 1.1em;" align="center"></div>
<div ng-hide="todayFolloupDetails!='EMPTY'">
<center><h5 class="text-dark">No Followup!</h5></center>
</div>
<div class="panel-scroll height-180" perfect-scrollbar wheel-propagation="false" suppress-scroll-x="true" ng-if="todayFolloupDetails!=''">
<table class="table table-hover">
<thead>
<tr>
<th>Tracking ID</th>
<th>Lead Name</th>
<th>Mobile No</th>
<th>Activity</th>
<th>Status</th>
</tr>
</thead>
<tbody ng-repeat="today in todayFolloupDetails">
<tr>
<td>{{today.TrackingID}}</td>
<td>{{today.LeadName}}</td>
<td>{{today.MobileNumber}}</td>
<td>{{today.ListName}}</td>
<td class="hidden-xs" ng-if="today.StatusCode!='S001'"><span class="label label-sm label-success">{{today.statusListName}}</span></td>
<td class="hidden-xs" ng-if="today.StatusCode=='S001'"><span class="label label-sm label-warning">{{today.statusListName}}</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<!-- end: FEATURED BOX LINKS -->
<!-- start: FIRST SECTION -->
<!-- start: Script for end date for countdown-->
<script type="text/javascript">
$('#countdown').countdown('2017/12/30', function(event) {
$(this).html(event.strftime('%w weeks %d days <br /> %H:%M:%S'));
});
</script>
<!-- end: Script for end date for countdown-->
<div class="col-sm-6">
<div class="panel panel-white" id="panel6">
<div class="panel-heading panel-white">
<h4 class="panel-title text-red">Pending Follow Up Details</h4>
<ct-paneltool class="panel-tools" tool-refresh="load1" ng-click="initCallTracking()"></ct-paneltool>
</div>
<div class="panel-body">
<div class="panel-scroll height-180" perfect-scrollbar wheel-propagation="false" suppress-scroll-x="true">
<table class="table table-hover">
<thead>
<tr>
<th>Tracking ID</th>
<th>Lead Name</th>
<th>Mobile No</th>
<th>Activity</th>
<th>Status</th>
</tr>
</thead>
<tbody ng-repeat="today in todayFolloupDetails">
<tr>
<td>{{today.TrackingID}}</td>
<td>{{today.LeadName}}</td>
<td>{{today.MobileNumber}}</td>
<td>{{today.ListName}}</td>
<td class="hidden-xs" ng-if="today.StatusCode!='S001'"><span class="label label-sm label-success">{{today.statusListName}}</span></td>
<td class="hidden-xs" ng-if="today.StatusCode=='S001'"><span class="label label-sm label-warning">{{today.statusListName}}</span></td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
</div>