%
Set conn = Server.CreateObject("ADODB.Connection")
conn.ConnectionString = "DRIVER=SQL Server;server=64.106.150.189;uid=brsql;pwd=sql2tdst;database=seitz;"
conn.Open
if session("client") = "" then
response.redirect("login.asp")
end if
total = 7
if form("finish") = "true" then
session("product") = form("answer")
response.redirect("quickgears_finish.asp")
end if
if query("question") <> "" then
if form("answer") = "" then
nextquestion = cint(query("question"))
error = "Please answer all questions."
else
session("question" & query("question")) = form("question")
session("answer" & query("question")) = form("answer")
nextquestion = cint(query("question")) + 1
end if
sql = "Select id,laborcost,"
for i = 1 to nextquestion
if i > 1 then
sql = sql & ","
end if
sql = sql & "question" & i & ",answer" & i
next
sql = sql & " from plasticQuote where "
for i = 1 to nextquestion
if i > 1 then
sql = sql & " and "
end if
if i = nextquestion then
sql = sql & "question" & i & " <> '' and answer" & i & " <> '' "
else
sql = sql & "question" & i & " = '" & fc(session("question" & i)) & "' and answer" & i & " = '" & fc(session("answer" & i)) & "'"
end if
next
'sql = sql & " order by "
else
nextquestion = 1
sql = "Select id,laborcost,question1,answer1 from plasticQuote "
end if
for i = 1 to total
if i > 1 then
'sql = sql & ","
end if
'sql = sql & "question" & i & ",answer" & i
next
Set rs = Conn.Execute(sql)
if rs.eof then
session("reason") = "Because of some of the options you are interested in, we will have a sales representative contact you."
response.redirect("salescontact.asp")
end if
%>
Seitz Corporation
<% if error <> "" then %><%= error %> <% end if %>