<? header("Content-Type: text/plain; charset=TIS-620"); session_start(); print"<form id='form1' name='form1' method='post' action='maildetail.php' >"; include ("config.inc.php"); $sessionID= session_id(); $addProductID=$_GET['productID']; $sql = "select ID from basket where productID=$addProductID and sessionID='$sessionID'"; $result = mysql_query($sql); if(mysql_num_rows($result)==0){ $sql = "insert into basket (sessionID,productID,quantity) values('$sessionID',$addProductID,1)"; }else{ $sql = "update basket set quantity=quantity+1 where productID=$addProductID and sessionID='$sessionID'"; } mysql_query($sql); $sql = "select productID,name,price,quantity from basket,product where basket.productID=product.ID and sessionID='$sessionID'"; $result = mysql_query($sql); $totalPrice=0; print"<table>"; while($row=mysql_fetch_array($result)){ $addProductID = $row["productID"]; $productName = $row["name"]; $productPrice = $row["price"]; $quantity = $row["quantity"]; print "<tr bgcolor='#C0C0C0'>"; print "<td>$productName</td><td>$productPrice บ.</td>"; print "<td>$quantity เล่ม</td>"; print "<td align='right'>".($productPrice*$quantity)." บ.</td>"; print "<td><a href='#' onclick='removeBasket($addProductID, orders)'><img src='image/remove.gif' border=0></a></td>"; print "</tr>"; print "<tr><td colspan=6> </td></tr>"; $totalPrice = $totalPrice + ($productPrice*$quantity); } print "<tr>"; print "<td colspan=3 align='right'><b>รวมเป็นเงิน $totalPrice บ.</b></td></tr>"; print "</table>"; print"<table width='400' border='0'>"; print"<tr>"; print"<td width='200'>ชื่อผู้สั่งซื้อ :</td>"; print"<td width='260'><input name='namebuyer' type='text' id='namebuyer'/></td>"; print"</tr> <tr> <td>ที่อยู่ในการส่งสินค้า:</td> <td><label> <textarea name='addressbuyer' id='addressbuyer' cols='25' rows='10'></textarea> </label></td> </tr> <tr> <td>อีเมลหรือเบอร์โทรผู้ซื้อ:</td> <td><input name='contactbuyer' type='text' id='contactbuyer' size='20' /></td> </tr> <tr> <td></td> <td><input type='submit' name='button' id='button' value='ส่งอีเมลยังผู้ขาย' /></td> </tr> </table> </form>"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง