?
Path : /home/admin/domains/happytokorea.com/public_html_bk/gall/ |
Current File : /home/admin/domains/happytokorea.com/public_html_bk/gall/checkout.php |
<? include("template/header.php");?> <? if(!isset($_SESSION[u_id])){ echo "<script>window.location.href='login.php';</script>"; die(); } ?> <? if(isset($_POST[cart_id])){ for($i=0;$i<count($_POST[cart_id]);$i++){ $db->query("update cart set cart_status=1,cart_order = ".$_POST[cart_order]." where cart_id = ".$_POST[cart_id][$i]); } echo "<script>alert('Check Out Your cart');window.location.href='main.php';</script>"; } ?> <form action="" method="post"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="pageHeading">ยืนยันการสั่งซื้อ</td> <td class="pageHeading" align="right"> </td> </tr> </table></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td class="otherpages"> <table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="1" cellpadding="2" class="infoBox"> <tr class="infoBoxContents"> <td width="30%" valign="top"> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"><b>การสั่งซื้อ : <? $t = time(); echo $t; ?></b> <input name="cart_order" type="hidden" value="<? echo $t;?>"> </td> </tr> <tr> <? $acc = $db->queryUniqueObject("select * from user where u_id = ".$_SESSION[u_id]); ?> <td class="main"><b>ที่อยู่จัดส่ง</b> <a href="account_edit.php"><span class="orderEdit">(แก้ไข)</span></a></td> </tr> <tr> <td class="main"><? echo $acc->firstname." ".$acc->lastname?><br> email_address : <? echo $acc->email_address;?><br> ที่อยู่ : <? echo $acc->street_address;?><br> ที่อยู่2 : <? echo $acc->suburb;?><br> รหัสไปรษณีย์ : <? echo $acc->postcode;?><br> เขต : <? echo $acc->city;?><br> จังหวัด : <? echo $acc->state;?><br> ประเทศ : <? echo $acc->country;?><br> โทรศัพท์ : <? echo $acc->telephone;?> </td> </tr> </table> </td> <td width="70%" valign="top"><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td> <table border="0" width="100%" cellspacing="0" cellpadding="2"> <tr> <td class="main"> </td> </tr> <tr> <td class="main" colspan="4"><b>สินค้า</b> <a href="cart.php"><span class="orderEdit">(แก้ไข)</span></a></td> </tr> <? $sql = "select * from cart,product,user where cart_u_id = ".$_SESSION[u_id]." and cart_u_id = u_id and cart_p_id = p_id and cart_status=0"; $res = $db->query($sql); $num = mysql_num_rows($res); if($num==0){ echo "<script>alert('Your Shopping Cart is empty!'); window.location.href='cart.php';</script>"; die(); } $total =0; while($line = mysql_fetch_array($res)){ ?> <tr> <td class="main" align="right" valign="top" width="30"><? echo $line[cart_quty]; ?> x</td> <td class="main" valign="top"><? echo $line[p_name]; ?> <? echo $line[cart_p_size]; ?></td> <td class="main" valign="top"> <? $dz = $db->queryUniqueObject("select * from promotion where pro_id = ".$line[cart_pro_id]); if($line[p_pricex]!=''){ $p=$line[p_pricex]; }else{ $p=$line[p_price]; } $p = $line[cart_quty]*$p; $tps += $p; if($dz->pro_value!=""){ $ds = (($dz->pro_value/100)*$p); $p = $p-$ds; $tds += $ds; //echo $dz->pro_name."<br>"; echo "Discounte :".$dz->pro_value."%"; //echo "<br>".$p." - ".$ds; } ?> </td> <td class="main" align="right" valign="top"> ฿ <? $total +=$p; echo number_format($p, 2, '.', ','); ?> <input type="hidden" name="cart_id[]" value="<? echo $line[cart_id]; ?>"> </td> </tr> <? } ?> <tr> <td class="main" align="right" valign="top" colspan="4"><strong>ราคา : ฿ <? echo number_format($tps, 2, '.', ',');?></strong></td> </tr> <tr> <td class="main" align="right" valign="top" colspan="4"><strong>ส่วนลดทั้งหมด : ฿ <? echo number_format($tds, 2, '.', ',');?></strong></td> </tr> <tr> <td class="main" align="right" valign="top" colspan="4"><strong>รวมราคา : ฿ <? echo number_format($total, 2, '.', ',');?></strong></td> </tr> <? if($_SESSION[dealer]=="1"){ ?> <tr> <td class="main" align="right" valign="top" colspan="4"><strong>ราคาดีลเลอร์ : ฿ <? $deal = $db->queryUniqueObject("select s_data from site where s_name = 'deal'"); echo number_format($total-($deal->s_data*$total)/100, 2, '.', ','); ?></strong> </td> </tr> <? } ?> </table></td> </tr> </table></td> </tr> </table></td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> <tr> <td><table border="0" width="100%" cellspacing="0" cellpadding="0"> <tr> <td align="right" class="main"> <button class="azbutton" title="Confirm Order" type="submit"><table border="0" cellpadding="0" cellspacing="0"><tr><td class="azbutton_left"></td><td class="azbutton_mid">Confirm Order</td><td class="azbutton_right"></td></tr></table></button> </td> </tr> </table></td> </tr> <tr> <td><img src="images/pixel_trans.gif" border="0" alt="" width="100%" height="10"></td> </tr> </table> </td> </tr> </table></td> </tr> </table> </form> <? include("template/footer.php");?>