<% Response.Buffer=true %> Laundry Carts <% Dim ScootsConn Dim ScootsDB Add=0 Set ScootsConn=Server.CreateObject("ADODB.Connection") ScootsConn.Open("DSN=LaundryCarts;") Dim CookCartID CookCartID = Session("CookCartID") If CookCartID <> "" Then 'Response.Write "Current Cookie: " & CookCartID Else 'Response.Cookies("hkcookie").Expires = date + 30 strSQL = "INSERT INTO Cart (Expires) VALUES ('" & date + 30 & "')" ScootsConn.Execute(strSQL) strSQL = "SELECT CartID FROM Cart ORDER BY CartID DESC" Set ScootsDBcart = ScootsConn.Execute(strSQL) DBCartID = ScootsDBcart("CartID") Session("CookCartID")=DBCartID CookCartID = Session("CookCartID") 'Response.Write "New Current Cookie: " & CookCartID ScootsDBcart.Close Set ScootsDBcart = Nothing End IF strSQL = "SELECT CartID, PartID, IDCateg, Quantity FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) AddID = Request.QueryString("Add") AddCateg = Request.QueryString("AddCateg") Add = 0 If NOT ScootsDB.EOF Then ScootsDB.MoveFirst Do While Not ScootsDB.EOF Set AddPart = ScootsDB("PartID") Set AddCat = ScootsDB("IDCateg") If AddID = AddPart and AddCat = AddCateg Then Add = 1 End If ScootsDB.MoveNext Loop End If ScootsDB.Close Set ScootsDB = Nothing If AddID <> "" AND Add = 0 Then strSQL = "SELECT * FROM " & AddCateg & " WHERE PartNumber LIKE '" & AddID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) 'response.write strSQL ' response.write ScootsDB("PartDescription") strSQL = "INSERT INTO CartItems (CartID,PartID,IDCateg,Quantity,PartDesc,Weight,Price) VALUES (" & CookCartID & ",'" & ScootsDB("PartNumber") & "','" & AddCateg & "',1,'" & ScootsDB("PartDescription") & "'," & ScootsDB("Weight") & "," & ScootsDB("Price") & ")" 'Response.Write strSQL ScootsDB.Close Set ScootsDB = Nothing ScootsConn.Execute(strSQL) End If strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) If NOT ScootsDB.EOF Then ScootsDB.MoveFirst Do While NOT ScootsDB.EOF Update = Request.Form("quant_" & ScootsDB("PartID") ) Remove = Request.Form("Remove_" & ScootsDB("PartID") ) If Update <> "" AND Update <> ScootsDB("Quantity") AND Update > 0 Then strSQL = "UPDATE CartItems SET Quantity = "& Update & " WHERE CartID = "& CookCartID & " AND PartID LIKE '" & ScootsDB("PartID") & "'" ScootsConn.Execute(strSQL) 'Response.Write strSQL End If If Remove = "Remove" Then strSQL = "DELETE * FROM CartItems WHERE CartID = "& CookCartID & " AND PartID LIKE '" & ScootsDB("PartID") & "'" ScootsConn.Execute(strSQL) End If ScootsDB.MoveNext Loop End If ScootsDB.Close Set ScootsDB = Nothing randomize random_number = int(rnd*90)+10 strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) If NOT ScootsDB.EOF Then ScootsDB.MoveFirst Do While NOT ScootsDB.EOF quant = quant + ScootsDB("Quantity") pric = pric + ScootsDB("Price1") ScootsDB.MoveNext Loop Else quant = 0 pric = 0 End If ScootsDB.Close Set ScootsDB = Nothing if pric < 0 then pric = 0 end if strSQL = "UPDATE Cart SET TotalQuant = "& quant & ", TotalPrice = "& pric & " WHERE CartID = "& CookCartID & "" ScootsConn.Execute(strSQL) Dim ZoneArray(2,97) ZoneArray(0,1) = "6" ZoneArray(0,2) = "8" ZoneArray(0,3) = "9" ZoneArray(0,4) = "10" ZoneArray(0,5) = "90" ZoneArray(0,6) = "100" ZoneArray(0,7) = "200" ZoneArray(0,8) = "300" ZoneArray(0,9) = "325" ZoneArray(0,10) = "326" ZoneArray(0,11) = "340" ZoneArray(0,12) = "341" ZoneArray(0,13) = "350" ZoneArray(0,14) = "360" ZoneArray(0,15) = "364" ZoneArray(0,16) = "368" ZoneArray(0,17) = "369" ZoneArray(0,18) = "373" ZoneArray(0,19) = "375" ZoneArray(0,20) = "376" ZoneArray(0,21) = "380" ZoneArray(0,22) = "398" ZoneArray(0,23) = "400" ZoneArray(0,24) = "403" ZoneArray(0,25) = "420" ZoneArray(0,26) = "425" ZoneArray(0,27) = "427" ZoneArray(0,28) = "430" ZoneArray(0,29) = "460" ZoneArray(0,30) = "467" ZoneArray(0,31) = "469" ZoneArray(0,32) = "470" ZoneArray(0,33) = "471" ZoneArray(0,34) = "473" ZoneArray(0,35) = "474" ZoneArray(0,36) = "480" ZoneArray(0,37) = "498" ZoneArray(0,38) = "500" ZoneArray(0,39) = "504" ZoneArray(0,40) = "505" ZoneArray(0,41) = "506" ZoneArray(0,42) = "508" ZoneArray(0,43) = "520" ZoneArray(0,44) = "561" ZoneArray(0,45) = "562" ZoneArray(0,46) = "570" ZoneArray(0,47) = "582" ZoneArray(0,48) = "583" ZoneArray(0,49) = "590" ZoneArray(0,50) = "592" ZoneArray(0,51) = "596" ZoneArray(0,52) = "600" ZoneArray(0,53) = "640" ZoneArray(0,54) = "650" ZoneArray(0,55) = "653" ZoneArray(0,56) = "654" ZoneArray(0,57) = "656" ZoneArray(0,58) = "677" ZoneArray(0,59) = "680" ZoneArray(0,60) = "693" ZoneArray(0,61) = "700" ZoneArray(0,62) = "710" ZoneArray(0,63) = "712" ZoneArray(0,64) = "718" ZoneArray(0,65) = "720" ZoneArray(0,66) = "726" ZoneArray(0,67) = "739" ZoneArray(0,68) = "740" ZoneArray(0,69) = "790" ZoneArray(0,70) = "795" ZoneArray(0,71) = "797" ZoneArray(0,72) = "800" ZoneArray(0,73) = "813" ZoneArray(0,74) = "814" ZoneArray(0,75) = "840" ZoneArray(0,76) = "854" ZoneArray(0,77) = "855" ZoneArray(0,78) = "864" ZoneArray(0,79) = "865" ZoneArray(0,80) = "870" ZoneArray(0,81) = "873" ZoneArray(0,82) = "875" ZoneArray(0,83) = "879" ZoneArray(0,84) = "880" ZoneArray(0,85) = "889" ZoneArray(0,86) = "893" ZoneArray(0,87) = "900" ZoneArray(0,88) = "934" ZoneArray(0,89) = "935" ZoneArray(0,90) = "936" ZoneArray(0,91) = "940" ZoneArray(0,92) = "962" ZoneArray(0,93) = "967" ZoneArray(0,94) = "969" ZoneArray(0,95) = "970" ZoneArray(0,96) = "995" ZoneArray(1,0) = "8" ZoneArray(1,1) = "0" ZoneArray(1,2) = "0" ZoneArray(1,3) = "0" ZoneArray(1,4) = "8" ZoneArray(1,5) = "0" ZoneArray(1,6) = "8" ZoneArray(1,7) = "8" ZoneArray(1,8) = "8" ZoneArray(1,9) = "7" ZoneArray(1,10) = "8" ZoneArray(1,11) = "0" ZoneArray(1,12) = "8" ZoneArray(1,13) = "7" ZoneArray(1,14) = "8" ZoneArray(1,15) = "7" ZoneArray(1,16) = "8" ZoneArray(1,17) = "7" ZoneArray(1,18) = "8" ZoneArray(1,19) = "7" ZoneArray(1,20) = "8" ZoneArray(1,21) = "7" ZoneArray(1,22) = "8" ZoneArray(1,23) = "7" ZoneArray(1,24) = "8" ZoneArray(1,25) = "7" ZoneArray(1,26) = "8" ZoneArray(1,27) = "7" ZoneArray(1,28) = "8" ZoneArray(1,29) = "7" ZoneArray(1,30) = "8" ZoneArray(1,31) = "7" ZoneArray(1,32) = "8" ZoneArray(1,33) = "7" ZoneArray(1,34) = "8" ZoneArray(1,35) = "7" ZoneArray(1,36) = "8" ZoneArray(1,37) = "7" ZoneArray(1,38) = "6" ZoneArray(1,39) = "7" ZoneArray(1,40) = "6" ZoneArray(1,41) = "7" ZoneArray(1,42) = "6" ZoneArray(1,43) = "7" ZoneArray(1,44) = "6" ZoneArray(1,45) = "7" ZoneArray(1,46) = "6" ZoneArray(1,47) = "7" ZoneArray(1,48) = "6" ZoneArray(1,49) = "5" ZoneArray(1,50) = "6" ZoneArray(1,51) = "5" ZoneArray(1,52) = "7" ZoneArray(1,53) = "6" ZoneArray(1,54) = "7" ZoneArray(1,55) = "6" ZoneArray(1,56) = "7" ZoneArray(1,57) = "6" ZoneArray(1,58) = "5" ZoneArray(1,59) = "6" ZoneArray(1,60) = "5" ZoneArray(1,61) = "7" ZoneArray(1,62) = "6" ZoneArray(1,63) = "7" ZoneArray(1,64) = "6" ZoneArray(1,65) = "7" ZoneArray(1,66) = "6" ZoneArray(1,67) = "5" ZoneArray(1,68) = "6" ZoneArray(1,69) = "5" ZoneArray(1,70) = "6" ZoneArray(1,71) = "5" ZoneArray(1,72) = "5" ZoneArray(1,73) = "4" ZoneArray(1,74) = "5" ZoneArray(1,75) = "4" ZoneArray(1,76) = "3" ZoneArray(1,77) = "4" ZoneArray(1,78) = "3" ZoneArray(1,79) = "4" ZoneArray(1,80) = "5" ZoneArray(1,81) = "4" ZoneArray(1,82) = "5" ZoneArray(1,83) = "4" ZoneArray(1,84) = "5" ZoneArray(1,85) = "3" ZoneArray(1,86) = "4" ZoneArray(1,87) = "2" ZoneArray(1,88) = "3" ZoneArray(1,89) = "2" ZoneArray(1,90) = "3" ZoneArray(1,91) = "4" ZoneArray(1,92) = "0" ZoneArray(1,93) = "0" ZoneArray(1,94) = "0" ZoneArray(1,95) = "5" ZoneArray(1,96) = "0" %>
Shopping Cart

<% Response.Write "" strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Weight, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) Weight = 0 CARTS = 0 CARTSCC = 0 Shipcost1 = 0 Shipcost2 = 0 If Not ScootsDB.EOF Then Do While NOT ScootsDB.EOF PartID = ScootsDB("PartID") PartDesc = ScootsDB("PartDesc") Quantity = ScootsDB("Quantity") Price = ScootsDB("Price") Price1 = ScootsDB("Price1") WeightD = ScootsDB("Weight") Weight = Weight + (Quantity * WeightD) Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" 'Cart Flat Rate Shipping If PartID = "JRCART" OR PartID = "BIGCART" Then CARTS = CARTS + Quantity End If 'Response.Write CARTS & ":" If PartID = "Chrome" Then CARTSCC = CARTSCC + Quantity End If 'Response.Write CARTSCC & ":cc
" ScootsDB.MoveNext Loop ScootsDB.Close Set ScootsDB = Nothing If Request.Form("zipcode") <> "" Then zip2 = Request.Form("zipcode") Session("zipcode") = zip2 End If If Session("zipcode") <> "" Then Session("zonecode") = Left(Session("zipcode"),3) Place = 96 For i = 0 to 96 If cInt(ZoneArray(0,i)) > cInt(Session("zonecode")) Then Place = i-1 i = 999 End If Next Session("Zone") = ZoneArray(1,Place) Shipcost1 = 0 If CARTS < 25 AND CARTS <> 0 Then strSQL = "SELECT * FROM Shipping WHERE Zone = " & cInt(Session("Zone")) & ";" 'Response.Write strSQL Set ScootsDB = ScootsConn.Execute(strSQL) If NOT ScootsDB.EOF Then Shipcost1 = Shipcost1 + ScootsDB(CARTS) 'Response.Write Shipcost1 & ":" Else 'Response.Write "
Bad Session" End If ScootsDB.Close Set ScootsDB = Nothing End If If CARTSCC < 25 AND CARTSCC <> 0 Then strSQL = "SELECT * FROM ShippingCC WHERE Zone = " & cInt(Session("Zone")) & ";" 'Response.Write strSQL Set ScootsDB = ScootsConn.Execute(strSQL) If NOT ScootsDB.EOF Then Shipcost1 = Shipcost1 + ScootsDB(CARTSCC) 'Response.Write Shipcost1 & ":" Else 'Response.Write "
Bad Session" End If ScootsDB.Close Set ScootsDB = Nothing End If End If Session("Weight") = Weight Else %> <% End If 'UPS Shipping 'Response.Write "" If (Request.Form("zipcode") <> "" OR Session("zipcode") <> "") AND Weight <> 0 Then Function getShipMethod(shipCode) getShipMethod = "Unknown" if shipCode = "01" then getShipMethod = "Next Day Air" if shipCode = "02" then getShipMethod = "2nd Day Air" if shipCode = "03" then getShipMethod = "Ground" if shipCode = "07" then getShipMethod = "Worldwide Express" if shipCode = "08" then getShipMethod = "Worldwide Expedited" if shipCode = "11" then getShipMethod = "Standard" if shipCode = "12" then getShipMethod = "3-Day Select" if shipCode = "13" then getShipMethod = "Next Day Air Saver" if shipCode = "14" then getShipMethod = "Next Day Air Early AM" if shipCode = "54" then getShipMethod = "Worldwide Express Plus" if shipCode = "59" then getShipMethod = "2nd Day Air AM" if shipCode = "65" then getShipMethod = "Express Saver" End Function Dim mydoc Set mydoc=Server.CreateObject("Microsoft.XMLDOM") mydoc.async=false Dim objXMLHTTP, xmlhttp Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP") upsurl = "https://www.ups.com/ups.app/xml/Rate" If Weight = 0 Then Weight = 1 End If zip1 = "92845" zip2 = Session("zipcode") If Len(zip2) = 3 Then zip2 = zip2 & "00" Session("zipcode") = zip2 End If country = "US" 'response.write "Weight: " & Weight & "
" 'response.write "Source Postal Code: " & zip1 & "
" 'response.write "Destionatinon Country Code: " & country & "
" 'response.write "Destination Postal Code: " & zip2 & "
" first = "checked" if cdbl(weight) <= 150 then upsxml = "9B9B1F8DC51DF902REG111111REG111111Rating and Service1.0001Rateshop01
" & zip1 upsxml = upsxml & "
" & zip2 & "" & country & "
11" upsxml = upsxml & "02PackageRate Shopping" & weight & "" 'upsxml = upsxml & "02PackageRate Shopping" & weight & "" upsxml = upsxml & "
" xmlhttp.Open "POST", upsurl, false xmlhttp.Send(upsxml) xmlresponse = xmlhttp.responseText mydoc.loadxml(xmlhttp.responseText) if mydoc.parseError.errorcode <> 0 then response.write "The xml document is not well-formed" else 'Response.write "Here is the rate information returned LIVE in REAL TIME from the UPS server:

" Set Root = mydoc.documentElement 'Check to make sure it was a success Set NodeList = Root.getElementsByTagName("ResponseStatusDescription") For Each Elem in NodeList result = Elem.firstChild.nodeValue 'response.write "The request was a " & result & "
" if result = "Failure" then Set NodeList = Root.getElementsByTagName("ErrorDescription") For Each ErrorText in NodeList 'response.write ErrorText.firstChild.nodeValue & "
Click here to fix your zipcode." next else 'Request was successfully processed, display the rates 'response.write "
" set nodes=mydoc.selectNodes("RatingServiceSelectionResponse/RatedShipment") for i = 0 to nodes.length - 1 set codes = nodes(i).selectNodes("Service/Code") '''Response.write "" set codes1 = nodes(i).selectNodes("TotalCharges/MonetaryValue") set ground = nodes(0).selectNodes("TotalCharges/MonetaryValue") ' If i=0 and realprice >= 25 and Weight < 50 then ' codes1(0).text = cCur(0) ' i = nodes.length ' ElseIf i=0 and realprice < 25 and Weight < 50 then ' codes1(0).text = cCur(8.00) ' i = nodes.length ' End If '''Response.write "" If first <> "" Then first = "" End If next shiptext1 = ground(0).text end if Next end if else 'Total shipment is over 150 lbs Dim weights(), requests(), responses(), rates(), grounds() numpackages = fix((weight - 1) / 150) redim weights(numpackages) redim requests(numpackages) redim responses(numpackages) redim rates(6) redim grounds(0) 'Response.write "
Total rates for " & fix((weight - 1) / 150) + 1 & " packages:

" for i = 0 to numpackages if i <> numpackages then weights(i) = 150 else weights(i) = (weight mod 150) if weights(i) = 0 then weights(i) = 150 end if requests(i) = "9B9B1F8DC51DF902REG111111REG111111Rating and Service1.0001Rateshop01
" & zip1 & "
" & zip2 & "" & country & "
1102PackageRate Shopping" & weights(i) & "
" xmlhttp.Open "POST", upsurl, false xmlhttp.Send(requests(i)) responses(i) = xmlhttp.responseText mydoc.loadxml(responses(i)) if mydoc.parseError.errorcode<>0 then response.write "The xml document is not well-formed" else Set Root = mydoc.documentElement 'Check to make sure it was a success Set NodeList = Root.getElementsByTagName("ResponseStatusDescription") For Each Elem in NodeList result = Elem.firstChild.nodeValue if result = "Failure" then Set NodeList = Root.getElementsByTagName("ErrorDescription") For Each ErrorText in NodeList 'response.write ErrorText.firstChild.nodeValue & "
Click here to fix your zipcode." next else 'Request was successfully processed, display the rates set nodes=mydoc.selectNodes("RatingServiceSelectionResponse/RatedShipment") for j = 0 to nodes.length - 1 set codes = nodes(j).selectNodes("Service/Code") if i = numpackages then '''Response.write "" end if set codes1 = nodes(j).selectNodes("TotalCharges/MonetaryValue") set ground = nodes(0).selectNodes("TotalCharges/MonetaryValue") grounds(0) = cdbl(rates(0)) + cdbl(ground(0).text) rates(j) = cdbl(rates(j)) + cdbl(codes1(0).text) if i = numpackages then '''Response.write "" If first <> "" Then first = "" End If end if next shiptext1 = rates(0) end if Next end if next end if 'End UPS Shipping Else shiptext1 = 0 End If strSQL = "SELECT TotalQuant, TotalPrice FROM Cart WHERE CartID LIKE '" & CookCartID & "'" Set ScootsDB = ScootsConn.Execute(strSQL) If NOT ScootsDB.EOF Then 'Response.Write "TP: " & ScootsDB("TotalPrice") & "
" 'Response.Write "st1: " & shiptext1 & "
" 'Response.Write "sc1: " & Shipcost1 & "
" 'Response.Write "sc2: " & Shipcost2 & "
" Response.Write "" _ & "" Response.Write "" Response.Write "" ScootsDB.Close Set ScootsDB = Nothing Else Response.Write "" End If ScootsConn.Close Set ScootsConn = Nothing %>
Part Number Description Quantity Remove Price Total
" & PartID &"" & PartDesc &"$" & formatnumber(Price,2) & "$" & formatnumber(Price1,2) & "
  No products added yet!        
UPS " & getshipmethod(codes(0).text) & ":" ' If realprice >= 25 and Weight < 50 then ' Response.Write "FREE!" ' Else '''Response.Write "$" & formatnumber(codes1(0).text,2) ' End If '''Response.Write "
UPS " & getshipmethod(codes(0).text) & ":$" & formatnumber(rates(j),2) & "
     Est. Shipping:" _ & "$" & formatnumber(cCur(shiptext1)+cCur(Shipcost1),2) & "
    Total Price:" Response.Write "$" Response.Write ScootsDB("TotalPrice")+shiptext1+Shipcost1 & "
<% 'Response.Write "Zone: " & Session("Zone") & "
" 'Response.Write "Shipping by weight: " & shiptext1 & "
" 'Response.Write "Flat rate cart shipping: " & Shipcost1 & "
" %>

Enter your zipcode for estimated shipping cost: " size="5" maxlength="5">
Click here to view a map of our estimated delivery times across the country.


<% If CARTS = "" OR CARTS < 25 Then %>
<% End If %>

There is a 7.75% sales tax for residents of California.
Please contact us for orders with more than 24 carts.

 
Call Us: 1-866-891-5513, Email Us: parts@sterlingequipmentco.com
All contents © copyright 2004 Laundry Cart Co., All rights reserved.