<? require_once("../Project1/Config.php"); $datetoday=date('Y-m-d'); mysql_select_db($db); $query_transportprice = "SELECT * FROM transportprice WHERE transportprice_date='2012-02-16'"; $transportprice = mysql_db_query($query_transportprice, $db) or die(mysql_error()); $row_transportprice = mysql_fetch_assoc($transportprice); $totalRows_transportprice = mysql_num_rows($transportprice); $transportprice_price=$row_transportprice['transportprice_price']; ?> <!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><? echo "$titles";?></title> </head> <body> <table width="730" border="0" cellpadding="0" cellspacing="0"> <tr> <td align="center">ตะกร้าสินค้า</td> </tr> <tr> <td align="center" valign="top"><table width="200" border="0" cellpadding="0" cellspacing="0"> <tr> <td height="5"></td> </tr> </table></td> </tr> <tr> <td align="center"><span class="redstar16"><strong><?php if(count($sess_id)==0) { echo "<br>** ยังไม่พบรายการสินค้าในตะกร้า **<br>"; }else{ ?> </strong></span> <form id="form1" name="form1" method="post" action="basket_cal.php"> <table width="720" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#000000"> <tr> <td height="30" colspan="6" align="left" bgcolor="#FFFFFF" class="black14"> <span class="black16text"><strong>รายการสั่งซื้อผลิตภัณฑ์</strong></span></td> </tr> <tr> <td width="48" height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>ลบ</strong></td> <td width="85" height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>รหัสผลิตภัณฑ์</strong></td> <td height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>ชื่อสินค้า</strong></td> <td width="59" height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>จำนวน</strong></td> <td width="70" height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>ราคา</strong></td> <td width="72" height="30" align="center" valign="middle" bgcolor="#999999" class="white13text"><strong>รวมเงิน</strong></td> </tr> <?php for($i=0;$i<count($sess_id);$i++) { $total_unit=$sess_num[$i] * $sess_price[$i]; $total=$total+$total_unit; $code=sprintf("%05d",$sess_id[$i]); mysql_select_db($db); $query_product = "SELECT * FROM tb_product WHERE id_prd='$sess_id[$i]' "; $product = mysql_query($query_product, $db) or die(mysql_error()); $row_product = mysql_fetch_assoc($product); $product_id =$row_product['id_prd']; ?> <tr> <td align="center" bgcolor="#FFFFFF"><input name="pro_del[]" type="checkbox" id="pro_del[]" value="<?php echo "$sess_id[$i]";?>" /></td> <td align="left" bgcolor="#FFFFFF" class="black14"><?php echo "$product_code";?></td> <td align="left" bgcolor="#FFFFFF"><span class="black14"><?php echo "$sess_name[$i]";?></span> <span class="red14"> </span><span class="gray12text">[สินค้าในคลังมี <? echo "$product_num";?> ชิ้น]</span></td> <td align="center" bgcolor="#FFFFFF"><input name="pro_num[]" type="text" id="pro_num[]" value="<?php echo "$sess_num[$i]";?>" size="5" /></td> <td align="center" bgcolor="#FFFFFF"><?php echo "$sess_price[$i]";?></td> <td align="right" bgcolor="#FFFFFF"><?php echo "$total_unit";?></td> </tr> <?php }?> <tr> <td colspan="5" align="right" valign="middle" bgcolor="#FFFFFF" class="black13text">รวมเป็นเงิน</td> <td height="40" align="right" valign="middle" bgcolor="#FFFFFF"><span class="black13text"> <?php $total2=number_format($total,2); echo "$total2"; ?> </span></td> </tr> <tr> <td colspan="5" align="right" valign="middle" bgcolor="#FFFFFF" class="black14"><strong>รวมเป็นเงินทั้งสิ้น</strong></td> <td height="40" align="right" valign="middle" bgcolor="#CCCCCC"><strong> <?php $total=($total-$discounts)+$transfer; $total=number_format($total,2); echo "$total"; ?> </strong></td> </tr> </table> <table width="720" border="0" align="center" cellpadding="3" cellspacing="0"> <tr> <td width="55" align="center"> </td> <td width="342" align="center"> </td> <td width="105" align="center"><span class="black14"> <input name="buypro" type="submit" id="buypro" value="ซื้อสินค้าเพิ่ม" /> </span></td> <td width="95" align="center" class="black14"><input name="calculate" type="submit" id="calculate" value="คำนวณใหม่" /></td> <td width="93" align="center"><input name="complete" type="submit" id="complete" value="สั่งซื้อสินค้า" /></td> </tr> </table> </form> <?php } ?></td> </tr> </table> </body> </html>
mysql_select_db($db) or die(mysql_error());
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง