% option explicit
const dsn = "prestocd"
const url = "prestocd.com"
dim atsignpos, periodpos, emaillen
dim connobj, sql, recordset, primarykey
dim action, message, error
dim mailobj, sbody
dim name, company, address, citystatezip, phone, email, fax, sendfax, sendemail, sendmail, websiteurl, wheredidyouhear, timing, comments, specialuse, whatcontent, replication, budget, contentproduction, orderqty, servicebusiness
set connobj = server.createobject("adodb.connection")
connobj.open dsn
error = true
action = request.form("action")
select case action
case "Submit this Form"
name = request.form("name")
company = request.form("company")
address = request.form("address")
citystatezip = request.form("citystatezip")
phone = request.form("phone")
email = request.form("email")
fax = request.form("fax")
sendfax = request.form("sendfax")
if sendfax = "1" then
sendfax = 1
else
sendfax = 0
end if
sendemail = request.form("sendemail")
if sendemail = "1" then
sendemail = 1
else
sendemail = 0
end if
sendmail = request.form("sendmail")
if sendmail = "1" then
sendmail = 1
else
sendmail = 0
end if
websiteurl = request.form("websiteurl")
wheredidyouhear = request.form("wheredidyouhear")
timing = request.form("timing")
comments = request.form("comments")
specialuse = request.form("specialuse")
whatcontent = request.form("whatcontent")
replication = request.form("replication")
if replication = "1" then
replication = 1
else
replication = 0
end if
budget = request.form("budget")
contentproduction = request.form("contentproduction")
if contentproduction = "1" then
contentproduction = 1
else
contentproduction = 0
end if
orderqty = request.form("orderqty")
servicebusiness = request.form("servicebusiness")
if name = "" or company = "" or address = "" or citystatezip = "" or phone = "" or email = "" or fax = "" or (sendmail = 0 and sendfax = 0 and sendemail = 0) then
message = "Sorry, but you have left blank fields. Fields marked with an asterik (*) are required. Please fill out these fields and try again."
elseif not checkemail(email) then
message = "Sorry, but you've entered an invalid email format. Email addresses should look like yourname@prestocd.com. Please examine your email and try again."
else
error = false
sql = "INSERT INTO priceforms (timedate, name, company, address, citystatezip, phone, email, fax, sendfax, sendemail, sendmail, websiteurl, wheredidyouhear, timing, comments, specialuse, whatcontent, replication, budget, contentproduction, orderqty, servicebusiness, active) VALUES ("
sql = sql & "'" & now & "', "
sql = sql & "'" & replace(name,"'","''") & "', "
sql = sql & "'" & replace(company,"'","''") & "', "
sql = sql & "'" & replace(address,"'","''") & "', "
sql = sql & "'" & replace(citystatezip,"'","''") & "', "
sql = sql & "'" & replace(phone,"'","''") & "', "
sql = sql & "'" & replace(email,"'","''") & "', "
sql = sql & "'" & replace(fax,"'","''") & "', "
sql = sql & sendfax & ", "
sql = sql & sendemail & ", "
sql = sql & sendmail & ", "
if websiteurl = "" then
sql = sql & "null,"
else
sql = sql & "'" & replace(websiteurl,"'","''") & "', "
end if
sql = sql & "'" & replace(wheredidyouhear,"'","''") & "', "
sql = sql & "'" & replace(timing,"'","''") & "', "
if comments = "" then
sql = sql & "null,"
else
sql = sql & "'" & replace(comments,"'","''") & "', "
end if
if specialuse = "" then
sql = sql & "null,"
else
sql = sql & "'" & replace(specialuse,"'","''") & "', "
end if
if whatcontent = "" then
sql = sql & "null,"
else
sql = sql & "'" & replace(whatcontent,"'","''") & "', "
end if
sql = sql & replication & ", "
if budget = "" then
sql = sql & "null,"
elseif not isnumeric(budget) then
sql = sql & "0,"
else
sql = sql & "'" & budget & "', "
end if
sql = sql & contentproduction & ", "
if orderqty = "" then
sql = sql & "null,"
elseif not isnumeric(orderqty) then
sql = sql & "0,"
else
sql = sql & orderqty & ", "
end if
if servicebusiness = "" then
sql = sql & "null,"
else
sql = sql & "'" & replace(servicebusiness,"'","''") & "', "
end if
sql = sql & "1)"
connobj.execute sql,,1
sbody = "
PrestoCD"
sbody = sbody & ""
sbody = sbody & ""
sbody = sbody & "Below are the results from the Presto CD Pricing Form.
"
sbody = sbody & "It was placed on " & now & " Pacific Standard Time.
"
sbody = sbody & "PrestoCD Pricing Form Information
"
sbody = sbody & "
"
sbody = sbody & "- Name : " & name & "
"
sbody = sbody & "- Address : " & address & "
"
sbody = sbody & "- City, State, Zip : " & citystatezip & "
"
sbody = sbody & "- Phone Number : " & phone & "
"
sbody = sbody & "- Email Address : " & email & "
"
sbody = sbody & "- Fax : " & fax & "
"
if sendfax = 1 then
sbody = sbody & "- Send by Fax : Yes" & "
"
else
sbody = sbody & "- Send by Fax : No" & "
"
end if
if sendemail = 1 then
sbody = sbody & "- Send by Email : Yes" & "
"
else
sbody = sbody & "- Send by Email : No" & "
"
end if
if sendmail = 1 then
sbody = sbody & "- Send by Mail : Yes" & "
"
else
sbody = sbody & "- Send by Mail : No" & "
"
end if
sbody = sbody & "- Website URL : " & websiteurl & "
"
sbody = sbody & "- How did you hear about us? " & wheredidyouhear & "
"
sbody = sbody & "- What is your timing? " & timing & "
"
sbody = sbody & "- Comments : " & comments & "
"
sbody = sbody & "- What use do you have in mind? " & specialuse & "
"
sbody = sbody & "- What is your content or describe what you would like for content : " & whatcontent & "
"
if replication = 1 then
sbody = sbody & "- Is your content ready for replication? Yes" & "
"
else
sbody = sbody & "- Is your content ready for replication? No" & "
"
end if
if budget = "" then
sbody = sbody & "- If not, what is your production budget? Not Answered" & "
"
elseif not isnumeric(budget) then
sbody = sbody & "- If not, what is your production budget? $0.00" & "
"
else
sbody = sbody & "- If not, what is your production budget? " & formatcurrency(budget) & "
"
end if
if contentproduction = 1 then
sbody = sbody & "- Would you like information on our content production packages? Yes" & chr(13)
else
sbody = sbody & "
- Would you like information on our content production packages? No" & chr(13)
end if
if orderqty = "" then
sbody = sbody & "
- Estimated order quantity(ies): Not Answered" & "
"
elseif not isnumeric(orderqty) then
sbody = sbody & "- Estimated order quantity(ies): $0.00" & "
"
else
sbody = sbody & "- Estimated order quantity(ies): " & orderqty & "
"
end if
if servicebusiness = "" then
sbody = sbody & "- What product or service do you provide? What does your business do? Not Answered" & "
"
else
sbody = sbody & "- What product or service do you provide? What does your business do? " & servicebusiness & "
"
end if
sbody = sbody & "
"
set mailobj = server.createobject("cdonts.newmail")
mailobj.Body = sbody
mailobj.To = "d@mediaannex.com"
mailobj.Bcc = "robert@choiceinternet.com"
mailobj.Subject = "Presto CD Pricing Form"
mailobj.From = email
mailobj.BodyFormat = 0
mailobj.MailFormat = 0
mailobj.Importance = 1
mailobj.send
set mailobj = nothing
message = "Your email was received at " & now & " and has successfully been entered into our database. We will get back to you ASAP if you asked a question or had a comment. Thank you for stopping by at PrestoCD.com!"
end if
case else
message = "PrestoCD are available for as low as 89 cents each which includes a four-color screen and a clear plastic case. We are committed to providing consistently competitive pricing along with a broad menu of packaging and distribution options to maximize your results."
end select %>
PrestoCD - Pricing Request Form