<% Response.Buffer=true %> Laundry Carts <% Dim CartsConn Dim CartsDB Set CartsConn=Server.CreateObject("ADODB.Connection") CartsConn.Open "DSN=LaundryCarts;" ' don: ' disable mail till we move to the WIN2000 SERVER (NEWFPS) Dim objCDO4 'Set objCDO4 = Server.CreateObject("CDONTS.NewMail") Dim objCDO5 'Set objCDO5 = Server.CreateObject("CDONTS.NewMail") Dim CookCartID CookCartID = Session("CookCartID") CustID = Session("CustID") %>
<% Sub GetFormItem(sItemName, sAliasName, iMinLength, iMaxLength, fRequired) varItem = TRIM(Request.Form(sItemName)) If sAliasName = "" Then sAliasName = sItemName If fRequired Then If varItem = "" Then Session("CustomError") = Session("CustomError") _ & "Please enter at least "&iMinLength&" characters in the """ _ & sAliasName & """ field.
" Else If Len(varItem) < iMinLength Then Session("CustomError") = _ Session("CustomError") & "Please enter at least " _ & iMinLength &" characters in the """ _ & sAliasName & """ field.
" If Len(varItem) > iMaxLength Then Session("CustomError") = _ Session("CustomError") & "Please enter at most " _ & iMaxLength &" characters in the """ _ & sAliasName & """ field.
" End If Else varItem = TRIM(Request.Form(sItemName)) End If Session(sItemName) = varItem End Sub Sub ServerSidePasswordValidation _ (sPassword1, sPassword2, iMin, iMax,bRequired) Call GetFormItem(sPassword1, "Password", iMin, iMax, bRequired) Call GetFormItem(sPassword2, "Verify Password", iMin, iMax, bRequired) Session("Password") = session(sPassword1) bValidPassword = ( session(sPassword1) = session(sPassword2) ) if Not bValidPassword Then Session("CustomError") = _ Session("CustomError") _ & " Both Password field must has the same value!
" End Sub Sub ServerSideEmailValidation _ (sItemName, sAliasName, iMinLength, iMaxLength, bRequired) Call GetFormItem (sItemName, sAliasName, iMinLength, iMaxLength, bRequired) If (InStr(session(sItemName),"@") < 2) Then Session("CustomError") = Session("CustomError") _ & "Not a valid Email address (missing '@')
" Else If ( InStr(InStr(session(sItemName),"@"),session(sItemName),".") < _ InStr(session(sItemName),"@")+2 ) Then Session("CustomError") = _ Session("CustomError") _ & "Not a valid Email address (missing '.')
" End If End Sub CheckCartID = Request.Form("CartID") If CheckCartID = 258 Then Call GetFormItem ("BFirstName", "First Name", 3, 50, True) Call GetFormItem ("BLastName", "Last Name", 3, 50, True) Call GetFormItem ("BBusiness", "Business Name", 3, 50, False) Call GetFormItem ("BAddress1", "Billing Address", 3, 50, True) Call GetFormItem ("BAddress2", "Address2", 3, 50, False) Call GetFormItem ("BCity", "Billing City", 3, 50, True) Call GetFormItem ("BState", "Billing State", 2, 4, True) Call GetFormItem ("BZip", "Billing Zip Code", 5, 10, True) Call GetFormItem ("BPhone", "Billing Phone", 7, 20, True) Call GetFormItem ("CCNumber" & CookCartID & "", "Credit Card Number", 14, 20, True) Call GetFormItem ("CCName", "Credit Card Name", 3, 50, True) Call GetFormItem ("CCMonth", "Credit Card Exp. Month", 2, 3, True) Call GetFormItem ("CCYear", "Credit Card Exp. Year", 4, 5, True) Call GetFormItem ("CCCode" & CookCartID & "", "Credit Card Security Code", 3, 5, True) Call GetFormItem ("HearUs", "Heard About Us", 3, 50, True) Call GetFormItem ("CCType", "Credit Card Type", 2, 50, True) Call ServerSidePasswordValidation ("passw1", "passw2", 3, 20, True) Call ServerSideEmailValidation ("email", "E-Mail", 3, 50, True) End If %> Checkout - <% If Session("CustomError") <> "" Then %>Verify Information<% Else %>Order Complete!<% End If %>

<% If Session("CustomError") <> "" Then Response.Write "Error: " & Session("CustomError") & "" Response.Write "
Click here to go back and fix your errors" Session("CustomError") = "" Else Dim shipping shipping = cCur(Session("ShippingCost")) shiptext = Session("ShippingCost") %> <% strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Weight, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) If Not CartsDB.EOF Then Do While NOT CartsDB.EOF PartID = CartsDB("PartID") PartDesc = CartsDB("PartDesc") Quantity = CartsDB("Quantity") Price = CartsDB("Price") Price1 = CartsDB("Price1") Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" Response.Write "" CartsDB.MoveNext Loop CartsDB.Close Set CartsDB = Nothing Else %> <% End If strSQL = "SELECT TotalQuant, TotalPrice FROM Cart WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) If Session("SalesTax") > 0 Then Response.Write "" End If 'Shipping Response.Write "" 'Handling Response.Write "" 'Total Response.Write "" CartsDB.Close Set CartsDB = Nothing %>
Part Number Description Quantity   Price Total
" & PartID &"" & PartDesc &" $" & formatnumber(Price,2) & "$" & formatnumber(Price1,2) & "
  No products added yet!        
    CA Sales Tax:$" & formatnumber(Session("SalesTax"),2) & "
    Estimated " & Session("ShippingMethod") & ":$" & formatnumber(shiptext,2) & "
    Handling:$5.00
    Total Price:$" & formatnumber(CartsDB("TotalPrice")+Session("SalesTax")+formatnumber(shiptext,2)+5,2) & "
Thank you for your order.
Your order receipt will be e-mailed to you.
Back to Home
<% Session("CCNumber") = Request.Form("CCNumber"&CookCartID) Session("CCCode") = Request.Form("CCCode"&CookCartID) Session("CCDate") = Session("CCMonth") + "/" + Session("CCYear") Session("Password") = Request.Form("passw1") Session("HearUs") = Request.Form("HearUs") ' Session("CartID") = Request.Form("CartID") ' Session("Email") = Request.Form("Email") If Session("BAddress2") = "" Then Session("BAddress2") = "Empty" End If If Session("SAddress2") = "" Then Session("SAddress2") = "Empty" End If Email = Session("EMail") strSQL = "SELECT * FROM Customer WHERE Email LIKE '" & EMail & "'" Set Carts = CartsConn.Execute(strSQL) If Carts.EOF Then strSQL = "INSERT INTO Customer (CartID,Email,Password,BFirstName,BLastName,BBusiness,BAddress1,BAddress2,BCity,BState,BZip,BPhone,CCType,CCNumber,CCDate,CCName,CCCode,SFirstName,SLastName,Shipto,SBusiness,SAddress1,SAddress2,SCity,SState,SZip,SPhone,HearUs) " strSQL = strSQL + "VALUES ('" & CookCartID & "','" & Session("Email") & "','" & Session("Password") & "','" & Session("BFirstName") & "','" & Session("BLastName") & "','" & Session("BBusiness") & "','" & Session("BAddress1") & "','" & Session("BAddress2") & "','" & Session("BCity") & "','" & Session("BState") & "','" & Session("BZip") & "','" & Session("BPhone") & "'," strSQL = strSQL + "'" & Session("CCType") & "','" & Session("CCNumber") & "','" & Session("CCDate") & "','" & Session("CCName") & "','" & Session("CCCode") & "','" & Session("SFirstName") & "','" & Session("SLastName") & "','" & Session("Shipto") & "','" & Session("SBusiness") & "','" & Session("SAddress1") & "','" & Session("SAddress2") & "','" & Session("SCity") & "','" & Session("SState") & "','" & Session("SZip") &"','" & Session("SPhone") & "','" & Session("HearUs") & "')" Else strSQL = "UPDATE Customer SET CartID = '" & CookCartID & "',Email = '" & Session("Email") & "',Password = '" & Session("Password") & "',BFirstName = '" & Session("BFirstName") & "',BLastName = '" & Session("BLastName") & "',BBusiness = '" & Session("BBusiness") & "',BAddress1 = '" & Session("BAddress1") & "',BAddress2 = '" & Session("BAddress2") & "',BCity = '" & Session("BCity") & "',BState = '" & Session("BState") & "',BZip = '" & Session("BZip") & "',BPhone = '" & Session("BPhone") & "'," strSQL = strSQL + "CCType = '" & Session("CCType") & "',CCNumber = '" & Session("CCNumber") & "',CCDate = '" & Session("CCDate") & "',CCName = '" & Session("CCName") & "',CCCode = '" & Session("CCCode") & "',SFirstName = '" & Session("SFirstName") & "',SLastName = '" & Session("SLastName") & "',Shipto = '" & Session("Shipto") & "',SBusiness = '" & Session("SBusiness") & "',SAddress1 = '" & Session("SAddress1") & "',SAddress2 = '" & Session("SAddress2") & "',SCity = '" & Session("SCity") & "',SState = '" & Session("SState") & "',SZip = '" & Session("SZip") & "',SPhone = '" & Session("SPhone") & "',HearUs = '" & Session("HearUs") & "' WHERE Email LIKE '" & EMail & "'" End If Carts.Close Set Carts = Nothing 'Response.Write strSQL CartsConn.Execute(strSQL) 'objCDO4.To = "parts@laundry-carts.com" 'objCDO4.From = "orders@laundry-carts.com" 'objCDO4.bcc = "stoke@delci.com, doug@delci.com, rachel@sterlingequipmentco.com, parts@sterlingequipmentco.com" '''objCDO4.To = "aholbroo@student.umass.edu" 'mailbody = "Email: '" & Session("Email") & "'
Password: '" & Session("Password") & "'
BFirstName: '" & Session("BFirstName") & "'
BLastName: '" & Session("BLastName") & "'
BAddress1: '" & Session("BAddress1") & "'
BAddress2: '" & Session("BAddress2") & "'
BCity: '" & Session("BCity") & "'
BState: '" & Session("BState") & "'
BZip: '" & Session("BZip") & "'
BPhone: '" & Session("BPhone") & "'
" 'mailbody = strSQL + "CCType: '" & Session("CCType") & "'
CCNumber: '" & Session("CCNumber") & "'
CCDate: '" & Session("CCDate") & "'
CCName: '" & Session("CCName") & "'
SFirstName: '" & Session("SFirstName") & "'
SLastName: '" & Session("SLastName") & "'
SAddress1: '" & Session("SAddress1") & "'
SAddress2: '" & Session("SAddress2") & "'
SCity: '" & Session("SCity") & "'
SState: '" & Session("SState") & "'
SZip: '" & Session("SZip") & "'
SPhone: '" & Session("SPhone") & "'" HTMLcart = "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" strSQL = "SELECT CartID, PartID, IDCateg, Quantity, Price, PartDesc, Quantity * Price AS Price1 FROM CartItems WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) Do While NOT CartsDB.EOF HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" CartsDB.MoveNext Loop CartsDB.Close Set CartsDB = Nothing strSQL = "SELECT TotalQuant, TotalPrice FROM Cart WHERE CartID LIKE '" & CookCartID & "'" Set CartsDB = CartsConn.Execute(strSQL) If Session("SalesTax") > 0 Then HTMLcart = HTMLcart + "" End If HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" HTMLcart = HTMLcart + "" CartsDB.Close Set CartsDB = Nothing HTMLcart = HTMLcart + "
Part NumberDescriptionQuantity PriceTotal
" & CartsDB("PartID") &"" & CartsDB("PartDesc") &"" & CartsDB("Quantity") &" $" & formatnumber(CartsDB("Price"),2) & "$" & formatnumber(CartsDB("Price1"),2) & "
    CA Sales Tax:$" & formatnumber(Session("SalesTax"),2) & "
    UPS Ground:$" & formatnumber(Session("ShippingCost"),2) & "
    Handling:$5.00
    Total Price:$" & formatnumber((cCur(CartsDB("TotalPrice")) + Session("SalesTax") + 5 + cCur(Session("ShippingCost"))),2) & "
" HTML = HTMLcart + "

" HTML = HTML + "" HTML = HTML + "
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Billing Information
" HTML = HTML + "* Required Information
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
First Name:*
" HTML = HTML + Session("BFirstName") & "
Last Name:*
" HTML = HTML + Session("BLastName") & "
Business Name:*
" HTML = HTML + Session("BBusiness") & "
Address 1:*
" HTML = HTML + Session("BAddress1") & "
Address 2:
" HTML = HTML + Session("BAddress2") & "
City:*
" HTML = HTML + Session("BCity") & "
State:*
" HTML = HTML + Session("BState") & "
ZIP/Postal Code:*
" HTML = HTML + Session("BZip") & "
Phone:*
" HTML = HTML + Session("BPhone") & "
E-Mail:*
" HTML = HTML + Session("Email") & "
Shipping Information
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Ship to:
" HTML = HTML + Session("Shipto") & "
First Name:
" HTML = HTML + Session("SFirstName") & "
Last Name:
" HTML = HTML + Session("SLastName") & "
Business Name:
" HTML = HTML + Session("SBusiness") & "
Address 1:
" HTML = HTML + Session("SAddress1") & "
Address 2:
" HTML = HTML + Session("SAddress2") & "
City:
" HTML = HTML + Session("SCity") & "
State:
" HTML = HTML + Session("SState") & "
ZIP/Postal Code:
" HTML = HTML + Session("SZip") & "
Phone:
" HTML = HTML + Session("SPhone") & "
Payment Options
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Cardholder's Name:
" HTML = HTML + Session("CCName") & "
Payment Type:
" HTML = HTML + Session("CCType") & "
Card Number:
xx-" HTML = HTML + Right(Session("CCNumber"),4) & "
Exp. Date:
" HTML = HTML + Session("CCDate") & "
Sec. Code:
" HTML = HTML + Session("CCCode") & "
" HTML = HTML + "
Password
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Password:*
" HTML = HTML + Session("password") HTML = HTML + "
Heard about us:
" HTML = HTML + Session("HearUs") HTML = HTML + "
" 'objCDO4.Subject = "Laundry Carts Order Form" 'objCDO4.BodyFormat=0 'objCDO4.MailFormat=0 'objCDO4.Body = HTML '''''objCDO4.Send 'objCDO5.To = Email 'objCDO5.From = "orders@laundry-carts.com" ''''mailbody = "Email: '" & Session("Email") & "'
Password: '" & Session("Password") & "'
BFirstName: '" & Session("BFirstName") & "'
BLastName: '" & Session("BLastName") & "'
BAddress1: '" & Session("BAddress1") & "'
BAddress2: '" & Session("BAddress2") & "'
BCity: '" & Session("BCity") & "'
BState: '" & Session("BState") & "'
BZip: '" & Session("BZip") & "'
BPhone: '" & Session("BPhone") & "'
" ''''mailbody = strSQL + "CCType: '" & Session("CCType") & "'
CCNumber: '" & Session("CCNumber") & "'
CCDate: '" & Session("CCDate") & "'
CCName: '" & Session("CCName") & "'
SFirstName: '" & Session("SFirstName") & "'
SLastName: '" & Session("SLastName") & "'
SAddress1: '" & Session("SAddress1") & "'
SAddress2: '" & Session("SAddress2") & "'
SCity: '" & Session("SCity") & "'
SState: '" & Session("SState") & "'
SZip: '" & Session("SZip") & "'
SPhone: '" & Session("SPhone") & "'" HTML = HTMLcart + "

" HTML = HTML + "
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Billing Information
" HTML = HTML + "* Required Information
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
First Name:*
" HTML = HTML + Session("BFirstName") & "
Last Name:*
" HTML = HTML + Session("BLastName") & "
Business Name:*
" HTML = HTML + Session("BBusiness") & "
Address 1:*
" HTML = HTML + Session("BAddress1") & "
Address 2:
" HTML = HTML + Session("BAddress2") & "
City:*
" HTML = HTML + Session("BCity") & "
State:*
" HTML = HTML + Session("BState") & "
ZIP/Postal Code:*
" HTML = HTML + Session("BZip") & "
Phone:*
" HTML = HTML + Session("BPhone") & "
E-Mail:*
" HTML = HTML + Session("Email") & "
Shipping Information
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Ship to:
" HTML = HTML + Session("Shipto") & "
First Name:
" HTML = HTML + Session("SFirstName") & "
Last Name:
" HTML = HTML + Session("SLastName") & "
Business Name:
" HTML = HTML + Session("SBusiness") & "
Address 1:
" HTML = HTML + Session("SAddress1") & "
Address 2:
" HTML = HTML + Session("SAddress2") & "
City:
" HTML = HTML + Session("SCity") & "
State:
" HTML = HTML + Session("SState") & "
ZIP/Postal Code:
" HTML = HTML + Session("SZip") & "
Phone:
" HTML = HTML + Session("SPhone") & "
Payment Options
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Card Type:*
" HTML = HTML + Session("CCType") & "
" HTML = HTML + "" HTML = HTML + "" HTML = HTML + "
Password:*
" HTML = HTML + Session("password") HTML = HTML + "
" HTML = HTML + "

Please call 1-800-891-5513 with questions.

" 'objCDO5.Subject = "Laundry Carts Order Confirmation" 'objCDO5.BodyFormat=0 'objCDO5.MailFormat=0 'objCDO5.Body = HTML 'objCDO5.Send If CustID = "" Then strSQL = "SELECT CustomerID FROM Customer WHERE CartID LIKE " & CookCartID & "" Set Cart = CartsConn.Execute(strSQL) CustID = Cart("CustomerID") Cart.Close Set Cart = Nothing End If strSQL = "UPDATE Cart SET Ordered = True, Status = 1,OrderDate = '" & Date & "',CustID = " & CustID & ", ShippingMethod = '" & Session("ShippingMethod") & "', ShippingCost = " & shipping & ", Weight = " & Session("Weight") & ", SalesTax = " & Session("SalesTax") & " WHERE CartID LIKE " & CookCartID & "" CartsConn.Execute(strSQL) 'Response.Write strSQL Session("CartID")="" Session("CookCartID")="" Session.Abandon End If CartsConn.Close Set CartsConn = Nothing %>

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