include"register_globals.php"; print_r($_POST); $checkitem = isset($_REQUEST['checkitem']) ? $_REQUEST['checkitem'] : ''; if (count($prd_del)==0) { $prd_del=array(); } if ($checkitem==1 ) { 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[]=$sess_num[$i]; $temp_pricephone[]=$sess_pricephone[$i]; $temp_discount[]=$sess_discount[$i]; } } } #Menu remove elseif($checkitem==0){ 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]; $temp_pricephone[]=$sess_pricephone[$i]; $temp_discount[]=$sess_discount[$i]; } } } $sess_id=$temp_id; $sess_name=$temp_name; $sess_price=$temp_price; $_SESSION["sess_num"] =$temp_num; $sess_pricephone=$temp_pricephone; $sess_discount=$temp_discount; echo "<html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> </head> <body> <meta http-equiv='refresh' content='0; Url=index.php?action=basket'> </body> </html>";
$Line = $_GET["Line"]; $_SESSION["strProductID"][$Line] = ""; $_SESSION["strQty"][$Line] = "";
<?php #session_start(); #$amphur=$_GET["amphur"]; #print_r($_REQUEST); include"register_globals.php"; if ($_SESSION["userid"]==""){ ?> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <script language="javascript"> alert("คุณต้องเข้าสู่ระบบก่อนค่ะ!!"); window.location='index.php'; </script> <?php exit(); } $id_prd = isset($_REQUEST['id_prd']) ? $_REQUEST['id_prd'] : ''; $checkitem = isset($_REQUEST['checkitem']) ? $_REQUEST['checkitem'] : ''; ?> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> <title>Basket</title> <script type="text/javascript"> function doCalculate() { document.form1.action ="basket_cal.php?checkitem=0"; document.form1.submit(); } function doOrder() { document.form1.action ="prd_order.php"; document.form1.submit(); } function doOrderAdd() { document.form1.action ="index.php?action=list_product"; document.form1.submit(); } </script> </head> <body> <?php if (count($sess_id)==0) { echo "<font face=\"Tahoma\" size=\"2\" color='#FF0000'>ยังไม่มีสินค้าอยู่ในตะกร้าค่ะ </font>"; } else { ?> <form method="post" name="form1" > <table width="100%" class="table_type_1 responsive_table full_width t_align_l r_corners wraper shadow bg_light_color_1 m_bottom_30"> <thead> <tr class="f_size_large"> <!--titles for td--> <th width="10%" align="center">รหัสสินค้า</th> <th width="40%">ชื่อสินค้า</th> <th width="10%" align="center">ราคา (บาท)</th> <th width="10%" align="center">ส่วนลด</th> <th width="10%" align="center">ราคารวม</th> <th width="10%">จำนวน (ชิ้น)</th> <th width="10%" align="center">ลบ</th> </tr> </thead> <tbody> <?php $total_unit = isset($_REQUEST['total_unit']) ? $_REQUEST['total_unit'] : ''; $total = isset($_REQUEST['total']) ? $_REQUEST['total'] : ''; $vat2 = isset($_REQUEST['vat2']) ? $_REQUEST['vat2'] : ''; $total2 = isset($_REQUEST['total2']) ? $_REQUEST['total2'] : ''; for ($i=0;$i<count($tmp_sess_id);$i++) { $total_unit=$tmp_sess_num[$i]*$tmp_sess_price[$i]; $total=$total+$total_unit; $vat2=floor($total*(7/100)); $total2=$total+$vat2; echo "TT::".$total_unit; print_r($tmp_sess_id); ?> <tr> <!--product image--> <td width="10%" align="center"> <?=$tmp_sess_id[$i]?> </td> <!--product name and category--> <td data-title="Product Name" width="30%"> <center><a href="#" ><?=$tmp_sess_name[$i]?></a></center> </td> <!--product price--> <td width="10%" > <? //number_format($tmp_sess_price[$i])?> <center><span class="scheme_color fw_medium f_size_large"><?=number_format($tmp_sess_price[$i])?></span></center> </td> <!--product discount--> <td width="10%" > <center><span class="scheme_color fw_medium f_size_large"><?=$tmp_sess_discount[$i]?>%</span></center> </td> <!--product amount--> <td width="10%" > <center><span class="scheme_color fw_medium f_size_large"><?=number_format($total_unit)?></span></center> </td> <!--quanity--> <td width="10%" > <center><input type="number" name="prd_num[]" value="<?=$tmp_sess_num[$i]?>" ></center> </td> <!--add or remove buttons-- basket_cal.php?prd_del[]=<?#$sess_id[$i]?>&CheckItem=1 --> <td width="10%" data-title="Action"> <center> <a href="basket_cal.php?prd_del[]=<?=$sess_id[$i]?>&checkitem=1" class="color_dark" > <!--<a href="basket_del.php?line=<?#$tmp_sess_id[$i]?>" class="color_dark" > --> <i ></i> ลบ</a></center> </td> </tr> <?php } ?> <tr> <td colspan="6" align="right"> <p class="fw_medium f_size_large t_align_r t_xs_align_c">รวมเป็นเงิน: </p> </td> <td colspan="1" align="center"> <p class="fw_medium f_size_large color_dark"><?=number_format($total)?></p> </td> </tr> <td colspan="6" align="right"> <p class="fw_medium f_size_large t_align_r t_xs_align_c">ภาษีมูลค่าเพิ่ม (7%):</p> </td> <td colspan="1" align="center"> <p class="fw_medium f_size_large color_dark"><?=number_format($vat2)?></p> </td> </tr> <td colspan="6" align="right"> <p class="fw_medium f_size_large t_align_r t_xs_align_c">ยอดเงินที่ต้องชำระ:</p> </td> <td colspan="1" align="center"> <p class="fw_medium f_size_large color_dark"><?=number_format($total2)?></p> </td> </tr> <td colspan="7"> <div align="right"> <button class="tr_delay_hover r_corners button_type_15 bg_dark_color bg_cs_hover color_light" onClick="doOrderAdd();">สั่งสินค้าเพิ่ม</button> <button class="tr_delay_hover r_corners button_type_15 bg_dark_color bg_cs_hover color_light" onClick="doCalculate();">คำนวณใหม่</button> <button class="tr_delay_hover r_corners button_type_15 bg_dark_color bg_cs_hover color_light" onClick="doOrder();">สั่งซื้อสินค้า</button> </div> </td> </tr> </p> <?php } ?> </tbody> </table> </form> </body> </html>
<?php session_start(); include"register_globals.php"; print_r($_REQUEST); print_r($_POST); #$checkitem=$_REQUEST["checkitem"]; $checkitem = isset($_REQUEST['checkitem']) ? $_REQUEST['checkitem'] : ''; #$prd_del = isset($_REQUEST['prd_del']) ? $_REQUEST['prd_del'] : ''; if (count($prd_del)==0) { $prd_del=array(); } if ($checkitem==1 ) { if(($key = array_search($tmp_sess_id,$prd_del))) { unset($tmp_sess_id[$key]); } 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[]=$sess_num[$i]; $temp_pricephone[]=$sess_pricephone[$i]; $temp_discount[]=$sess_discount[$i]; } } } #Menu remove elseif($checkitem==0){ 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]; $temp_pricephone[]=$sess_pricephone[$i]; $temp_discount[]=$sess_discount[$i]; } } } $sess_id=$temp_id; $sess_name=$temp_name; $sess_price=$temp_price; $_SESSION["sess_num"] =$temp_num; $sess_pricephone=$temp_pricephone; $sess_discount=$temp_discount; #$amphur=$_POST["amphur"]; #header("Location: basket.php?amphur=$amphur"); echo "SS::".$sess_id; echo "<html> <head> <meta http-equiv='Content-Type' content='text/html; charset=utf-8'> </head> <body> <meta http-equiv='refresh' content='0; Url=index.php?action=basket'> </body> </html>"; ?>
เพื่อความปลอดภัยของเว็บบอร์ด ไม่อนุญาติให้แทรก แท็ก [img]....[/img] โดยการอัพโหลดไฟล์รูปจากที่อื่น เช่นเว็บไซต์ ฟรีอัพโหลดต่าง ๆ อัพโหลดแทรกรูปภาพ ให้ใช้บริการอัพโหลดไฟล์ของไทยครีเอท และตัดรูปภาพให้พอดีกับสกรีน เพื่อความโหลดเร็วและไฟล์ไม่ถูกลบทิ้ง