<%@ Language=VBScript %> <% Response.Buffer=true %> Laundry Carts <% Dim LaunConn Dim CookCartID Dim objFSO Set LaunConn=Server.CreateObject("ADODB.Connection") LaunConn.Open "DSN=LaundryCarts;" ' Populate Variables from record in DB from Querystring CustID = CInt(Request.querystring("CustID")) %><% if Session("level") <> 4 and Request.querystring("CustID") <> CustID2 then response.redirect ("http://www.laundry-carts.com") end if 'Variables can be populated from previous form (Request.Form) 'Make sure the data is formatted properly since this is where updates will be first seen BFirstName=CStr(CapsValid(Request.Form("BFirstName"))) BLastName=CStr(CapsValid(Request.Form("BLastName"))) BAddress1=CStr(CapsValid(Request.Form("BAddress1"))) BAddress2=CStr(CapsValid(Request.Form("BAddress2"))) BCity=CStr(CapsValid(Request.Form("BCity"))) BState=CStr(UCase(Request.Form("BState"))) BZip=CStr(FormatZip(Request.Form("BZip"))) BPhone=CStr(FormatPhoneNumber(Request.Form("BPhone"))) Email=CStr(Request.Form("Email")) If BAddress2="" Then BAddress2=" " End If If Request.Form("SameAs") = "ON" Then SFirstName = BFirstName SLastName = BLastName SAddress1 = BAddress1 SAddress2 = BAddress2 SCity = BCity SState = BState SZip = BZip SPhone = BPhone Else SFirstName=CStr(CapsValid(Request.Form("SFirstName"))) SLastName=CStr(CapsValid(Request.Form("SLastName"))) SAddress1=CStr(CapsValid(Request.Form("SAddress1"))) SAddress2=CStr(CapsValid(Request.Form("SAddress2"))) SCity=CStr(CapsValid(Request.Form("SCity"))) SState=CStr(UCase(Request.Form("SState"))) SZip=CStr(FormatZip(Request.Form("SZip"))) 'SPhone=CStr(FormatPhoneNumber(Request.Form("SPhone"))) End If SecLvl=CStr(Request.Form("SecLvl")) CCType=CStr(Request.Form("CCType")) CCName=CStr(CapsValid(Request.Form("CCName"))) CCDate= CStr(Request.Form("CCDate")) CCNumber=CStr(Request.Form("CCNumber")) Password=CStr(Request.Form("passw1")) eacustid=CStr(Request.Form("eacustid")) If SecLvl="" Then SecLvl="1" End If If CCDate="" Then CCDate="1/1/1" End If If CCType="" Then CCDate="Empty" End If If CCName="" Then CCName="Empty" End If If CCNumber="" Then CCDate="XXXXXXXXX" End If If Password="" Then CCDate="Empty" End If 'Call Validation procedures to be sure the entries are legal Call GetFormItem ("BFirstName", "First Name", 3, 50, True) Call GetFormItem ("BLastName", "Last Name", 3, 50, True) 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, 2, True) Call GetFormItem ("SFirstName", "First Name", 3, 50, False) Call GetFormItem ("SLastName", "Last Name", 3, 50, False) Call GetFormItem ("SAddress1", "Billing Address", 3, 50, False) Call GetFormItem ("SAddress2", "Address2", 3, 50, False) Call GetFormItem ("CCName", "Cardholder's Name", 3, 50, False) Call GetFormItem ("CCType", "Card Type",4, 17, False) Call GetFormItem ("CCDate", "", 5, 5, False) 'Call GetFormItem ("CCNumber", "Credit Card Number", 8, 15, False) Call GetFormItem ("SecLvl", "Security Level", 1, 1, True) %>
Account Access
<% CookCartID = Session("CookCartID") CustID = Session("CustID") %>

Modify Customer Information
<%if Session("level") <> 4 and Request.querystring("CustID") <> CustID2 then response.redirect ("http://www.laundry-carts.com") end if 'Need a special case of calling the E-Mail duplication script. If a customer updates there own account, it is acceptable 'to commit the same e-mail address. Otherwise the Default e-mail duplicate error routine shouldbe called strSQL = "SELECT Email, CustomerID FROM Customer WHERE Email = '" & Email & "'" Set RsEML = LaunConn.Execute(strSQL) If NOT RsEML.EOF Then 'Look in the recordset for a CustID not equal to CurrentCustID. If so execute default error RsEML.MoveFirst Do While Not RsEML.EOF If cstr(RsEML("CustomerID")) = cstr(request.querystring("custid")) Then RsEML.MoveNext Else Call ChkEmailDup(Email) exit do End If Loop Else End If RsEML.Close Set RsEML = Nothing If ErrorsMsg = "" Then sql = "UPDATE Customer SET BFirstName = '" & BFirstName & "', BLastName = '" & BLastName & "', " sql = sql & "BAddress1 = '" & BAddress1 & "', BAddress2 = '" & BAddress2 & "', " sql = sql & "BCity = '" & BCity & "', BState = '" & BState & "', " sql = sql & "BZip = '" & BZip & "', BPhone = '" & BPhone & "', " sql = sql & "EMail = '" & EMail & "', SFirstName = '" & SFirstName & "', " sql = sql & "SLastName = '" & SLastName & "', SAddress1 = '" & SAddress1 & "', " sql = sql & "SAddress2 = '" & SAddress2 & "', SCity = '" & SCity & "', " sql = sql & "SState = '" & SState & "', SZip = '" & SZip & "', " sql = sql & "SPhone = '" & SPhone & "', SecLvl = '" & SecLvl & "', " sql = sql & "CCType = '" & CCType & "', CCName = '" & CCName & "', " sql = sql & "CCDate = '" & CCDate & "', Password = '" & Password & "', " sql = sql & "eacustid = '" & eacustid & "'" sql = sql & " WHERE CustomerID LIKE '" & Request.Querystring("custid") & "';" launconn.execute(sql) Response.Write ("
Record Changes accepted as follows:
") set rsCust = LaunConn.Execute("SELECT * FROM Customer WHERE CustomerID = " & request.querystring("CustID") & ";") %>
" id=form1 name=form1> <%if Session("level") >= 4 Then%> <%End If%>
Primary Contact Information
First Name: ">
Last Name: ">
Address 1: ">
Address 2: ">
City: ">
State: ">
Zip: ">
Phone: ">
EMail: ">
Password: ">
Shipping Contact Information
First Name: ">
Last Name: ">
Address 1: ">
Address 2: ">
City: ">
State: ">
Zip: ">
Phone: ">
Account and Payment Information
Credit Card Type:
Credit Card Holder's Name: ">
Credit Card Exp. Date: ">
Credit Card Number: ">
Security Level: ">
laundry-carts Customer ID: ">

Return to Menu <% Else Response.write Session(Error) End If RsCust.Close Set RsCust = Nothing %>

<% LaunConn.Close Set LaunConn = Nothing %>
 
Call Us: 1-866-891-5513, Email Us: parts@laundry-carts.com
All contents © copyright 2004 Laundry Cart Co., All rights reserved.