<?php session_start() ; include("../../lib/connect_scholar.php"); ?> <table width="650" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="650"> </td> </tr> <tr> <td width="650" align="left"><img src="../image/bas.gif" alt="สินค้าในตะกร้าของคุณ" width="300" height="35" /></td> </tr> <tr> <td width="650"> </td> </tr> <tr> <td width="650" align="center"><? $sess_id =$_SESSION['sess_id']; $sess_name =$_SESSION['sess_name']; $sess_price =$_SESSION['sess_price']; $sess_num =$_SESSION['sess_num']; if(count($sess_id)==0) { echo "ยังไม่มีสินค้าอยู่ในตระกร้าค่ะ";} else { ?> <form id="form1" name="form1" method="post" action="basket_cal.php"> <table width="650" border="0" cellspacing="0" cellpadding="0"> <tr> <td width="650"><table width="650" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td width="30" height="30" align="center" bgcolor="#C0EFFF" class="normal"><strong>ลบ</strong></td> <td width="368" height="30" align="center" bgcolor="#C0EFFF" class="normal"><strong>ชื่อสินค้า</strong></td> <td width="60" height="30" align="center" bgcolor="#C0EFFF" class="normal"><strong>จำนวน</strong></td> <td width="60" height="30" align="center" bgcolor="#C0EFFF" class="normal"><strong>ราคา</strong></td> <td width="120" height="30" align="center" bgcolor="#C0EFFF" class="normal"><strong>รวม</strong></td> </tr> <? for($i=0;$i<count($sess_id);$i++) { $color = ($color=="#ffffff")?"#DBDBDB" : "#ffffff"; $total_unit = $sess_num[$i]*$sess_price[$i]; $total = $total+$total_unit; ?> <tr bgcolor="<?=$color ?>"> <td width="30" height="40" align="center" valign="middle"><input type="checkbox" name="prd_del[]" value="<?=$sess_id[$i]?>" /></td> <td width="368" height="40" align="left" valign="middle" class="normal"><?=$sess_name[$i]?></td> <td width="60" height="40" align="center" valign="middle"><input name="prd_num[]" type="text" class="normal" value="<?=$sess_num[$i]?> " size="7" /></td> <td width="60" height="40" align="center" valign="middle" class="normal"><?=$sess_price[$i]?></td> <td width="120" height="40" align="center" valign="middle" class="normal"><?=$total_unit?></td> </tr> <? } ?> </table></td> </tr> <tr> <td width="650" align="right"><table width="650" height="20" border="1" cellpadding="0" cellspacing="0" bordercolor="#FFFFFF"> <tr> <td width="524" height="30" align="right" valign="middle" bgcolor="#C0EFFF" class="red"><span class="normal"><strong>จำนวนเงินทั้งหมด</strong></span></td> <td width="120" height="30" align="center" class="red"><strong> <?=$total?> </strong></td> </tr> </table></td> </tr> <tr> <td width="650" align="right" valign="middle"> </td> </tr> <tr> <td width="650" align="right" valign="middle"><table width="194" cellspacing="0" cellpadding="0"> <tr> <td width="99" align="center"><input name="calculate" type="submit" class="normal" value="คำนวนใหม่" /></td> <td width="93" align="center"><input name="complete" type="submit" class="normal" value="สั่งซื้อสินค้า" /></td> </tr> </table></td> </tr> </table> </form> <? } ?> </td> </tr> <tr> <td width="650"> </td> </tr> <tr> <td width="650"> </td> </tr> </table>
<?php session_start() ; include("../../lib/connect_scholar.php"); ?> <!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=windows-874" /> <title>Untitled Document</title> </head> <body> <? $id_prd = $_GET['id_prd']; $id_type = $_GET['id_type']; $id_prd_select = $_GET['id_prd']; $_SESSION['sess_id'] =$sess_id; $_SESSION['sess_name'] =$sess_name; $_SESSION['sess_price'] =$sess_price; $_SESSION['sess_num'] =$sess_num; if(count($sess_id)=="0"){$check=1;} else if (!in_array($id_prd,$sess_id)) {$check=1;} if($check==1) { $sql = "select * from tb_product where id_prd = '$id_prd'"; $result = mysql_query($sql); $rs = mysql_fetch_array($result); $sess_id[ ] = $rs['id_prd']; $sess_name[ ] = $rs['name_prd']; $sess_price[ ] = $rs['price_prd']; $sess_num[ ] = 1; } echo "<script>alert('เพิ่มสินค้าลงในตระกร้าเรียบร้อยแล้วค่ะ');window.location='basket.php';</script>"; ?> </body> </html>
<? session_start(); $sess_id =$_SESSION['sess_id']; $sess_name =$_SESSION['sess_name']; $sess_price =$_SESSION['sess_price']; $sess_num =$_SESSION['sess_num']; $calculate = $_POST['calculate']; $complete = $_POST['complete']; if (count ($prd_del)==0){$prd_del = array();} for($i=0;$i<count($sess_id);$i++) { if(!in_array($sess_id[$i],$prd_del)) { $temp_id[] = $sess_id[$i]; $temp_name[] = $sess_name[$i]; $temp_price[] = $sess_price[$i]; $temp_num[] = $prd_num[$i]; } } $sess_id = $temp_id; $sess_name = $temp_name; $sess_price = $temp_price; $sess_num = $temp_num; if($calculate) {echo "<script>alert('ระบบได้คำนวนใหม่เรียบร้อยแล้วค่ะ');window.location='basket.php';</script>";}else if($complete) {echo "<script>window.location='prd_order.php';</script>";} ?> <!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=windows-874" /> <title>Untitled Document</title> </head> <body> </body> </html>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง