<? include "connect.php"; $sql="SELECT ref_id_prd,name_prd,number,price FROM tb_product, tb_order_detail WHERE id_prd = ref_id_prd and ref_id_order='$id_order' "; $result=mysql_db_query($conn_db,$sql); while ($rs=mysql_fetch_array($result)) { $ref_id_prd=$rs[ref_id_prd]; $code=sprintf("%05d",$ref_id_prd); $name_prd=$rs[name_prd]; $number=$rs[number]; $price=$rs[price]; $total_unit=$number*$price; $total=$total+$total_unit; echo " <TR> <TD align=center class='style4'>$code</TD> <TD class='style4'> $name_prd</TD> <TD align=center class='style4'>$qua</TD> <TD align=center class='style4'>$price_prd</TD> <TD align=center class='style4'>$total_unit</TD> </TR> "; } ?>
<? session_start(); ?> <!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> <link rel="shortcut icon" type="image/x-icon" href="SpryAssets/img/pktriplogo1.png"/> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>ยินดีต้อนรับเข้าสู่ Pk-trip</title> <style type="text/css"> #apDiv1 { position: absolute; left: 22%; right: 50%; top: 34px; z-index: 1; } #apDiv4 { position: absolute; left: 150px; top: 640px; width: 90px; height: 26px; z-index: 3; } .fontbtotombar { font-size: 14px; color: #FFF; text-align: center; } #apDiv4 { position: absolute; left: 170px; top: 850px; width: 99px; height: 33px; z-index: 2; } #apDiv6 { position: absolute; left: 400px; top: 335px; width: 542px; height: 566px; z-index: 2; } </style> </head> <body> <div id="apDiv1"><? include"banner_admin.php" ?><br /> <? include "admin_menu.php" ?> <table width="920" bgcolor="#E6E6E6"> <tr> <td height="5" bgcolor="#000000"></td> </tr> <tr> <td height="88" ><center><img src="img/bg-register.png" width="860" height="678" /></center></td> </tr> </table> <div id="apDiv4"><? include"detail_bot_bar.php" ?></div> </div> <div id="apDiv6"> <font size="+3"><center> แสดงรายการใบสั่งซื้อ</center></font></br> <? $count=0; include"connect.php"; $strSQL = "SELECT * FROM tb_order "; $objQuery = mysql_query($strSQL) or die ("Error Query [".$strSQL."]"); $Num_Rows = mysql_num_rows($objQuery); $Per_Page =10; // Per Page $Page = $_GET["Page"]; if(!$_GET["Page"]) { $Page=1; } $Prev_Page = $Page-1; $Next_Page = $Page+1; $Page_Start = (($Per_Page*$Page)-$Per_Page); if($Num_Rows<=$Per_Page) { $Num_Pages =1; } else if(($Num_Rows % $Per_Page)==0) { $Num_Pages =($Num_Rows/$Per_Page) ; } else { $Num_Pages =($Num_Rows/$Per_Page)+1; $Num_Pages = (int)$Num_Pages; } $strSQL .=" order by id_order ASC LIMIT $Page_Start , $Per_Page"; $objQuery = mysql_query($strSQL); ?> </p> <table width="812" border="1" > <tr bgcolor="FF90ab"> <th width="35" height="40" > <div align="center">รหัส</div></th> <th width="110" height="30" > <div align="center">ชื่อ - สกุล</div></th> <th width="97" height="30" > <div align="center">เบอร์ติดต่อ</div></th> <th width="80" height="30" > <div align="center">ราคารวม</div></th> <th width="127" height="30" > <div align="center">วันที่สั่งซื้อ</div></th> <th width="127" height="30" > <div align="center">ดูรายละเอียด</div></th> <th width="100" height="30" > <div align="center">ลบ</div></th> </tr> <? while($objResult = mysql_fetch_array($objQuery)) { ?> <tr> <td height="30"><div align="center"><?=$objResult["id_order"]?></div></td> <td height="30" align="center"><?=$objResult["name_order"]?></td> <td height="30" align="center"><?=$objResult["tel_order"]?></td> <td height="30" align="center"><?=$objResult["total_order"]?></td> <td height="30" align="center"><?=$objResult["date_order"]?></td> <td><div align=center><a href=admin_order_view.php?id_order=<? echo $objResult[id_order];?> target=_blank><font size=2 face=Tahoma>รายละเอียด</font></a></div></td> <td><div align=center><a href=admin_order_delete.php?id_order=<? echo $objResult[id_order];?>" onclick="return confirm('แน่ใจหรือป่าว ที่จะลบ')">ลบ</a></div></td> </tr> <? $count++;} ?> </table> <br> Total <?= $Num_Rows;?> Record : <?=$Num_Pages;?> Page : <? if($Prev_Page) { echo " <a href='$_SERVER[SCRIPT_NAME]?Page=$Prev_Page'><< Back</a> "; } for($i=1; $i<=$Num_Pages; $i++){ if($i != $Page) { echo "[ <a href='$_SERVER[SCRIPT_NAME]?Page=$i'>$i</a> ]"; } else { echo "<b> $i </b>"; } } if($Page!=$Num_Pages) { echo " <a href ='$_SERVER[SCRIPT_NAME]?Page=$Next_Page'>Next>></a> "; } ?> </div> </body> </html>
SELECT id, last_name, first_name, d FROM person ORDER BY last_name, first_name;
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง