File: /home/cafsindia/refimac_cafsjobs_com/tech_tracking.php
<?php
// Turn off all error reporting
error_reporting(0);
include('dbconnect.php');
//session_start();
$user=$_SESSION['clid'];
$perm=$_SESSION['cper'];
$mid=$_REQUEST['mid'];
$smid=$_REQUEST['smid'];
$pid=$_REQUEST['pid'];
// customer count
$sqlcustomer="select count(*) as total from customer where CUSTOMER_UPDATE=1";
$qucust=mysql_query($sqlcustomer);
$qucust_f=mysql_fetch_assoc($qucust);
$cust_count=$qucust_f['total'];
//employee
$sqlemp="select count(*) as total from employee where EMP_UPDATE=1";
$quemp=mysql_query($sqlemp);
$quemp_f=mysql_fetch_assoc($quemp);
$emp_count=$quemp_f['total'];
//make
$sqlmake="select count(*) as total from make";
$qumake=mysql_query($sqlmake);
$qumake_f=mysql_fetch_assoc($qumake);
$make_count=$qumake_f['total'];
//service
$sqlservice="select count(*) as total from service where year='".date('Y')."' and month='".date('m')."'";
//echo $sqlservice;
$quservicet=mysql_query($sqlservice);
$quservicet_f=mysql_fetch_assoc($quservicet);
$service_count=$quservicet_f['total'];
//call register count
$sqlcallcount="select count(*) as total,status from serviceapp_callreg where complaint_date like '%".date('Y-m')."%' group by status";
//echo $sqlcallcount;
$total=0;
$callcount_count_closed=0;
$callcount_count_pending=0;
$callcount_count_canceled=0;
$qucallcount=mysql_query($sqlcallcount);
while($qucallcount_f=mysql_fetch_assoc($qucallcount))
{
$total+=$qucallcount_f['total'];
if($qucallcount_f['status']==2)
$callcount_count_closed=$qucallcount_f['total'];
if($qucallcount_f['status']==3)
$callcount_count_pending=$qucallcount_f['total'];
if($qucallcount_f['status']==4)
$callcount_count_canceled=$qucallcount_f['total'];
}
?>
<div id="contentwrapper">
<div class="main_content">
<div class="page-head">
<div class="container">
<!-- BEGIN PAGE TITLE -->
<div class="page-title">
<h1>Technician call closure</h1>
</div>
</div>
</div>
<div class="page-content">
<div class="container">
<div class="row-fluid">
<div class="span12">
<?php
if($nav=="1"||$nav=="3")
echo "<div class='alert alert-success'>
<span>Given information successfully updated !</span>
</div>";
elseif($nav=="2"||$nav=="4"||$nav=="6")
echo "<div class='alert alert-warning'>
<span>sorry, given information not updated, please try again !</span>
</div>";
elseif($nav=="5")
echo "<div class='alert alert-danger'>
<span>Selected Record successfully deleted !</span>
</div>";
?>
</div>
</div>
<div class="page-content-inner">
<div class="row">
<div class="col-md-12">
<div class="col-md-6">
<div >
<div class="col-md-4">
<label>From:</label><input name="callclosurfrmdate" type="text" class="form-control" id="callclosurfrmdate" value="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" onclick="$('#callclosurfrmdate').datepicker('show');" />
</div>
<div class="col-md-4">
<label>To:</label><input name="callclosurtodate" type="text" class="form-control" id="callclosurtodate" value="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" onclick="$('#callclosurtodate').datepicker('show');" />
</div>
<div class="col-md-4" style="padding-top: 22px;">
<button type="submit" onclick="callclosure()" class="btn green">Submit</button>
</div>
</div>
<div id="3dcallchart"></div>
</div>
<div class="col-md-6">
<div >
<div class="col-md-4">
<label>From:</label> <input name="penclosurfrmdate" type="text" class="form-control" id="penclosurfrmdate" data-date-format="dd-mm-yyyy" value="<?php echo date('d-m-Y'); ?>" onclick="$('#penclosurfrmdate').datepicker('show');"/>
</div>
<div class="col-md-4">
<label>To:</label><input name="penclosurtoate" data-date-format="dd-mm-yyyy" type="text" class="form-control" id="penclosurtodate" value="<?php echo date('d-m-Y'); ?>" onclick="$('#penclosurtodate').datepicker('show');"/>
</div>
<div class="col-md-4" style="padding-top: 22px;">
<label> </label>
<button type="submit" class="btn green" onclick="callpending()">Submit</button>
</div>
</div>
<div id="3newdcallchart" style="padding-top: 30px;"></div>
</div>
</div>
</div>
</br>
<div class="row" >
<div class="col-md-12" align="center">
<div class="col-md-6" >
<div >
<div class="col-md-4">
<label>From:</label><input name="callcancelfrmdate" type="text" class="form-control" id="callcancelfrmdate" value="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" onclick="$('#callcancelfrmdate').datepicker('show');" />
</div>
<div class="col-md-4">
<label>To:</label><input name="callcanceltodate" type="text" class="form-control" id="callcanceltodate" value="<?php echo date('d-m-Y'); ?>" data-date-format="dd-mm-yyyy" onclick="$('#callcanceltodate').datepicker('show');" />
</div>
<div class="col-md-4" style="padding-top: 22px;">
<label> </label>
<button type="submit" onclick="callcancel()" class="btn green">Submit</button>
</div>
</div>
<div id="3dcancelcallchart"></div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<script>
$(document).ready(function()
{
if ( $.fn.dataTable.isDataTable( '#sample' ) ) {
table = $('#sample').DataTable();
}
else {
table = $('#sample').DataTable( {
dom: 'Bfrtip',
buttons: [
'copy', 'csv', 'excel', 'pdf', 'print','pageLength'
], lengthMenu: [
[ 10, 25, 50, -1 ],
[ '10 rows', '25 rows', '50 rows', 'Show all' ]
]
} );
}
$('.cancel').click(function()
{
location.reload();
});
$('.btnsearch').click(function()
{
location.reload();
});
callclosedata();
callpending();
callcanceldata();
});
$("form[name='serchform']").validate({
// Specify validation rules
rules: {
// The key name on the left side is the name attribute
// of an input field. Validation rules are defined
// on the right side
Search: "required",
searchtext: "required"
},
// Specify validation error messages
messages: {
Search: "Please select search by",
searchtext: "Please enter employee mobile"
},
// Make sure the form is submitted to the destination defined
// in the "action" attribute of the form when valid
submitHandler: function(form) {
form.submit();
}
});
//call closur report dashboard month wise
// call closur report dashboard technecian wise
function callclosure()
{
callclosedata();
}
function callclosedata()
{
var callclosurfrmdate=$('#callclosurfrmdate').val();
var callclosurtodate=$('#callclosurtodate').val();
var options = {
chart: {
renderTo: '3dcallchart',
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Technecian Call Closure from date:'+callclosurfrmdate+' - Todate:'+callclosurtodate
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>({point.y} count)'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: []
};
$.getJSON("ajax/loaddata.php?type=1&pageid=1_1_0&callclosurfrmdate="+callclosurfrmdate+"&callclosurtodate="+callclosurtodate, function(json) {
options.series = json;
chart = new Highcharts.Chart(options);
});
}
//call Pending report dashboard technecian wise
function callpending()
{
//alert('sss');
callpendingdata();
}
function callpendingdata()
{
var penclosurfrmdate=$('#penclosurfrmdate').val();
var penclosurtodate=$('#penclosurtodate').val();
//alert(penclosurfrmdate);
var options = {
chart: {
renderTo: '3newdcallchart',
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Technecian Call Pending from date:'+penclosurfrmdate+' - Todate:'+penclosurtodate
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>({point.y} count)'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: []
};
$.getJSON("ajax/loaddata.php?type=2&pageid=1_1_0&penclosurfrmdate="+penclosurfrmdate+"&penclosurtodate="+penclosurtodate, function(json) {
options.series = json;
chart = new Highcharts.Chart(options);
});
}
// Cancel call closur report dashboard technecian wise
function callcancel()
{
callcanceldata();
}
function callcanceldata()
{
var callcancelfrmdate=$('#callcancelfrmdate').val();
var callcanceltodate=$('#callcanceltodate').val();
var options = {
chart: {
renderTo: '3dcancelcallchart',
type: 'pie',
options3d: {
enabled: true,
alpha: 45,
beta: 0
}
},
title: {
text: 'Technecian Call Cancel Closure from date:'+callcancelfrmdate+' - Todate:'+callcanceltodate
},
tooltip: {
pointFormat: '{series.name}: <b>{point.percentage:.1f}%</b>({point.y} count)'
},
plotOptions: {
pie: {
allowPointSelect: true,
cursor: 'pointer',
depth: 35,
dataLabels: {
enabled: true,
format: '{point.name}'
}
}
},
series: []
};
$.getJSON("ajax/loaddata.php?type=3&pageid=1_1_0&callcancelfrmdate="+callcancelfrmdate+"&callcanceltodate="+callcanceltodate, function(json) {
options.series = json;
chart = new Highcharts.Chart(options);
});
}
function monthcallclosure()
{
monthwisecallclosure();
}
function monthwisecallclosure()
{
var monthcallclosurfrmdate=$('#monthcallclosurfrmdate').val();
//var monthcallclosurtodate=$('#monthcallclosurtodate').val();
var options = {
chart: {
renderTo: 'containerupdate',
type: 'column'
},
title: {
text: 'Month wise call closure Report',
x: -20 //center
},
subtitle: {
text: 'Sumber : Technecian Wise',
x: -20
},
xAxis: {
title: {
text: 'Months'
},
categories: []
},
yAxis: {
title: {
text: 'Technecian Count'
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>:<b>{point.y}</b> of total<br/>'
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y}'
}
}
},
legend: {
layout: 'vertical',
align: 'right',
verticalAlign: 'top',
x: -40,
y: 100,
floating: true,
borderWidth: 1,
backgroundColor: ((Highcharts.theme && Highcharts.theme.legendBackgroundColor) || '#FFFFFF'),
shadow: true
},
series: []
};
$.getJSON("ajax/loaddata.php?type=4&pageid=1_1_0&monthcallclosurfrmdate="+monthcallclosurfrmdate, function(json) {
options.xAxis.categories = json[0]['data']; //xAxis: {categories: []}
options.series[0] = json[1];
chart = new Highcharts.Chart(options);
});
}
</script>