<%@Language="VBScript"%>
<%
Option Explicit
Response.Buffer = True
DIM strHdrLine1, strHdrLine2, strTitle, intCountryID, strCountry
intCountryID = Request.QueryString("country_id")
'-------------------------------------------------------------------------------------------
'
' for US and Canada, uncomment block #1 and comment block #2
' for International, the opposite
'
' this is the extent of differences between versions
'
'-------------------------------------------------------------------------------------------
'*START BLOCK #1 ****************************************************************************************
if (Len(intCountryID) < 1) OR ((intCountryID <> "1") AND (intCountryID <> "2")) then
intCountryID = 1
End If
strHdrLine1="default"
strHdrLine2="Lit"
strTitle = "Survey"
Select Case intCountryID
Case 1
strCountry = "United States"
Case 2
strCountry = "Canada"
End Select
'on error resume next
dim strError
call BuildHeader()
if Request.Form("button") <> "Submit Request" then
call DisplayForm(intCountryID)
else
call ProcessForm(intCountryID, strError)
call DisplayResponse(strError)
end if
call BuildFooter()
'------------------------------------------------------------------------------
private sub DisplayForm(byval intCountryID)
'on error resume next
Dim objCmd, objRst, intReturnCode
%>
<%
end sub
'------------------------------------------------------------------------------
private sub ProcessForm(byval intCountryID, byref strError)
'on error resume next
dim objCdo, strMessageBody, strAddress, x
'check for basic information
if Len(Request.Form("first_name")) <= 0 then
strError = strError+ "- First name required "
end if
if Len(Request.Form("last_name")) <= 0 then
strError = strError+ "- Last name required "
end if
if (Len(Request.Form("address")) <= 0) OR (Len(Request.Form("city")) <= 0) OR (Len(Request.Form("state")) <= 0) OR (Len(Request.Form("postal_code")) <= 0) then
strError = strError+ "- A complete address is necessary to receive literature "
end if
if Len(strError) <= 0 then
'create address
strAddress = vbtab &Request.Form("address") &vbcrlf _
&vbtab &vbtab &Request.Form("city") &", " &Request.Form("state") &" " &Request.Form("postal_code")
' personal information
strMessageBody = "Dryvit TerraNeo Promotion" &vbcrlf &vbcrlf _
&"Personal Information:" &vbcrlf _
&"Name:" &vbtab &vbtab &Request.Form("first_name") &" " &Request.Form("last_name") &vbcrlf _
&"Title:" &vbtab &Request.Form("title") &vbcrlf _
&"Company:" &vbtab &Request.Form("company") &vbcrlf _
&"Address:" &strAddress & vbcrlf _
& "Country:" &vbtab &Request.Form("country") & vbcrlf
If Request.Form("firmType") <> "-1" Then _
strMessageBody = strMessageBody & "Firm Type: "& Request.Form("firmType") & vbcrlf
strMessageBody = strMessageBody _
&"Telephone:" &vbtab &Request.Form("phone") &vbtab & "Ext.:" &vbtab & Request.Form("phoneext")&vbcrlf _
&"Fax:" &vbtab &vbtab &Request.Form("fax") &vbcrlf _
&"E-mail:" &vbtab &Request.Form("email") &vbcrlf _
&"Web:" &vbtab &vbtab &Request.Form("web") &vbcrlf &vbcrlf _
&"Did you have difficulty viewing the TerraNeo movie? "&vbcrlf _
&vbtab & Request.Form("viewing") & vbcrlf _
&"Would like a TerraNeo Color Chart:" &vbcrlf _
&vbtab & Request.Form("color_chart") & vbcrlf & vbcrlf _
&"Currently working on a project? " & Request.Form("project") & vbcrlf
If Request.Form("project") = "yes" Then
strMessageBody = strMessageBody & _
"Project Name: " & Request.Form("project_name") & vbcrlf &_
"Project Address: " & Request.Form("project_address") & vbcrlf & _
vbtab & Request.Form("project_city") & ", "& Request.Form("project_state") & Request.Form("project_zip") & vbcrlf &_
vbtab & Request.Form("country") & vbcrlf &_
"Project Size: "& Request.Form("project_size") & " sq. ft. " & vbcrlf
If Request.Form("stage") <> "-1" Then _
strMessageBody = strMessageBody & "Stage: "& Request.Form("stage") & vbcrlf
If Request.Form("project_type") <> "-1" Then _
strMessageBody = strMessageBody & "Type of Project: "& Request.Form("project_type") & vbcrlf
If Request.Form("substrate") <> "-1" Then _
strMessageBody = strMessageBody & "Substrate Type: "& Request.Form("substrate") & vbcrlf
If Request.Form("market_type") <> "-1" Then _
strMessageBody = strMessageBody & "Market Type: "& Request.Form("market_type") & vbcrlf
End If
strMessageBody = strMessageBody & vbcrlf _
&"Considering Using TerraNeo?" &vbcrlf _
&Request.Form("use_terraneo") &vbcrlf _
&"Contact Preference:" &vbcrlf _
&Request.Form("contact_preference") &vbcrlf _
&"Keep on Mailing List?" &vbcrlf _
&Request.Form("mailing_list") &vbcrlf _
&"Customer would like:" &vbcrlf _
&Request.Form("contact") &vbcrlf
' comments
strMessageBody = strMessageBody & vbcrlf _
&"Additional Information:" &vbcrlf _
&Request.Form("comments") &vbcrlf &vbcrlf
' create and build the message object
set objCdo = Server.CreateObject("CDONTS.NewMail")
objCdo.From = "webmaster@dryvit.com"
objCdo.Subject = "Dryvit TerraNeo Promotion"
objCdo.Body = strMessageBody
if intCountryID = 2 then
objCdo.To = "info@dryvit.ca"
else
objCdo.To = "techservice@dryvit.com" '"info@dryvit.com"
end if
' send the message
objCdo.Send
set objCdo = Nothing
end if
end sub
private sub BuildHeader()
%>
<%
end sub
'------------------------------------------------------------------------------
private sub BuildFooter()
%>
<%
end sub
%>