<%
If Request.QueryString("action") = "verify" then
Dim first_name, last_name, address, StrState, Zip, StrInt, EmailAdd, Err1, Err2, Err3, Err4, Err5, Err6, Err7, Err8, Err9, StrPhone, StrFax, StrComments
first_name = Request.Form("first_name")
last_name = Request.Form("last_name")
address = Request.Form("address")
StrCity = Request.Form("city")
StrState = Request.Form("state")
Zip = Request.Form("zip")
StrInt = Request.Form("int")
EmailAdd = Request.Form("email")
StrPhone = Request.Form("phone")
StrFax = Request.Form("fax")
StrContact = Request.Form("contact")
Session("contact") = StrContact
StrComments = Request.Form("comments")
If first_name = "" then
Err1 = True
Else
Session("first_name") = first_name
End if
If last_name = "" then
Err2 = True
Else
Session("last_name") = last_name
End if
If address = "" then
Err3 = True
End if
If StrCity = "" then
Err9 = True
End if
If StrState = "" then
Err4= True
End if
If Zip = "" then
Err5 = True
End if
If StrInt = "#" then
Err6 = True
Else
If InStr(StrInt, "|") > 0 then
StrIntTMP = Split(StrInt, "|")
Session("StrInt") = StrIntTMP(0)
Session("ReqMid") = StrIntTMP(1)
Else
Session("StrInt") = StrInt
End If
End if
If Request.Form("contact") = "2" and EmailAdd = "" then
Err10 = True
End If
If Request.Form("contact") = "3" and StrPhone = "" then
Err7 = True
End If
If Request.Form("contact") = "4" and StrFax = "" then
Err8 = True
End If
If EmailAdd <> "" then
If NOT InStr(EmailAdd, ".") > 1 then
ErrEmail = True
End if
If InStr(EmailAdd, "@") < 1 then
ErrEmail = True
End If
End if
'# If all the error strings are empty proceed on with inserting into database
If Err1 <> True and Err2 <> True and Err3 <> True and Err4 <> True and Err5 <> True and Err6 <> True and Err7 <> True and Err8 <> True and Err9 <> True and Err10 <> True and ErrEmail <> True then
'Insert into to db
'Redirect
set my_conn = Server.CreateObject("ADODB.Connection")
my_conn.Open ConnString
strSql = "INSERT INTO requestinfo ([first_name],[last_name],[email],[address],[city],[state],[zip],[phone],[fax],[contact_method],[comments],[date],[intrest]) VALUES (" & "'" & first_name & "','" & last_name & "','" & email & "','" & address & "','" & StrCity & "','" & StrState & "','" & zip & "','" & phone & "','" & fax & "','" & StrContact & "','" & StrComments & "','" & Date & "','" & StrInt & "')"
Set rs = my_conn.execute(strSql)
Response.Redirect "default.asp?view=thank.you"
End if
End if
%>
</p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF">
<div align="center">
<form name="form5" method="post" action="default.asp?view=Info&action=verify">
<table width="49%" border="0" cellspacing="0" cellpadding="3">
<tr>
<td width="42%"> </td>
<td width="58%"> </td>
</tr>
<tr bgcolor="#EEEEEE">
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b>Request
Information</b> </font></div>
</td>
<td width="58%"> </td>
</tr>
<% If Err1 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide a first name, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<% End If %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*First
Name</font></div>
</td>
<td width="58%">
<input type="text" name="first_name" size="15" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("first_name")) %>">
</td>
</tr>
<% If Err2 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide a last name, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<% End if %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*Last
Name</font></div>
</td>
<td width="58%">
<input type="text" name="last_name" size="20" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("last_name")) %>">
</td>
</tr>
<% If ErrEmail <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide a valid email address.</font></b></font></div>
</td>
</tr>
<% End if %>
<% If Err10 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>You
requested us to contact you via email, please fill in your email
number.</b></font></div>
</td>
</tr>
<%End if %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Email</font></div>
</td>
<td width="58%">
<input type="text" name="email" size="35" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("email")) %>">
</td>
</tr>
<% If Err3 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide a mailing address, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<% End if %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*Mailing
Address</font></div>
</td>
<td width="58%">
<input type="text" name="address" size="30" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("address")) %>">
</td>
</tr>
<% If Err9 <> "" then %>
<tr>
<td colspan="2" height="8">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide your city, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<% End If %>
<tr>
<td height="8">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*City</font></div>
</td>
<td height="8">
<input type="text" name="city" size="15" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("city")) %>" maxlength="15">
</td>
</tr>
<% If Err4 <> "" then %>
<tr>
<td colspan="2" height="8">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide </font><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">your</font></b></font><font color="#FF0000">
state, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<% End if %>
<tr>
<td width="42%" height="35">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*State</font></div>
</td>
<td width="58%" height="35">
<select name="State">
<option value='' <% If Request.QueryString("action") <> "verify" then Response.Write("Selected") %>>Select State</option>
<option value="AL" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "AL" then Response.Write("Selected") %>>Alabama</option>
<option value="AK" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "AK" then Response.Write("Selected") %>>Alaska</option>
<option value="AZ" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "AZ" then Response.Write("Selected") %>>Arizona</option>
<option value="AR" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "AR" then Response.Write("Selected") %>>Arkansas</option>
<option value="CA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "CA" then Response.Write("Selected") %>>California</option>
<option value="CO" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "CO" then Response.Write("Selected") %>>Colorado</option>
<option value="CT" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "CT" then Response.Write("Selected") %>>Connecticut</option>
<option value="DE" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "DE" then Response.Write("Selected") %>>Delaware</option>
<option value="DC" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "DC" then Response.Write("Selected") %>>District Of Columbia</option>
<option value="FL" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "FL" then Response.Write("Selected") %>>Florida</option>
<option value="GA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "GA" then Response.Write("Selected") %>>Georgia</option>
<option value="GU" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "GU" then Response.Write("Selected") %>>Guam</option>
<option value="HI" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "HI" then Response.Write("Selected") %>>Hawaii</option>
<option value="ID" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "ID" then Response.Write("Selected") %>>Idaho</option>
<option value="IL" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "IL" then Response.Write("Selected") %>>Illinois</option>
<option value="IN" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "IN" then Response.Write("Selected") %>>Indiana</option>
<option value="IA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "IA" then Response.Write("Selected") %>>Iowa</option>
<option value="KS" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "KS" then Response.Write("Selected") %>>Kansas</option>
<option value="KY" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "KY" then Response.Write("Selected") %>>Kentucky</option>
<option value="LA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "LA" then Response.Write("Selected") %>>Louisiana</option>
<option value="ME" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "ME" then Response.Write("Selected") %>>Maine</option>
<option value="MD" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MD" then Response.Write("Selected") %>>Maryland</option>
<option value="MA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MA" then Response.Write("Selected") %>>Massachusetts</option>
<option value="MI" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MI" then Response.Write("Selected") %>>Michigan</option>
<option value="MN" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MN" then Response.Write("Selected") %>>Minnesota</option>
<option value="MS" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MS" then Response.Write("Selected") %>>Mississippi</option>
<option value="MO" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MO" then Response.Write("Selected") %>>Missouri</option>
<option value="MT" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "MT" then Response.Write("Selected") %>>Montana</option>
<option value="NE" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NE" then Response.Write("Selected") %>>Nebraska</option>
<option value="NV" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NV" then Response.Write("Selected") %>>Nevada</option>
<option value="NH" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NH" then Response.Write("Selected") %>>New Hampshire</option>
<option value="NJ" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NJ" then Response.Write("Selected") %>>New Jersey</option>
<option value="NM" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NM" then Response.Write("Selected") %>>New Mexico</option>
<option value="NY" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NY" then Response.Write("Selected") %>>New York</option>
<option value="NC" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "NC" then Response.Write("Selected") %>>North Carolina</option>
<option value="ND" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "ND" then Response.Write("Selected") %>>North Dakota</option>
<option value="OH" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "OH" then Response.Write("Selected") %>>Ohio</option>
<option value="OK" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "OK" then Response.Write("Selected") %>>Oklahoma</option>
<option value="OR" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "OR" then Response.Write("Selected") %>>Oregon</option>
<option value="PA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "PA" then Response.Write("Selected") %>>Pennsylvania</option>
<option value="PR" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "PR" then Response.Write("Selected") %>>Puerto Rico</option>
<option value="RI" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "RI" then Response.Write("Selected") %>>Rhode Island</option>
<option value="SC" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "SC" then Response.Write("Selected") %>>South Carolina</option>
<option value="SD" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "SD" then Response.Write("Selected") %>>South Dakota</option>
<option value="TN" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "TN" then Response.Write("Selected") %>>Tennessee</option>
<option value="TX" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "TX" then Response.Write("Selected") %>>Texas</option>
<option value="UT" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "UT" then Response.Write("Selected") %>>Utah</option>
<option value="VT" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "VT" then Response.Write("Selected") %>>Vermont</option>
<option value="VA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "VA" then Response.Write("Selected") %>>Virginia</option>
<option value="WA" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "WA" then Response.Write("Selected") %>>Washington</option>
<option value="WV" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "WV" then Response.Write("Selected") %>>West Virginia</option>
<option value="WI" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "WI" then Response.Write("Selected") %>>Wisconsin</option>
<option value="WY" <% If Request.QueryString("action") = "verify" and Request.Form("state") = "WY" then Response.Write("Selected") %>>Wyoming</option>
</select>
</td>
</tr>
<% If Err5 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
provide a zip code, and then re-submit the form.</font></b></font></div>
</td>
</tr>
<%End if %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">*Zip</font></div>
</td>
<td width="58%">
<input type="text" name="zip" size="7" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("zip")) %>" maxlength="7">
</td>
</tr>
<% If Err7 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>You
requested us to contact you via phone, please fill in your phone
number.</b> </font></div>
</td>
</tr>
<% End If %>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Phone</font></div>
</td>
<td width="58%">
<input type="text" name="phone" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("phone")) %>" size="15">
</td>
</tr>
<% If Err8 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font color="#FF0000" face="Verdana, Arial, Helvetica, sans-serif" size="2"><b>You
requested us to contact you via fax, please fill in your fax
number.</b></font></div>
</td>
</tr>
<% End if %>
<tr>
<td width="42%">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">Fax</font></div>
</td>
<td width="58%">
<input type="text" name="fax" <%=WriteOutline %> value="<% If Request.QueryString("action") = "verify" then Response.Write(Request.Form("fax")) %>" size="15">
</td>
</tr>
<tr>
<td width="42%">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">*Contact
me via:</font> </div>
</td>
<td width="58%">
<select name="contact">
<option value="1" <% If Request.QueryString("action") = "verify" and Request.Form("contact") ="1" then Response.Write("Selected") %>>Mailing
Address</option>
<option value="2" <% If Request.QueryString("action") = "verify" and Request.Form("contact") ="2" then Response.Write("Selected") %>>Email</option>
<option value="3" <% If Request.QueryString("action") = "verify" and Request.Form("contact") ="3" then Response.Write("Selected") %>>Phone</option>
<option value="4" <% If Request.QueryString("action") = "verify" and Request.Form("contact") ="4" then Response.Write("Selected") %>>Fax</option>
</select>
</td>
</tr>
<% If Err6 <> "" then %>
<tr>
<td colspan="2">
<div align="center"><font size="2" face="Verdana, Arial, Helvetica, sans-serif"><b><font color="#FF0000">Please
select something from the list.</font></b></font></div>
</td>
</tr>
<% End if %>
<tr>
<td width="42%">
<div align="right"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">*Intrests:</font></div>
</td>
<td width="58%">
<%Set conn = Server.CreateObject("ADODB.Connection")
conn.Open "Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" & Server.MapPath("database.mdb") & ";"
Set rs = Server.CreateObject("ADODB.Recordset")
mySQL = "SELECT model_name, mID from specs"
rs.Open mySQL, conn, 1, 1 'Opened as Read-Only
Response.Write "<select name=""int"">"
Response.Write "<option value=" & Chr(34) & "#" & Chr(34) & ">" & "Choose one..." & "</option>"
Response.Write "<option value=" & Chr(34) & "Company" & Chr(34) & ">" & "Company" & "</option>"
Do while not rs.eof
If Request.QueryString("action") = "verify" then
If Request.Form("int") = rs("model_name") & "|" & rs("mID") then
SelectedText = " Selected"
Else
SelectedText = ""
End if
End if
Response.Write "<option value=" & Chr(34) & rs("model_name") & "|" & rs("mID") & Chr(34) & SelectedText & ">" & rs("model_name") & "</option>"
rs.movenext
loop
Response.Write "</select>"
%>
<input type="hidden" name="thedate" value="<% Dim strThisDate
strThisDate = Split(FormatDateTime(Date,1),",",2)
Response.Write(strThisDate(1))%>">
</td>
</tr>
<tr>
<td width="42%">
<div align="right"><font size="2" face="Verdana, Arial, Helvetica, sans-serif">Comments:</font></div>
</td>
<td width="58%">
<textarea name="comments" cols="25" rows="5"></textarea>
</td>
</tr>
<tr>
<td width="42%"><img src="images/small/spacer.gif" width="145" height="9"></td>
<td width="58%">
<input type="submit" name="Submit3" value="Submit">
<font color="#999999" size="1" face="Verdana, Arial, Helvetica, sans-serif">(*)Required
fields</font></td>
</tr>
</table>
</form>
</div>
</td>
</tr>
</table>
<p>
<% End Sub %>
</p>
<p>
<%
'########### THANK YOU PAGE
If Session("first_name") = "" then
Response.Redirect "default.asp?" & pgQ & "=Info"
End if
Dim first_name, last_name, StrInt, StrContact, ReqMid
first_name = Session("first_name")
last_name = Session("last_name")
StrInt = Session("StrInt")
StrContact = Session("contact")
ReqMid = Session("ReqMid")
Session.abandon
%>
</p>
<p>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td bgcolor="#FFFFFF">
<table width="50%" border="0" cellspacing="0" cellpadding="0" height="20" align="center">
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td bgcolor="#EEEEEE"><b><font size="4" face="Verdana, Arial, Helvetica, sans-serif"><img src="images/small/RightArrow.gif" width="12" height="10"><font size="3">Thank
you <%= Capit(first_name) & " " & CapIt(last_name) %></font></font></b></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="2"><img src="images/small/spacer.gif" width="12" height="10"></font></td>
</tr>
<tr>
<td><font face="Verdana, Arial, Helvetica, sans-serif" size="3"><img src="images/small/spacer.gif" width="12" height="10">Thank
you for your intrest in our <i><%=StrInt%></i>, we are now processing your request,
<% If StrContact = "1" then %>
and will mail the information out to you soon.
<% End if %>
<% If StrContact = "2" then %>
and will contact you by email soon.
<% End if %>
<% If StrContact = "3" then %>
and will contact you by phone soon.
<% End if %>
<% If StrContact = "4" then %>
and will contact you by fax soon.
<% End if %>
</font></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>
<% If ReqMid <> "" then%>
<div align="center"><font face="Verdana, Arial, Helvetica, sans-serif" size="2">View
online information on the <a href="default.asp?view=Model&mID=<%=ReqMid%>"><%=StrInt%></a></font></div>
<%End If%>
</td>
</tr>
<tr>
<td>
<div align="center"></div>
</td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td> </td>
</tr>
</table>
</td>
</tr>
</table>