<%@ Language=VBScript%> XP ENGINEERING - BMW Parts and High Performance

 



<% set aodb = server.CreateObject("adodb.connection") aodb.Open "DSN=xpdb_xpengineering_com;" '******************************************************************************************** 'Code to retrieve proper custID and orderNum ip = Request.ServerVariables ("REMOTE_ADDR") orderNum = (Year(Date())*13 +Month(Date())*23 + Day(Date())*33 + Hour(Time())*43 + Minute(Time())*53 + Second(Time())*63)*393 custID = (Year(Date())*31 +Month(Date())*32 + Day(Date())*33 + Hour(Time())*34 + Minute(Time())*35 + Second(Time())*36)*939 'Get values from IP Xref table based on users ip sql = "SELECT * FROM tblIPXref WHERE IP = '" & ip & "'" set rs = aodb.Execute(sql) 'If ip is not in table or is not associated with custID then add ip, custID, and orderNum to table if rs.EOF then sql = "INSERT INTO tblIPXref ( IP, CustID, OrderNum ) SELECT '" & ip & "' AS Expr1, '" & custID & "' AS Expr2, '" & orderNum & "' AS Expr3" aodb.Execute(sql) sql = "DELETE * FROM tblTempOrders WHERE CustID = " & custID aodb.Execute(sql) else 'Set orderNum to whatever's stored in the table for this ip, because whatever the case maybe, 'the customer with this IP is going to get the orders associated with this ip from before. orderNum = rs(2) custID = rs(1) end if '******************************************************************************************** sql = "SELECT tblTempOrders.CustID FROM tblTempOrders WHERE (((tblTempOrders.CustID)=" & custID & "));" set rs = aodb.Execute(sql) if rs.EOF then %>
You have not made any additions to your shopping cart.
<%else%>
You have selected the following items. You may change the quantity of items or delete them here. To delete an item, simply check the delete box and click on save changes.

 

<% sql = "Select * from tblTempOrders where CustID =" & custID & " AND OrderNum = " & orderNum set rs = aoDB.Execute(sql) dim total, taxtotal, subtotal, shipCharge total = 0 taxtotal=0 subtotal=0 shipCharge = 0 dim shipping %>

" onSubmit="return frmCart_onsubmit()"> <% while not rs.EOF%> <% subtotal=subtotal + rs("SubTotal") ' taxtotal = taxtotal + rs("SalesTax") ' total = total + rs("TotalCost") ' shipCharge = shipCharge + rs("Shipping") rs.movenext() wend %>
Del Qty Item # Description Unit Price Total
value=<%=rs("Quantity")%>> <%=rs("ItemName")%> <%=rs("ItemDesc")%> <%=FormatCurrency(rs("ItemPrice"))%> <%=FormatCurrency(rs("ItemPrice") * rs("Quantity"))%>
Sub-Total: <%=formatcurrency(subtotal)%>

 

<%end if set aodb = nothing %>