<%@ 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 %> <%= storename %> <% header categorymenu %>

final review of order
· Review your order and make sure it is correct.
<% 'Display contents of shopping cart acart=session("cart") subtotal=0 for i=lbound(acart) to ubound(acart) if acart(i,0)<>"" and acart(i,1)<>"" then set rscart=db.execute("select name,productid,price,saleprice from products where productid=" & acart(i,0)) if rscart("saleprice")="" or rscart("saleprice")=0 then currentprice=rscart("price") else currentprice=rscart("saleprice") end if %> <% subtotal=subtotal+(currentprice * acart(i,1)) end if next tax=subtotal*taxrate/100 %>
Delete  Item  Quantity  Price Each  Total 
"><%= rscart("name") %>
<%= acart(i,1) %> <%= cursymbol & formatnumber(currentprice)%> <%= cursymbol & formatnumber((currentprice) * acart(i,1)) %>

Grand Total: <%= cursymbol & formatnumber(subtotal+tax) %>

review billing and delivery
· Review your billing and delivery information and make sure it is correct.


Bill to: Edit
<%= rscust("fname") & " " & rscust("lname") %>
<%= rscust("address1") %>
<%= rscust("address2") %>
<%= rscust("city") %>
<%= rscust("state") & " " & rscust("zip") %>
<%= rscust("country") %>
Deliver to: Edit
<%= session("fname") & " " & session("lname") %>
<%= session("address1") %>
<%= session("address2") %>
<%= session("city") %>
<%= session("state") & " " & session("zip") %>
<%= session("country") %>

<% if enablecreditcard then %>

payment information
· If all the information above is correct, enter your credit card details below.
· Click "Submit Order" and we will process your order.

<%= request.querystring("ccmsg") %>
card type:  
card number:  
expiry date (mm/yy):  
<% end if %>



<% footer %> <% db.close set db=nothing %>