<% Quantity = 1 Brand = request.querystring("Brand") myStyle = request.querystring("myStyle") Category = request.querystring("Category") if Brand="" and myStyle="" and Category="" then Category="Dresses" end if dqstr = "" if Brand<>"" then dqstr = dqstr & "brand=" & Server.URLEncode(Brand) end if if myStyle<>"" then if dqstr <> "" then dqstr = dqstr & "&" end if dqstr = dqstr & "myStyle=" & myStyle end if if Category<>"" then if dqstr <> "" then dqstr = dqstr & "&" end if dqstr = dqstr & "Category=" & Server.URLEncode(Category) end if numproducts = 0 if request.querystring("prodcode") <> "" then prodcode = request.querystring("prodcode") if request.form("Colour")<>prodcode and request.form("Colour")<>"" then prodcode = request.form("Colour") end if else if request.form("numproducts") = "" then ' response.redirect "products.asp?" & dqstr else numproducts = CLng(request.form("numproducts")) end if end if SubTotal = 0 postagetype = 0 Accessories5 = true if request.form("postagetype") <>"" then postagetype = CLng(request.form("postagetype")) elseif session("Postagetype")<>"" then postagetype = CLng(session("postagetype")) end if Set DBConn = Server.CreateObject("ADODB.Connection") DBConn.Open productsDB Set DBConn2 = Server.CreateObject("ADODB.Connection") DBConn2.Open ordersDB Set rs = Server.CreateObject("ADODB.RecordSet") Set rs2 = Server.CreateObject("ADODB.RecordSet") randomize ((minute(now) * 60) + second(now)) if session("verificationid")="" then verificationid = request.cookies("ElectricAliceOrder")("verificationid") if verificationid="" then veridok = false do while veridok = false verificationid="" for j=1 to 20 verificationid=verificationid & chr(int(rnd * 26) + 65) next rs.open "SELECT * FROM TempOrders WHERE VerificationID='" & VerificationID & "'",DBConn2,1,3 if rs.eof then veridok = true end if rs.close loop session("verificationid") = VerificationID Response.Cookies("ElectricAliceOrder")("verificationid") = verificationid Response.Cookies("ElectricAliceOrder").Expires = dateAdd("n",5,Now()) else session("verificationid") = verificationid end if else VerificationID = session("verificationid") end if ' DBConn2.Execute "Delete from TempOrders WHERE VerificationID='" & VerificationID & "'" if numproducts = 0 and prodcode<>"" then ProductID = 0 rs.open "SELECT * FROM Products where ProductCode='" & prodcode & "'",DBConn,1,3 if not rs.eof then ProductID = rs("ID") ProductName = rs("ProductName") ProductDescription = rs("Description") ProductMeasureMents = rs("MeasureMents") ProductColour = rs("Colour") if rs("SpecialPrice")>0 then ProductPrice = rs("SpecialPrice") else ProductPrice = rs("Price") end if end if rs.close rs.open "SELECT * FROM TempOrders WHERE VerificationID='" & VerificationID & "' and ProductCode='" & ProdCode & "' ",DBConn2,2,3 if rs.eof then rs.addnew rs("ProductID") = ProductID rs("ProductCode") = ProdCode rs("ProductName") = ProductName rs("ProductPrice") = ProductPrice rs("ProductColour") = ProductColour rs("VerificationID") = VerificationID rs("ProductQuantity") = Quantity rs("DateReceived") = Now() rs.update else rs("ProductQuantity") = Quantity rs.update end if rs.close else if numproducts<>0 then ' ###### Posted from basket ###### for j = 1 to numproducts ProdCode = request.form("ProdCode" & j) if ProdCode<>"" then if isnumeric(request.form("Quantity" & j)) then Quantity = CLng(request.form("Quantity" & j)) else Quantity = 1 end if if Quantity = 0 then DBConn2.Execute "Delete from TempOrders WHERE VerificationID='" & VerificationID & "' and ProductCode='" & ProdCode & "' " else rs.open "SELECT * FROM TempOrders WHERE VerificationID='" & VerificationID & "' and ProductCode='" & ProdCode & "' ",DBConn2,2,3 if rs.eof then rs.addnew rs("ProductID") = ProductID rs("ProductCode") = ProdCode rs("ProductName") = ProductName rs("ProductPrice") = ProductPrice rs("ProductColour") = ProductColour rs("VerificationID") = VerificationID rs("ProductQuantity") = Quantity rs("DateReceived") = Now() rs.update else rs("ProductQuantity") = Quantity rs.update end if rs.close end if end if next end if end if rs.open "SELECT SUM(ProductQuantity) as ProductCount FROM TempOrders WHERE VerificationID='" & VerificationID & "'",DBConn2,1,3 if not rs.eof then ProductCount = rs("ProductCount") end if rs.close Session("ItemCount") = ProductCount session("postagetype") = postagetype if ProductCount>5 then Accessories5 = false end if %> Electric Alice
<% %>

Your Basket

<% if ProductCount>0 then %>

Below are your order details. To change the quantity of items you wish to order, change the number in the quantity field and click Update. You can change the delivery options using the radio buttons.

<% j = 0 rs.open "SELECT * FROM TempOrders WHERE VerificationID='" & VerificationID & "'",DBConn2,2,3 do while not rs.eof j = j + 1 rs2.open "Select Category, Quantity from Products Where ProductCode='" & rs("ProductCode") & "'", DBConn,1,3 if not rs2.eof then MaxQuantity = rs2("Quantity") if rs2("Category")<>"Accessories" and rs2("Category")<>"Hair Clips & Brooches" and rs2("Category")<>"Jewellery" then Accessories5 = false end if end if rs2.close %> <% ProductTotal = (rs("ProductPrice") * rs("ProductQuantity")) %> <% SubTotal = SubTotal + ProductTotal %> <% rs.movenext %> <% loop %> <% rs.close %> <% if SubTotal>=20000 then %> <% discount = SubTotal * 0.10 discount100 = (discount * 100) if discount100 mod 5 <> 0 then discount100 = discount100 + (5 - (discount100 mod 5)) discount = discount100 / 100 end if %> <% end if %> <% if Accessories5 = true then select case postagetype case 0: postageamount = AUpostage1 case 1: postageamount = NZpostage1 case 2: postageamount = USpostage1 case 3: postageamount = OTpostage1 end select else select case postagetype case 0: postageamount = AUpostage2 case 1: postageamount = NZpostage2 case 2: postageamount = USpostage2 case 3: postageamount = OTpostage2 end select end if %> <% Total = SubTotal + postageamount %>
Description Quantity Each Price
<%=rs("ProductName")%> - <%=rs("ProductColour")%> " /> <%=FormatCurrency(rs("ProductPrice"),2)%><%=FormatCurrency(ProductTotal,2)%>
  Update Basket  
Subtotal <%=FormatCurrency(SubTotal,2)%>
Less 10% discount <%=FormatCurrency(discount,2)%>
Ship to: checked="checked"<%end if%> /> Australia    checked="checked"<%end if%> /> NZ    checked="checked"<%end if%> /> USA    checked="checked"<%end if%> /> Other   
<%=FormatCurrency(postageamount)%>
Total<%=FormatCurrency(Total,2)%>
* includes GST of <%=FormatCurrency((Total/11),2)%>
Go to Checkout   <% else %>

Your basket contains no items

<% end if %> Continue Shopping
<% set rs = nothing set rs2 = nothing DBConn.close DBConn2.close set DBConn = nothing set DBConn2 = nothing %>