| Server IP : 182.53.201.61 / Your IP : 216.73.217.175 Web Server : Apache/2.2.15 (Fedora) System : Linux km10.dyndns.org 2.6.31.5-127.fc12.i686.PAE #1 SMP Sat Nov 7 21:25:57 EST 2009 i686 User : apache ( 48) PHP Version : 5.3.3 Disable Function : NONE MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/kpiit/ |
Upload File : |
<table class="table table-bordered" id="datatableocc" style="display:none;">
<thead>
<tr class="system">
<th class="text-center">WEEK</th>
<th class="text-center">Electrical</th>
<th class="text-center">Mechanical</th>
<th class="text-center">Belt</th>
<th class="text-center">Operation</th>
<th class="text-center">Mine OP</th>
<th class="text-center">Maintenance =(ซ่อมบำรุง,แรงสูง)</th>
</tr>
</thead>
<tbody>
<tr>
<td>Cumulative Last 14day<br><b>(<?php echo $_SESSION[totaloccWeek3];?>)</b></td>
<?php
$OCCLast3week = "select downtime.*,department.department_nameEN,COUNT(downtime.department_id)as occurrence
from downtime
left join department on downtime.department_id=department.department_id
where downtime.plan='Unplan' and downtime.downtime_line='$StrLine' and downtime_date >=date_add('$SumDate',interval -14 day)
and downtime_date <=('$SumDate')
and downtime.department_id in(10,11,12,13,20,21)
group by downtime.department_id ";
$resultLast3w=mysql_db_query($objDB,$OCCLast3week);
while($objResultOCC3W=mysql_fetch_array($resultLast3w)){
?>
<td class="text-right pr10"><?php echo $objResultOCC3W[occurrence];?></td>
<?php
$totaloccWeek3=($totaloccWeek3+$objResultOCC3W[occurrence]);
$_SESSION[totaloccWeek3]=$totaloccWeek3;
}
?>
</tr>
<tr>
<td>Cumulative Last 7day<br><b>(<?php echo $_SESSION[totaloccWeek2];?>)</b></td>
<?php
$OCCLast2week = "select downtime.*,department.department_nameEN,COUNT(downtime.department_id)as occurrence
from downtime
left join department on downtime.department_id=department.department_id
where downtime.plan='Unplan' and downtime.downtime_line='$StrLine' and downtime_date >=date_add('$SumDate',interval -7 day)
and downtime_date <=('$SumDate')
and downtime.department_id in(10,11,12,13,20,21)
group by downtime.department_id ";
$resultLast2w=mysql_db_query($objDB,$OCCLast2week);
while($objResultOCC2W=mysql_fetch_array($resultLast2w)){
?>
<td class="text-right pr10"><?php echo $objResultOCC2W[occurrence];?></td>
<?php
$totaloccWeek2=($totaloccWeek2+$objResultOCC2W[occurrence]);
$_SESSION[totaloccWeek2]=$totaloccWeek2;
}
?>
</tr>
<tr>
<td>Last 1day<br><b>(<?php echo $_SESSION[totaloccWeek1];?>)</b></td>
<?php
$OCCLast1week = "select downtime.*,department.department_nameEN,COUNT(downtime.department_id)as occurrence
from downtime
left join department on downtime.department_id=department.department_id
where downtime.plan='Unplan' and downtime.downtime_line='$StrLine' and downtime_date >=date_add('$SumDate',interval -1 day)
and downtime_date <=('$SumDate')
and downtime.department_id in(10,11,12,13,20,21)
group by downtime.department_id ";
$resultLast1w=mysql_db_query($objDB,$OCCLast1week);
while($objResultOCC1W=mysql_fetch_array($resultLast1w)){
?>
<td class="text-right pr10"><?php echo $objResultOCC1W[occurrence];?></td>
<?php
$totaloccWeek1=($totaloccWeek1+$objResultOCC1W[occurrence]);
$_SESSION[totaloccWeek1]=$totaloccWeek1;
}
?>
</tr>
<tr>
<td>Today<br><b>(<?php echo $_SESSION[totaloccWeek];?>)</b></td>
<?php
$OCCweek = "select downtime.*,department.department_nameEN,COUNT(downtime.department_id)as occurrence
from downtime
left join department on downtime.department_id=department.department_id
where downtime.plan='Unplan' and downtime.downtime_line='$StrLine' and downtime_date >=date_add('$SumDate',interval -0 day)
and downtime_date <=('$SumDate')
and downtime.department_id in(10,11,12,13,20,21)
group by downtime.department_id";
$resultw=mysql_db_query($objDB,$OCCweek);
while($objResultOCCW=mysql_fetch_array($resultw)){
?>
<td class="text-right pr10"><?php echo $objResultOCCW[occurrence];?></td>
<?php
$totaloccWeek=($totaloccWeek+$objResultOCCW[occurrence]);
$_SESSION[totaloccWeek]=$totaloccWeek;
}
?>
</tr>
</tbody>
</table>
<div class="col-md-7 pull-left">
<b>CHARTS BY NO. OF OCCURRENCE </b>
<div id="containerocc" style="width: 595px; height: 220px;"></div>
</div>
<script type="text/javascript">
$(function () {
$('#containerocc').highcharts({
data: {
table: 'datatableocc'
},
chart: {
type: 'column'
},
title: {
text: ''
},
yAxis: {
allowDecimals: false,
title: {
text: 'Number'
}
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
rotation: 90,
y: -8, // 10 pixels down from the top
format: '{point.y}'
}
}
},
tooltip: {
formatter: function () {
return '<b>' + this.series.name + '</b><br/>' +
this.point.y + ' ' + this.point.name.toLowerCase();
}
}
});
});