%@ LANGUAGE = "VBScript" %>
<%
fname=request.form("fname")
lname=request.form("lname")
address1=request.form("address1")
address2=request.form("address2")
city=request.form("city")
state=request.form("state")
zip=request.form("zip")
country=request.form("country")
deliver=request.form("deliver")
'Check if user is signed in
if session("custid")="" or session("custid")=null then
response.redirect("signin.asp")
end if
'Check if anything in shopping cart
If IsArray(Session("cart")) = false Then
Dim acart(19,1)
Session("cart") = acart
response.redirect("error.asp?msg=" & Server.URLEncode("Your shopping cart is empty."))
end if
acart=Session("cart")
cempty=true
for i=lbound(acart) to ubound(acart)
if acart(i,0)<>"" and acart(i,1)<>"" then
cempty=false
end if
next
if cempty then
response.redirect("review.asp")
end if
set rscust=db.execute("select * from customers where custid=" & Session("custid"))
if rscust.eof then
response.redirect("error.asp?msg=" & Server.URLEncode("We are unable to process your request at the moment"))
end if
'Check to see if we have delivery information
if deliver="update" then
if request.form("deliverto")="other" then
'Check the details which have been passed
session("fname")=fname
session("lname")=lname
session("address1")=address1
session("address2")=address2
session("city")=city
session("state")=state
session("zip")=zip
session("country")=country
msg=""
if trim(fname)="" then
msg=msg & "You need to enter a first name."
end if
if trim(lname)="" then
msg=msg & "
You need to enter a last name."
end if
if trim(address1)="" or trim(address1)="" then
msg=msg & "
You need to enter an address."
end if
if trim(city)="" then
msg=msg & "
You need to enter a city."
end if
if trim(state)="" then
msg=msg & "
You need to enter a state."
end if
if trim(zip)="" then
msg=msg & "
You need to enter a zip."
end if
if trim(country)="" then
msg=msg & "
You need to enter a country."
end if
if msg<>"" then
response.redirect("deliver.asp?msg=" & Server.URLEncode(msg))
end if
elseif request.form("deliverto")="me" then 'deliver to me
session("fname")=rscust("fname")
session("lname")=rscust("lname")
session("address1")=rscust("address1")
session("address2")=rscust("address2")
session("city")=rscust("city")
session("state")=rscust("state")
session("zip")=rscust("zip")
session("country")=rscust("country")
else
response.redirect("deliver.asp")
end if 'who to deliver to
end if 'deliver=update
%>
|
final review of order
review billing and delivery
|
||||