<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>รายงานสรุปยอดการจองตั๋วรถโดยสาร</title> </head> <body> <table align="center" border="0" cellpadding="0" cellspacing="0"> <tr> <td><img src="image/Band.jpg" width="900" height="190" /></td> </tr> <tr> <td bgcolor="#FFCCFF"> <?php include "menuadd.html"; ?> </td> </td> <tr> <td bgcolor="#FFCCFF"> <?php $Province=$_POST['Province']; $Province2=$_POST['Province2']; $Day=$_POST["sYear"] . '-' . $_POST["sMonth"] . '-' . $_POST["sDay"]; $Status="ชำระค่าบริการ"; include "connect.php"; $selectdb=mysql_select_db($dbname) or die("connection Error"); mysql_query("SET NAMES UTF8"); $Sql="SELECT way.Start, way.Finish, way.Date,way.Service, orders.Name, orders.Orders_Teenang, orders.Status FROM way INNER JOIN orders ON way.id_way=orders.id_way WHERE Start = '$Province' AND Finish = '$Province2' AND Date = '$Day' AND Status='$Status'" ; $objQuery=mysql_query($Sql) or die ("Error Query [".$Sql."]"); ?> <table align="center" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFF33"> <tr> <th bgcolor="#ffa07a">ชื่อ-นามสกุล</th> <th bgcolor="#ffa07a">จังหวัดต้นทาง</th> <th bgcolor="#ffa07a">จังหวัดปลายทาง</th> <th bgcolor="#ffa07a">วันออกเดินทาง</th> <th bgcolor="#ffa07a">ที่นั่ง</th> <th bgcolor="#ffa07a">ผู้ให้บริการ</th> <th bgcolor="#ffa07a">สถานะการชำระเงิน</th> </tr> <?php $yes="ชำระค่าบริการ"; while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Name" value="<?=$objResult['Name'];?>"><?=$objResult['Name'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Start" value="<?=$objResult['Start'];?>"><?=$objResult['Start'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Finish" value="<?=$objResult['Finish'];?>"><?=$objResult['Finish'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Date" value="<?=$objResult['Date'];?>"><?=$objResult['Date'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Teenang" value="<?=$objResult['Orders_Teenang'];?>"><?=$objResult['Orders_Teenang'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Service" value="<?=$objResult['Service'];?>"><?=$objResult['Service'];?> </td> <td bgcolor="#e0ffff " align="center"><input type="hidden" name="Status" value="<?=$objResult['Status'];?>"><? if($objResult['Status']==$yes){echo "<font color=\"green\">ชำระค่าบริการ";} else{echo "<font color=\"red\">ค้างชำระค่าบริการ";};?> </td> </tr> <?php } ?> <tr> <?php $wantee="SELECT * FROM way WHERE Date='$Day'"; $objQuery=mysql_query($wantee) or die ("Error Query [".$wantee."]"); while($objResult = mysql_fetch_array($objQuery)){ ?> <td colspan="5" align="right">สรุปยอดประจำวันที่::<?=$objResult['Date'];?></td> <?php } ?> <? $kidtang="SELECT SUM(Price) AS Total FROM Orders WHERE Status='ชำระค่าบริการ'"; $objQuery=mysql_query($kidtang) or die ("Error Query [".$kidtang."]"); while($objResult = mysql_fetch_array($objQuery)) { ?> <td colspan="2">เป็นเงินทั้งสิ้น::<?=$objResult['Total'];?> บาท <?php } ?> </td> </tr> </table> </td> </tr> </table> </body> </html>
$num = mysql_num_rows($objQuery); // นับ record if($num > 0){ //ให้แสดงข้อมูลออกมา while($objResult = mysql_fetch_array($objQuery)) { echo "เป็นเงินทั้งสิ้น ".$objResult['Total']." บาท "; } }else{ echo " บ่มีข้อมูลใน database นะ "; }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง