|
|
|
อยากให้ข้อมูล ลงตามหัวข้อตารางที่กำหนดครับ ทำยังไงครับ |
|
|
|
|
|
|
|
อยากให้ข้อมูล ลงตามช่องที่กำหนด ตามหัวข้ออ่ะครับ ตอนนี้ข้อมูลมันลงไม่ตรง
Code
<table class="table table-bordered" id="OCCDTEquip">
<thead>
<tr class="system">
<th class="text-center"> WEEK </th>
<th class="text-center">SPDC</th>
<th class="text-center">C1</th>
<th class="text-center">C2</th>
<th class="text-center">C3</th>
<th class="text-center">C4</th>
<th class="text-center">C5.1</th>
<th class="text-center">C5.2</th>
<th class="text-center">C6</th>
<th class="text-center">C7A</th>
<th class="text-center">C7B</th>
<th class="text-center">C8A</th>
<th class="text-center">C8B</th>
<th class="text-center">C9A</th>
<th class="text-center">C9B</th>
<th class="text-center">C10A</th>
<th class="text-center">CR-A</th>
<th class="text-center">CR-B</th>
<th class="text-center">CR-C</th>
<th class="text-center">CR-D</th>
<th class="text-center">CR-J</th>
</tr>
</thead>
<tbody>
<tr>
<td>LAST 3 WEEK </td>
<?php
$OCCEquipLast3week = "select downtime.*,department.department_nameEN,equipment.equipment_nameEN,COUNT(downtime.department_id )as occurrence
,sum(corrective_time+cr_load_time)as totalDT,sum(cr_load_time+cra+crb+crc+crd+crj)as timecrusher
from downtime
left join department on downtime.department_id=department.department_id
left join equipment on downtime.equipment_id=equipment.equipment_id
where downtime.plan='Unplan' and downtime_date >=date_sub('$STRdatepicker2',interval 27 day)
and downtime_date <=date_sub('$STRdatepicker2',interval 21 day)
and downtime.department_id ='$_REQUEST[department_id]'
group by equipment.equipment_id ";
$resultOCCEquipLast3w=mysql_db_query($objDB,$OCCEquipLast3week);
while($objResultOCCEquipLast3week=mysql_fetch_array($resultOCCEquipLast3w)){
$_SESSION[totalDT_Last3week] =round($objResultOCCEquipLast3week[totalDT]/60,1);
$_SESSION[totalLoss_Last3week] =round($objResultOCCEquipLast3week[timecrusher]/60,1);
$_SESSION[occurrence_Last3week]=$objResultOCCEquipLast3week[occurrence];
$totalDT3=$objResultOCCEquipLast3week[totalDT];
$totalCR3=$objResultOCCEquipLast3week[timecrusher];
?>
<td class="text-right pr10"><?php echo $objResultOCCEquipLast3week[occurrence];?> (<?php echo $objResultOCCEquipLast3week[equipment_nameEN];?>)</td>
<?php }?>
</tr>
</tbody>
</table>
Tag : PHP, MySQL
|
|
|
|
|
|
Date :
2016-03-25 12:04:40 |
By :
bondsanti |
View :
704 |
Reply :
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
ถ้าช่องไหน ไม่มีข้อมูล ก็เว้นว่าง ครับผม
|
|
|
|
|
Date :
2016-03-25 12:06:56 |
By :
bondsanti |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
กรณีไม่มีข้อมูลให้ใส่ตัวนี้ครับ
|
|
|
|
|
Date :
2016-03-25 13:17:53 |
By :
mr.win |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Load balance : Server 01
|