<% Function GetItemParameters(iItemID) Dim aParameters SQL="SELECT * FROM PriceProduct WHERE ProductID='" & iItemID & "'" 'ใช้ค่า ProductID เป็นตัวเรียก Set rs2 = conn.Execute(SQL) 'Set dictColor = Session("CColor") If rs2.EOF = False then varPname = rs2.Fields(2) 'ชื่อสินค้า varPPrice = rs2.Fields(4) ' ราคา varPProID=rs2.Fields(1) 'ProductID varPPicture=rs2.Fields(6) varPset=rs2.Fields(5) varPPcolor=rs2.Fields(3) aParameters = Array(varPProID,varPName, varPPrice,varPPicture,varPset,varPPcolor) GetItemParameters = aParameters rs2.close set rs2 =nothing End if End Function '--- establish access connection Const maxCart = 10 ' จำนวนสินค้าที่มีได้สูงสุดของอาเรย์ Const ProID = 1 ' กำหนดค่าให้ Dimension ที่ 2 Const Procount = 2 ' กำหนดค่าให้ Dimension ที่ 3 Const Procolor = 3 ' กำหนดค่าให้ Dimension ที่ 4 '============================================ Pdictcart = session("cart") Pdictcolor = session("Ccolor") '============================================ %> <% If session("ShopperID") = "" Then '??????????????????? session ??????? ????????????????????? 'Response.Redirect "login.htm" Response.Write "Time out. Please login again " Else Set Conn = Server.CreateObject("ADODB.Connection") Set rs = Server.CreateObject("ADODB.Recordset") 'Conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("\AdoP\database\Proweb.mdb") Conn.open "DRIVER={Microsoft Access Driver (*.mdb)}; DBQ=" & Server.MapPath("database\Proweb.mdb") sql = "Select max(OrderID) from Orders" rs.Open sql,conn, 1, 3 OrderID =rs.Fields(0) +1 rs.Close sql = "Select * From ShopperD Where ShopperID=" & session("ShopperID") 'Set rs = conn.Execute(sql) rs.Open sql, Conn, 1, 3 If rs.EOF then ' ??????????? ????????????????????????????? 'msgbox "We didn't find your personal information Please fill your personal again" Response.Redirect "Regform.htm" End If %>

Step 5:Preview your orderPreview your order

Complete the order form, check for accuracy and submit to order.
ShopperID : <%=session("ShopperID")%> ORDER DATE :<%=Date%> ORDER NUMBER :> <% =OrderID %>
1.Your personal information :
Name: <%=rs("FirstName") & " " & rs("LastName")%> Address:
<%=rs("Address1")%>
<%=rs("Address2")%>
City:<%=rs("City")%>   State/Province/Region:<%=rs("State")%>
Country:<%=rs("Country")%> ZIP/Postal Code: <%=rs("ZIP")%>
Email: <%=rs("Email")%>
Phone: <%=rs("Phone")%>
FAX: <%=rs("FAX")%>
Edit your Profile.
2.Your Order:
<% 'Sub ShowItemsInCart() 'Dim Key Dim aParameters Dim sTotal, sShipping %> <% sTotal = 0 'จำนวนเงินรวมนั่นเอง For i = 1 to Pdictcolor aParameters = GetItemParameters((Pdictcart(ProID,i))) 'GetItemParameters ทำไร key คือ ItemID นั่นเอง %> <% sTotal = sTotal + (Pdictcart(Procount,i)) * CSng(aParameters(2)) Next If sTotal <> 0 Then sShipping = 100 ' ค่าขนส่ง ถ้ายังไม่มีให้ = 100 Else sShipping = 0 ' ค่าขนส่ง ถ้ามีแล้วให้ = 0%>

Your Shopping Cart is empty.
To put something in your Shopping Cart, start by searching or browsing through any of our stores. When an item interests you, click the Add to Shopping Cart. <% End If sTotal = sTotal + sShipping %>

ProductID
Productname
Inlaid
Piece/set
Color
QTY
Remove
Price
FOB Bangkok Total
<%= aParameters(0)%> <%= aParameters(1) %> <%= aParameters(5) %> <%= aParameters(4) %> <%= Pdictcart(Procolor,i) %> <%= Pdictcart(Procount,i) %> Remove 1  Remove All $<%= FormatNumber(aParameters(2),2) %> $<%= FormatNumber( Pdictcart(Procount,i) * CSng(aParameters(2)),2) %>
Shipping Cost $<%= FormatNumber(sShipping,2) %>
FOB Bangkok Total $<%= FormatNumber(sTotal,2) %>
These prices are FOB BANGKOK Prices.
(not included the shipping and packing cost.)
Would you like to get the price included the shipping cost?
Shipping Port:
(The recieving port or the nearest Port,you want to recieve the furniture)
Payment Method:
More details about Payment Method.
If you submit,we will send more order information via your email address to confirm the order again.

<% rs.Close set rs=nothing conn.Close set conn =nothing End If %>