<?php $sql_show = "select * FROM customer"; if($_POST['date_start']) { $date_start = $_POST['date_start']; $date_stop = $_POST['date_stop']; $sql_show .=" WHERE (reservation_date between '".$_POST['date_start']."' AND '".$_POST['date_stop']."') ORDER BY reservation_date ASC"; } $result_show = mysql_query($sql_show) or die(mysql_error()); $chk_date = false; $chk_sum = 0; $total = 0; while($rs = mysql_fetch_array($result_show)) { $id = $rs["id"]; $reservation_date = $rs["reservation_date"]; $date = ''; $chk_total = ''; if ($chk_date <> $reservation_date) { $date = $reservation_date; if ($chk_date <> false) { $chk_total = '<div class="total">'.number_format($chk_sum).'</div>'; } $chk_sum = 0; } $edit_class = (trim($remark) == '') ? '' : ' hide'; $tr_class = ''; if ($level == '2') { $tr_class = ' class="tr2"'; } else if ($level2 == '3') { $tr_class = ' class="tr3"'; } echo '<tr align="center"'.$tr_class.'>'; ?> <?php echo '<td height="42">'.$date.'</td>';?> <td><?php echo $rs["fleet"];?></td> <td><?php echo $rs["destination"];?></td> <td><?php echo $rs["guest_name"];?></td> <td><?php echo $rs["amount"];?></td> <td><? $Labour = ($rs['amount']*15)/100; ?> <? echo $Labour; ?></td> <td><strong><div class="<?php echo $rs["status"];?>"><p class="ex"><?php echo $rs["status"];?></p></div></strong></td> <td><?php echo $remark;?></td> <td> <?php if($rs["schedule1"] == "" or $rs["schedule2"] == ""){ // ถ้า schedule1 หรือ schedule2 ไม่มีค่า echo $rs["schedule1"].$rs["schedule2"]; }else{ echo $rs["schedule1"]."<hr>".$rs["schedule2"]; } ?> </td> <td bgcolor="#999999"> <div class="text-center<?php echo $edit_class;?>"> <a href="edit.php?edit_id=<?php echo $id;?>">EDIT</a> </div> </td> <?php echo '</tr>'; $chk_date = $reservation_date; } ?> <tr class="tr-last"> <td height="36"></td> <td></td> <td></td> <td align="right">Total :</td> <td align="center"><?php $query = "SELECT SUM(amount) as s_Total FROM customer where reservation_date between '".$_POST['date_start']."' and '".$_POST['date_stop']."' GROUP BY reservation_date between '".$_POST['date_start']."' and '".$_POST['date_stop']."'"; $result = mysql_query($query) or die(mysql_error()); while($row = mysql_fetch_array($result)){ echo number_format($row['s_Total']); }?></td> <td></td> <td></td> <td></td> <td></td> <td></td> </table>
<?php $sql_show = "select * FROM customer"; if($_POST['date_start']) { $date_start = $_POST['date_start']; $date_stop = $_POST['date_stop']; $sql_show .=" WHERE (reservation_date between '".$_POST['date_start']."' AND '".$_POST['date_stop']."') ORDER BY reservation_date ASC"; } $result_show = mysql_query($sql_show) or die(mysql_error()); $chk_date = false; $chk_sum = 0; $total = 0; $total2 = 0; while($rs = mysql_fetch_array($result_show)) { $id = $rs['id']; $reservation_date = $rs['reservation_date']; $date = ''; $chk_total = ''; if ($chk_date <> $reservation_date) { $date = $reservation_date; if ($chk_date <> false) { $chk_total = '<div class="total">'.number_format($chk_sum).'</div>'; } $chk_sum = 0; } $edit_class = (trim($remark) == '') ? '' : ' hide'; $tr_class = ''; if ($level == '2') { $tr_class = ' class="tr2"'; } else if ($level2 == '3') { $tr_class = ' class="tr3"'; } echo '<tr align="center"'.$tr_class.'>'; $amount = $rs['amount']; $total += $amount; $Labour = ($amount * 15) / 100; $total2 += $Labour; ?> <?php echo '<td height="42">'.$date.'</td>';?> <td><?php echo $rs['fleet'];?></td> <td><?php echo $rs['destination'];?></td> <td><?php echo $rs['guest_name'];?></td> <td><?php echo number_format($amount);?></td> <td><?php echo number_format($Labour);?></td> <td><strong><div class="<?php echo $rs['status'];?>"><p class="ex"><?php echo $rs['status'];?></p></div></strong></td> <td><?php echo $remark;?></td> <td> <?php if($rs["schedule1"] == "" or $rs["schedule2"] == ""){ // ถ้า schedule1 หรือ schedule2 ไม่มีค่า echo $rs["schedule1"].$rs["schedule2"]; }else{ echo $rs["schedule1"]."<hr>".$rs["schedule2"]; } ?> </td> <td bgcolor="#999999"> <div class="text-center<?php echo $edit_class;?>"> <a href="edit.php?edit_id=<?php echo $id;?>">EDIT</a> </div> </td> <?php echo '</tr>'; $chk_date = $reservation_date; } ?> <tr class="tr-last"> <td height="36"></td> <td></td> <td></td> <td align="right">Total :</td> <td align="center"><?php echo number_format($total);?></td> <td align="center"><?php echo number_format($total2);?></td> <td></td> <td></td> <td></td> <td></td> </table>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง