<? ob_start(); //============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล session_start(); require("connect/connect.php"); require("connect/function.php"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body topmargin="0" background="web_img/bg.jpg"> <table width="1007" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000" bordercolor="#000000"> <tr> <td width="1005" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><?php require_once('head.php'); ?></td> </tr> <tr> <td><table width="100%"cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <td width="23%" valign="top"> <?php require_once('menuleft.php'); ?></td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td height="26" colspan="10"align="left" valign="bottom"><img src="web_img/linehead.png" width="769" height="20"></td> </tr> <tr> <td height="310" align="center" valign="top"><table width="100%" > <tr> <td align="center" bgcolor="#FFCC99"><b>รายการสั่งซื้อ</b></td> </tr> </table> <table width="100%" align="center"> <tr> <td colspan="2"><form method="post"> <input type="text" name="txtorder_id" id="txtorder_id" value="<?php echo $objResult["order_id"];?>"> <input type="submit" name="button" id="button" value="Submit"> </form> <? $strSQL = "SELECT * FROM tbl_order WHERE (order_id LIKE '%".$_POST["order_id"]."%'"; $objQuery = mysql_query($strSQL) or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); ?> </td></tr> <tr> <td width="10"> </td> <td colspan="2" rowspan="3"> <form><fieldset> <table width="100%" > <tr> <td width="90" valign="top">ใบสั่งซื้อเลขที่ <br>วันที่สั่งซื้อ<br> ชื่อผู้สั่งซื้อ<br> ที่อยู่ <br> เบอร์โทรศัพท์ <br> Email <br> สถานะ</td> <td width="3" valign="top">:<br>:<br>:<br>:<br>:<br>:<br> :</td> <td width="641" colspan="4" valign="top"> <label><?php echo $objResult["order_id"];?></label> <br> <label><?php echo $objResult["order_date"];?></label> <br> <label><?php echo $objResult["order_name"];?></label> <br> <label><?php echo $objResult["order_address"];?></label> <br> <label><?php echo $objResult["order_phone"];?></label> <br> <label><?php echo $objResult["order_email"];?></label> <br> <label><?php echo $objResult["order_status"];?></label> </td> </tr> <tr> <td colspan="6"> <hr> <table width="100%"> <tr bgcolor="#CCCCCC"> <td width="73%"> <b>รายการสินค้าที่สั่งซื้อ</b></td> <td width="10%" align="center"><b>ราคา<b></td> <td width="8%" align="center"><b>จำนวน</b></td> <td width="9%" align="center"><b>รวม</b></td> </tr> <?php $Total = 0; $SumTotal = 0; $strSQL2 = "SELECT * FROM order_detail WHERE (order_id LIKE '%".$_POST["order_id"]."%'"; $objQuery2 = mysql_query($strSQL2) or die(mysql_error()); while($objResult2 = mysql_fetch_array($objQuery2)) { $strSQL3 = "SELECT * FROM tbl_product WHERE product_id = '".$objResult2["product_id"]."' "; $objQuery3 = mysql_query($strSQL3) or die(mysql_error()); $objResult3 = mysql_fetch_array($objQuery3); $Total = $objResult2["Qty"] * $objResult3["product_price"]; $SumTotal = $SumTotal + $Total; ?> <tr bgcolor="#E5E5E5"> <td> - <?php echo $objResult3["product_name"];?> </td> <td align="center"><?php echo $objResult3["product_price"];?></td> <td align="center"><?php echo $objResult2["Qty"];?></td> <td align="center"><?php echo number_format($Total,2);?></td> </tr> <?php } ?> <tr> <td colspan="4"> <b>จำนวนเงินที่ต้องชำระ <?php echo number_format($SumTotal,2);?> บาท</b></td> </tr> </table></td> </tr> </table> </fieldset></form></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <tr> <td width="751" height="118" align="left"><!--DWLayoutEmptyCell--> </td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="48" colspan="2" valign="top"> <?php require_once('down.php'); ?> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <?php mysql_close(); ?> </body> </html>
<? ob_start(); //============ Start Session และทำการเรียก Function ติดต่อฐานข้อมูล session_start(); require("connect/connect.php"); require("connect/function.php"); ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title></title> <link href="css/styles.css" rel="stylesheet" type="text/css"> </head> <body topmargin="0" background="web_img/bg.jpg"> <table width="1007" align="center" cellpadding="0" cellspacing="0" bgcolor="#000000" bordercolor="#000000"> <tr> <td width="1005" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <tr> <td><?php require_once('head.php'); ?></td> </tr> <tr> <td><table width="100%"cellpadding="0" cellspacing="0" bordercolor="#000000"> <tr> <td width="23%" valign="top"> <?php require_once('menuleft.php'); ?></td> <td valign="top"> <table width="100%" border="0" cellpadding="0" cellspacing="0"> <!--DWLayoutTable--> <tr> <td height="26" colspan="10"align="left" valign="bottom"><img src="web_img/linehead.png" width="769" height="20"></td> </tr> <tr> <td height="310" align="center" valign="top"><table width="100%" > <tr> <td align="center" bgcolor="#FFCC99"><b>รายการสั่งซื้อ</b></td> </tr> </table> <table width="100%" align="center"> <tr> <td colspan="2"><form method="post"> <input type="text" name="txtorder_id" id="txtorder_id" value="<?php echo $objResult["order_id"];?>"> <input type="submit" name="button" id="button" value="Submit"> </form> <? $strSQL = "SELECT * FROM tbl_order WHERE (order_id LIKE '%".$_POST["order_id"]."%'"; $objQuery = mysql_query($strSQL) or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); ?> </td></tr> <tr> <td width="10"> </td> <td colspan="2" rowspan="3"> <form><fieldset> <table width="100%" > <tr> <td width="90" valign="top">ใบสั่งซื้อเลขที่ <br>วันที่สั่งซื้อ<br> ชื่อผู้สั่งซื้อ<br> ที่อยู่ <br> เบอร์โทรศัพท์ <br> Email <br> สถานะ</td> <td width="3" valign="top">:<br>:<br>:<br>:<br>:<br>:<br> :</td> <td width="641" colspan="4" valign="top"> <label><?php echo $objResult["order_id"];?></label> <br> <label><?php echo $objResult["order_date"];?></label> <br> <label><?php echo $objResult["order_name"];?></label> <br> <label><?php echo $objResult["order_address"];?></label> <br> <label><?php echo $objResult["order_phone"];?></label> <br> <label><?php echo $objResult["order_email"];?></label> <br> <label><?php echo $objResult["order_status"];?></label> </td> </tr> <tr> <td colspan="6"> <hr> <table width="100%"> <tr bgcolor="#CCCCCC"> <td width="73%"> <b>รายการสินค้าที่สั่งซื้อ</b></td> <td width="10%" align="center"><b>ราคา<b></td> <td width="8%" align="center"><b>จำนวน</b></td> <td width="9%" align="center"><b>รวม</b></td> </tr> <?php $Total = 0; $SumTotal = 0; $strSQL2 = "SELECT * FROM order_detail WHERE (order_id LIKE '%".$_POST["order_id"]."%'"; $objQuery2 = mysql_query($strSQL2) or die(mysql_error()); while($objResult2 = mysql_fetch_array($objQuery2)) { include ('connect/connect.php'); $strSQL3 = "SELECT * FROM tbl_product WHERE product_id = '".$objResult2["product_id"]."' "; $objQuery3 = mysql_query($strSQL3) or die(mysql_error()); $objResult3 = mysql_fetch_array($objQuery3); $Total = $objResult2["Qty"] * $objResult3["product_price"]; $SumTotal = $SumTotal + $Total; ?> <tr bgcolor="#E5E5E5"> <td> - <?php echo $objResult3["product_name"];?> </td> <td align="center"><?php echo $objResult3["product_price"];?></td> <td align="center"><?php echo $objResult2["Qty"];?></td> <td align="center"><?php echo number_format($Total,2);?></td> </tr> <?php } ?> <tr> <td colspan="4"> <b>จำนวนเงินที่ต้องชำระ <?php echo number_format($SumTotal,2);?> บาท</b></td> </tr> </table></td> </tr> </table> </fieldset></form></td> </tr> <tr> <td> </td> </tr> <tr> <td> </td> </tr> </table> <tr> <td width="751" height="118" align="left"><!--DWLayoutEmptyCell--> </td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td height="48" colspan="2" valign="top"> <?php require_once('down.php'); ?> </td> </tr> </table></td> </tr> </table></td> </tr> </table> <?php mysql_close(); ?> </body> </html>
044 <input type="text" name="txtorder_id" id="txtorder_id" value="<?php echo $objResult["order_id"];?>"> แก้ // txtorder_id <input type="text" name="txtorder_id" id="txtorder_id" value=""> // แก้ code mysql if(isset($_POST["button"]) { $strSQL = "SELECT * FROM tbl_order WHERE (order_id LIKE '%".$_POST["txtorder_id"]."%'"; $objQuery = mysql_query($strSQL) or die(mysql_error()); $objResult = mysql_fetch_array($objQuery); }
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง