%
'********************************************************************************
'returns customer info array if exists
'********************************************************************************
Sub getCustomerData( customerinfo, ByRef returnCustomerInfo, iBillIndex )
'customerinfo input collection should have
'*************************************
'' 1=MacsUserID 2=Email
' 3=Password 4=First Name 5=Last Name
' 6=City 7=Zip 8=DayPhone
'*************************************
if IsArray(customerinfo) then
Dim trans0009
Dim iUserID
Dim encryptcustedp
Dim successflag
Set trans0009 = server.CreateObject(webcom & "Trans0009")
trans0009.Company = MACS_COMPANY
trans0009.Division = MACS_DIVISION
trans0009.Host=HOST_NAME
trans0009.Port=WEBREQST
trans0009.CartID = customerinfo(1)
trans0009.Email = customerinfo(2)
trans0009.Password= customerinfo(3)
trans0009.FName = customerinfo(4)
trans0009.Lname=customerinfo(5)
trans0009.City=customerinfo(6)
trans0009.ZipCode=customerinfo(7)
trans0009.DayPhone=customerinfo(8)
trans0009.custEDP=customerinfo(9)
trans0009.CartUpdate = "N"
iUserID = trans0009.GetValue("UserID",0)
if Left(iUserID,1) >= "0" AND Left(iUserID,1) <= "9" then
if trim(trans0009.GetValue("moreflag",0)) = "Y" then
encryptcustedp = trans0009.GetValue("EncryptCustEdp",0)
if encryptcustedp = "00000000000000000" then
encryptcustedp=""
end if
returnCustomerInfo(1) = "Y"
returnCustomerInfo(2) = iUserID 'MACS USER ID
returnCustomerInfo(3) = encryptcustedp 'EncryptCustEdp
returnCustomerInfo(4) = trim(trans0009.GetValue("custedp",0)) 'Customer Edp
returnCustomerInfo(iBillIndex) = trim(trans0009.GetValue("email",0)) 'Email
returnCustomerInfo(iBillIndex+1) = trim(trans0009.GetValue("password",0)) 'password
returnCustomerInfo(iBillIndex+2) = trim(trans0009.GetValue("fname",0)) 'first name
returnCustomerInfo(iBillIndex+3) = "" 'MI
returnCustomerInfo(iBillIndex+4) = trim(trans0009.GetValue("lname",0)) 'last name
returnCustomerInfo(iBillIndex+5) = trim(trans0009.GetValue("compname",0)) 'Company name
returnCustomerInfo(iBillIndex+6) = trim(trans0009.GetValue("street",0)) 'street
returnCustomerInfo(iBillIndex+7) = trim(trans0009.GetValue("ref1",0)) 'ref1
returnCustomerInfo(iBillIndex+8) = trim(trans0009.GetValue("city",0)) 'city
returnCustomerInfo(iBillIndex+9) = getStateID( trim(trans0009.GetValue("state",0)) ) 'state code
returnCustomerInfo(iBillIndex+10) = trim(trans0009.GetValue("zipcode",0)) 'zip
returnCustomerInfo(iBillIndex+11) = getCountryID ( trim(trans0009.GetValue("country",0)) ) 'country code
returnCustomerInfo(iBillIndex+12) = trim(trans0009.GetValue("dayphone",0)) 'day phone
returnCustomerInfo(iBillIndex+13) = trim(trans0009.GetValue("nightphone",0))'eve phone
else
returnCustomerInfo(1) = "N"
if trim(trans0009.GetValue("moreflag",0)) = "M" then
returnCustomerInfo(1) = "M"
end if
returnCustomerInfo(2) = iUserID
'returnCustomerInfo(iBillIndex+2) = customerinfo(4) 'customer entered data
'returnCustomerInfo(9) = customerinfo(5)
'returnCustomerInfo(13) = customerinfo(6)
'returnCustomerInfo(15) = customerinfo(7)
'returnCustomerInfo(17) = customerinfo(8)
end if
else
Dim li
For li=1 to UBOUND(returnCustomerInfo)
returnCustomerInfo(li) = ""
Next
end if
set trans0009 = nothing
end if
End Sub
'********************************************************************************
'sends catalog request
'********************************************************************************
Sub sendCatalogRequest( catreq_info, ByRef ERROR_MESSAGE)
Dim ortn
Dim oR11
Dim oR13
Dim oR15
set ortn =Server.CreateObject(webcom & "weborder")
ortn.Company=MACS_COMPANY
ortn.Division=MACS_DIVISION
ortn.Host=HOST_NAME
ortn.Port=WEBORDER
set oR11=server.CreateObject(webcom & "RecordType11")
oR11.Source=""
oR11.FirstName=catreq_info(1)
oR11.MiddleInit=""
oR11.LastName=catreq_info(2)
oR11.CompanyName=""
oR11.Street=catreq_info(3)
oR11.Ref1=catreq_info(4)
oR11.City=catreq_info(5)
oR11.State=getStateCode(catreq_info(6))
oR11.ZipCode=catreq_info(7)
oR11.CountryCode=getCountryCode(catreq_info(8))
oR11.Phone=""
ortn.RecordType11=oR11.SetRecord
set oR11=nothing
if catreq_info(9) <> "" then
Set oR13=server.CreateObject(webcom & "RecordType13")
oR13.Email = catreq_info(9)
oR13.NetPassword = ""
ortn.RecordType13=oR13.SetRecord
set oR13=nothing
end if
set oR15=server.CreateObject(webcom & "RecordType15")
ortn.RecordType15=oR15.SetRecord
set oR15=nothing
'if debug_flag = "true" then
' Response.Write "SuccessFlag :" & ortn.GetValue("SuccessFlag",0) & "
"
'end if
if Trim(ortn.GetValue("SuccessFlag",0)) <> "Y" then
ERROR_MESSAGE=ortn.GetValue("Message",0)
else
ERROR_MESSAGE = ""
end if
end sub
Sub forgotPassword(email, ByRef ERROR_MESSAGE)
ERROR_MESSAGE = ""
Dim trans69
Set trans69 = server.CreateObject(webcom & "Trans0069")
trans69.Host=HOST_NAME
trans69.Port = WEBREQST
trans69.Company = MACS_COMPANY
trans69.Division = MACS_DIVISION
trans69.Email = email
ERROR_MESSAGE = trans69.GetValue("Message",0)
if trim(trans69.GetValue("SuccessFlag",0)) = "Y" then
ERROR_MESSAGE = "