%@ LANGUAGE="VBScript" %>
<% Response.AddHeader "cache-control", "private" %>
<% Response.AddHeader "pragma", "no-cache" %>
<% Response.Expires = 0 %>
<%
Dim DSN_Name
DSN_Name = Session("DSN_Name")
set Connection = Server.CreateObject("ADODB.Connection")
Connection.Open DSN_Name
ORDER_ID = Trim(Session("ORDER_ID"))
Cust_ID = Trim(Request.Cookies("CustID"))
session.LCID = Session("LCID")
SQL = "SELECT GRAND_TOTAL from customer WHERE " _
& " CUSTOMER_ID = " & ORDER_ID & ""
Set RSOrderCheck = Connection.Execute(SQL)
If FormatCurrency(RSOrderCheck("GRAND_TOTAL")) > FormatCurrency("0") Then
Set RSOrderCheck = nothing
Connection.Close
Set Connection = nothing
Response.Redirect "order_complete.asp?DSN_NAME="&DSN_NAME
End If
'***** MODIFY ITEMS IN CURRENT ORDER *****************************
If Request("MODIFY") = "1" Then
SQL = " SELECT PRICE, DESCRIPTION, SHIP, WEIGHT FROM PRODUCT WHERE " _
& " PRODUCT_ID = '" & Request("PRODUCT_ID") & "' "
set RSUpdt = Connection.Execute(SQL)
SQL = "UPDATE ORDERS SET QUANTITY = " & Request("QUANTITY") & ", " _
& " SHIP = '" & XValAmt((RSUpdt("SHIP")*Request("Quantity"))) & "', " _
& " TOTAL = '" & XValAmt(((RSUpdt("Price")*Request("Quantity")))) & "', " _
& " WEIGHT = '" & XValAmt(RSUpdt("WEIGHT")*Request("Quantity")) & "' " _
& " WHERE ORDERS.ID = " & Request("ID") & " "
set RSMod = Connection.Execute(SQL)
Set RSMod = nothing
Set RSUpdt = nothing
'***** DELETE ITEMS FROM CURRENT ORDER *******************
ElseIf Request("DELETE") = "1" Then
SQL = "DELETE * FROM ORDERS WHERE ID = " & Request("ID") & ""
set RSDel = Connection.Execute(SQL)
Set RSDel = nothing
End If
'***** INCLUDE DESIGN ELEMENTS **********************************
%>
<%
'****** GET RSAdmin DATA *************************
SQL = "SELECT * FROM Admin"
set RSAdmin = Connection.Execute(SQL)
SQL = "SELECT COUNTRY from locales WHERE Country_ABB = " _
& " '" & Trim(RSAdmin("ORIGIN_COUNTRY")) & "' "
Set RSDefCountry = Connection.Execute(SQL)
'***** SET RSAdmin VARIABLES **********************
SSLPath = Trim(RSAdmin("SSL_PATH"))
OCountry = Trim(RSAdmin("ORIGIN_COUNTRY"))
OZip = Trim(RSAdmin("ORIGIN_ZIP"))
ShipType = Trim(RSAdmin("SHIP_TYPE"))
Handling = Trim(RSAdmin("HANDLING"))
DefCountry = Trim(RSDefCountry("COUNTRY"))
DefCountryAbb = Trim(RSAdmin("ORIGIN_COUNTRY"))
CODAmt = Trim(RSAdmin("COD_AMOUNT"))
ShipMin = Trim(RSAdmin("SHIP_MIN"))
HandlingSwitch = Trim(RSAdmin("HANDLINGSWITCH"))
COD = Trim(RSAdmin("COD"))
CREDIT = Trim(RSAdmin("CREDIT"))
PO = Trim(RSAdmin("PO"))
ECHECK = Trim(RSAdmin("ECHECK"))
PHONEFAX = Trim(RSAdmin("PHONEFAX"))
UseCookies = Trim(RSAdmin("COOKIES"))
set RSAdmin = nothing
%>
<%
'****** GET ORDER DETAIL **************************
SQL = "SELECT ORDERS.PRODUCT_ID, " _
& "ORDERS.PRICE, ORDERS.ATTRIBUTEA, ORDERS.ATTRIBUTEB, ORDERS.ATTRIBUTEC, " _
& "ORDERS.TOTAL, PRODUCT.WEIGHT, " _
& "ORDERS.QUANTITY, ORDERS.ID, ORDERS.DESCRIPTION " _
& "FROM ORDERS, PRODUCT " _
& "WHERE (ORDERS.ORDER_ID = " & ORDER_ID & " " _
& "AND ORDERS.PRODUCT_ID = PRODUCT.PRODUCT_ID)"
set RSOrder = Connection.Execute(SQL)
'****** GET COUNTRIES FOR SHIP TO LIST **********************
SQL = "SELECT country, country_abb FROM locales WHERE (active = '1' " _
& "AND country <> NULL) ORDER BY country ASC"
set RSCountry = Connection.Execute(SQL)
'****** GET STATES FOR SHIP TO LIST *************************
SQL = "SELECT state, state_abb FROM locales WHERE (active = '1' " _
& "AND state <> NULL) ORDER BY state ASC"
set RSState = Connection.Execute(SQL)
'***** CHECK FOR HANDLING CHARGE EXEMPT ORDER **************************
SQL = "SELECT Count(product.PRODUCT_ID) AS CntShipExempt FROM product, orders WHERE (orders.PRODUCT_ID = "_
& "product.PRODUCT_ID AND ORDERS.ORDER_ID = " & ORDER_ID & " AND product.SHIPSWITCH = '1')"
Set RSCheckShip = Connection.Execute(SQL)
'***** CHECK FOR SHIP EXEMPT ORDER **************************
If RSCheckShip("CntShipExempt") > 0 Then 'There are items to be shipped
ApplyShipping = 1 'Show Shipping
SQL = "SELECT METHODS, CODE from shipping WHERE ACTIVE = '1'"
set RSShipMeth = Connection.Execute(SQL)
Else 'There are NO items that are being shipped
ApplyShipping = 0 'Don't Show Shipping
End If
Set RSCheckShip = nothing
If RSOrder.EOF Then
%>
>
bordercolor=<%=BorderColor%> cellpadding=<%=CellPadding%> cellspacing=<%=CellSpacing%> width=<%=TableWidth%> bgcolor=<%=TableBG%>>
| <%=CellFontStyle%> color=<%=CellFontColor%> size=<%=FontSize%>>There are no items in your cart. |
Back to Previous
Demo Mall Entrance |
<%
Else
SQL = "SELECT TOTAL AS SubTotal FROM ORDERS WHERE ORDER_ID = " & ORDER_ID & " "
set RSSumOrd = Connection.Execute(SQL)
RSSumOrd.MoveFirst
CurrentRecord = 0
Do While NOT RSSumOrd.EOF
CurrTotal = CCur(RSSumOrd("SubTotal"))+CurrTotal
RSSumOrd.MoveNext
CurrentRecord = CurrentRecord = 1
Loop
SubTotal = CurrTotal
set RSSumOrd = nothing
%>
CasperBusiness.com - On-Line Shopping Mall
|
<% End If %>
<% Connection.Close
Set Connection = Nothing
%>
|