  | 
                       | 
          
            
               
                 โค้ดเดิมค่ะ  
 
Code (PHP) 
<?php 
session_start();
include "function.php";
include "dbconfig.php";
include "config.php";
conndb();
$member_id = $_SESSION['member_id_login'];
if($member_id != "")
{
$query_db = "select * from member where member_id='$member_id'";
$result_db = mysql_query($query_db);
$row_db = mysql_fetch_array($result_db);
$email_from_db = $row_db['email'];
$fullname_from_db = $row_db['fullname'];
$tel_from_db = $row_db['tel'];
$address_from_db = $row_db['address'];
}
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=tis-620">
<title>ตะกร้าสินค้าของคุณ [Your Shopping Cart]</title>
<STYLE type=text/css>
  A:link { color: #0000cc; text-decoration:none}
  A:visited {color: #0000cc; text-decoration: none}
  A:hover {color: red; text-decoration: none}
 </STYLE>
<style type="text/css">
<!--
small { font-family: Arial, Helvetica, sans-serif; font-size: 8pt; } 
input, textarea { font-family: Arial, Helvetica, sans-serif; font-size: 9pt; } 
b { font-family: Arial, Helvetica, sans-serif; font-size: 11pt; } 
big { font-family: Arial, Helvetica, sans-serif; font-size: 14pt; } 
strong { font-family: Arial, Helvetica, sans-serif; font-size: 11pt; font-weight : extra-bold; } 
font, td { font-family: Arial, Helvetica, sans-serif; font-size: 11pt; } 
BODY { font-size: 9pt; font-family: Arial, Helvetica, sans-serif; } 
-->
</style>
<script language="JavaScript" type="text/javascript">
function checkform ( form )
{
  if (form.fullname.value == "") {
    alert( "โปรดกรอก ชื่อ-นามสกุล ด้วย !!" );
    form.fullname.focus();
    return false ;
  }
  if (form.tel.value == "") {
    alert( "โปรดกรอก เบอร์โทรศัพท์ ด้วย !!" );
    form.tel.focus();
    return false ;
  }
  if (form.email.value == "") {
    alert( "โปรดกรอก อีเมล์ ด้วย !!" );
    form.email.focus();
    return false ;
  }
  if (form.send_method_id.value == "") {
    alert( "โปรดเลือก วิธีการจัดส่งสินค้า ด้วย !!" );
    form.send_method_id.focus();
    return false ;
  }
  if (form.address.value == "") {
    alert( "โปรดกรอก ที่อยู่ในการจัดส่งสินค้า ด้วย !!" );
    form.address.focus();
    return false ;
  }
  return true ;
}
</script>
</head>
<body>
<center>
<div id="shoppingCartDisplay">
    <center><img src="images/shopping_cart_header.gif"></center>
    <table width="750" border="1" style="border-collapse: collapse;" bordercolor="#111111" cellpadding="0" cellspacing="0">
      <tr height="30">
        <td bgcolor="#FFFFCC" width="7%"><font color="#000080"><b><center>ลำดับ</center></b></font></td>
        <td bgcolor="#FFFFCC" width="48%"><font color="#000080"><b><center>ชื่อสินค้า</center></b></font></td>
        <td bgcolor="#FFFFCC" width="15%"><font color="#000080"><b><center>ราคาต่อหน่วย</center></b></font></td>
        <td bgcolor="#FFFFCC" width="15%"><font color="#000080"><b><center>จำนวน</center></b></font></td>
        <td bgcolor="#FFFFCC" width="15%"><b><font color="#000080"><center>ราคารวม</center></b></font></td>
      </tr>
        <?php 
        $no =1;
        //Print all the items in the shopping cart
        foreach ($_SESSION['SHOPPING_CART'] as $itemNumber => $item) {
        ?>
        <tr id="item<?php echo $itemNumber; ?>"  height="30">    
            <td bgcolor="#CCFFFF"><div align="center"><?=$no; ?></div></td>
            <td bgcolor="#CCFFFF"><div align="left"> <?php echo $item['name']; ?> </div></td>
            <td bgcolor="#CCFFFF"><div align="center"><?php echo number_format($item['price'],2,'.',','); ?> </div></td>
            <td bgcolor="#CCFFFF"><div align="center"><?php echo number_format($item['qty'],0,'.',','); ?></div></td>
            <td bgcolor="#CCFFFF"><div align="right"><?php echo number_format($item['qty'] * $item['price'],2,'.',','); ?> </div></td> 
        </tr>
        <?php
        $no++;
        }
        ?>
        <tr id="itemtotal" height="30">    
            <td bgcolor="#FFFFCC" colspan="4" align="left">
            <b><font color="red">  ราคารวม</font></b></td>
            <td bgcolor="#FFFFCC" colspan="2">
            <div align="right"><b><font color="red"><? echo number_format($_SESSION['total'],2,'.',','); ?> บาท </font></b></div></td>
        </tr>
<?
if($use_vat == 1)
{
?>
        <tr id="itemvat" height="30">    
            <td bgcolor="#FFFFCC" colspan="4" align="left">
            <b><font color="red">  ภาษีมูลค่าเพิ่ม (7%)</font></b></td>
            <td bgcolor="#FFFFCC" colspan="2">
            <div align="right"><b><font color="red"><? echo number_format($_SESSION['total']*0.07,2,'.',','); ?> บาท </font></b></div></td>
        </tr>
        <tr id="itemnettotal" height="30">    
            <td bgcolor="#FFFFCC" colspan="4" align="left">
            <b><font color="red">  ราคารวมภาษีมูลค่าเพิ่ม (7%)</font></b></td>
            <td bgcolor="#FFFFCC" colspan="2">
            <div align="right"><b><font color="red"><? echo number_format($_SESSION['total'] + ($_SESSION['total']*0.07),2,'.',','); ?> บาท </font></b></div></td>
        </tr>
<?
}
?>
    </table>
<br>
<center>
<form name="frm" id="frm" action="confirm_order2.php" method="post" enctype="multipart/form-data" onsubmit="return checkform(this);">
<INPUT type="hidden" name="member_id" value="<?=$member_id; ?>">
<table border="0" cellpadding="2" cellspacing="0" width="60%" style="border-collapse: collapse" bordercolor="#111111">
<tr bgcolor="#FFFFCC" height="40">
<td width="100%" colspan="3"><div align="center"><b>:: ข้อมูลผู้สั่งซื้อสินค้า ::</b></div>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td colspan="3"> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="36%" align="left"> ชื่อ-นามสกุล</td>
<td width="5%" align="center">:</td>
<td width="60%" align="left"><INPUT type="text" name="fullname" size="40" value="<?=$fullname_from_db; ?>" maxlength="200"> <font color=red>*</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left"> เบอร์โทรศัพท์</td>
<td align="center">:</td>
<td align="left"><INPUT type="text" name="tel" size="40" value="<?=$tel_from_db; ?>" maxlength="100"> <font color=red>*</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left"> อีเมล์</td>
<td align="center">:</td>
<td align="left"><INPUT type="text" name="email" size="40" value="<?=$email_from_db; ?>" maxlength="100"> <font color=red>*</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left"> วิธีการจัดส่งสินค้า</td>
<td align="center">:</td>
<td align="left"><select name="send_method_id">
      <option value="" selected>------------------- โปรดเลือก -------------------</option>
<option value="รับเอง" selected> รับเอง</option>
<option value="จัดส่ง" selected> จัดส่ง</option>
<?
$strSQL1 = "SELECT * FROM send_method_tb ORDER BY order_list DESC";
$result1 = mysql_query($strSQL1);
While($row1 = mysql_fetch_array($result1)){
?>
      <option value="<?=$row1['id']; ?>"><?=$row1['method_name']; ?></option>
<?
}
?>
</select> <font color=red>*</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left" valign="top"> ที่อยู่ในการจัดส่งสินค้า</td>
<td align="center" valign="top">:</td>
<td align="left"><textarea name="address" id="address" wrap="VIRTUAL" style="width: 232px; height: 50px"><?=$address_from_db; ?></textarea> <font color=red>*</font></td>
</tr>
<tr bgcolor="#FFFFFF">
<td align="left" valign="top"> หมายเหตุเพิ่มเติม</td>
<td align="center" valign="top">:</td>
<td align="left"><textarea name="remarks" id="remarks" wrap="VIRTUAL" style="width: 232px; height: 50px"></textarea></td>
</tr>
<tr bgcolor="#FFFFFF" height="50">
<td width="100%" colspan="3"><div align="center"><input type="submit" name="submit_bt" id="submit_bt" value="สั่งซื้อสินค้า"> <input type="reset" name="reset_bt" id="reset_bt" value="ยกเลิก"></div>
</td>
</tr>
</table>
</form>
</div>
</center>
</body>
</html>
                        
               
               | 
             
            
              
			                              
                              
              
                
                     | 
                     | 
                     | 
                 
                
                     | 
                  
                      
                        | Date :
                            2019-02-13 15:09:02 | 
                        By :
                            2015381758558256 | 
                         
                    | 
                     | 
                 
                
                     | 
                     | 
                     | 
                 
                | 
             
           
			         | 
             |