%@LANGUAGE="VBSCRIPT"%>
<%
Option Explicit
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://sgcarpet.com/shopathome-update.php"
Response.End
%>
<%
'--------------------------------------------------------
' Shop-At-Home Form for S & G Carpet
' Created on: 7/17/2008
' Created by: John Simonson, Webstream Dynamics
' Last modified on: 9/21/2008
' The page requires the follwoing files:
' 1. shop-at-home.css
' 2. shop-at-home.js
' 3. A redirect thank you page
'
' ***Be sure to edit the variables with ***
'--------------------------------------------------------
'---- *** EMAIL TO ADDRESS *** ----
Dim varEmailTo
'--- varEmailTo = "stevemarsh@sgcarpet.com, ingridglover@sgcarpet.com" ----
varEmailTo = "tamal.sarker@gmail.com"
'---- *** email subject line *** ----
Dim varSubject
varSubject = "Shop At Home Appointment Request"
'---- *** Message to alert user that certain days may not apply *** ----
Dim varDateMessage
varDateMessage = "Please do not select today's date."
'---- *** Redirect Page if form was completed successfully *** ----
Dim varRedirectURL
varRedirectURL = "thankyou-shop.html"
'---- *** Confirmation paragraph of customer *** ----
Dim customermsg
customermsg = ""
'---- *** State the shop-at-home service is in *** ----
Dim state
state = "CA."
'---- Today's Date
Dim varCurrentDate
varCurrentDate = Date()
'---- Current Month
Dim varMonth
varMonth = Month(varCurrentDate) - 1
'---- Current Day
Dim varDay
varDay = Day(varCurrentDate)
'---- Current Year
Dim varYear
varYear = Year(varCurrentDate)
'---- Decision maker Agree to be there
Dim makeragree
makeragree = ""
'---- Months of the Year
Dim Mnth
Mnth = Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December")
dim timeslot, areas, products, hearabout, request_dated
dim fullname, address, city, zipcode, dayphone, eveningphone, email, comments
dim msg, printmsg, errormsg, x, y
dim objCDO
msg = ""
errormsg = ""
if request.form("btnSubmit") = "SUBMIT" then
msg = "Date Submitted: " & varCurrentDate & vbCRLF & vbCRLF
msg = msg & "-------- CUSTOMER INFORMATION -------- " & vbCRLF & vbCRLF
if trim(request.form("fullname")) <> "" then
fullname = trim(request.form("fullname"))
msg = msg & "Name: " & fullname & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Full Name.
"
End if
if trim(request.form("address")) <> "" then
address = trim(request.form("address"))
msg = msg & "Address: " & address & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Address.
"
End if
if trim(request.form("city")) <> "" then
city = trim(request.form("city"))
msg = msg & "City: " & city & ", " & state & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your City.
"
End if
if trim(request.form("zipcode")) <> "" then
zipcode = trim(request.form("zipcode"))
msg = msg & "Postal Code: " & zipcode & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Postal Code.
"
End if
if trim(request.form("dayphone")) <> "" then
dayphone = trim(request.form("dayphone"))
msg = msg & "Daytime Phone: " & dayphone & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Daytime Phone Number.
"
End if
if trim(request.form("eveningphone")) <> "" then
eveningphone = trim(request.form("eveningphone"))
msg = msg & "Evening Phone: " & eveningphone & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Evening Phone Number.
"
End if
if trim(request.form("email")) <> "" then
email = trim(request.form("email"))
msg = msg & "Email address: " & email & vbCRLF & vbCRLF
else
errormsg = errormsg & "Please be sure to tell us your Email address.
"
End if
msg = msg & "-------- APPOINTMENT INFORMATION -------- " & vbCRLF & vbCRLF
'if (request.form("mnth") <> "" and request.form("dy") <> "" and request.form("yrs") <> "") then
'if request.form("appointmentdate") <> "" then
' request_dated = request.form("appointmentdate") 'request.form("mnth") & "/" & request.form("dy") & "/" & request.form("yrs")
'
' if (CSTR(varCurrentDate) = CSTR(request_dated)) then
' errormsg = errormsg & "Please select a Date for your appointment.
"
' else
' msg = msg & "Appointment Date: " & request_dated & vbCRLF
' end if
'else
' errormsg = errormsg & "Please select at an Appointment Date.
"
'End if
'if request.form("timeslot") <> "0" and request.form("timeslot") <> "" then
' timeslot = request.form("timeslot")
' msg = msg & "Appointment Time Slot: " & timeslot & vbCRLF & vbCRLF
' else
' errormsg = errormsg & "Please select an appointment Time Slot.
"
' End if
msg = msg & "-------- AREAS, FLOORING TYPES & BUDGET -------- " & vbCRLF & vbCRLF
if trim(request.form("FlooringType")) <> "" then
msg = msg & "Interested in... " & trim(request.form("FlooringType")) & vbCRLF
End if
if trim(request.form("NumberOfRooms")) <> "" then
msg = msg & "Number Of Rooms: " & trim(request.form("NumberOfRooms")) & vbCRLF
End if
if trim(request.form("BudgetRange")) <> "" then
msg = msg & "Total Budget Range: $" & trim(request.form("BudgetRange")) & vbCRLF
End if
msg = msg & vbCRLF & "-------- CUSTOMER COMMENTS -------- " & vbCRLF & vbCRLF
if request.form("hearabout") <> "0" and request.form("hearabout") <> "" then
msg = msg & "Heard About Us: " & request.form("hearabout") & vbCRLF
hearabout = request.form("hearabout")
else
errormsg = errormsg & "Please tell us how you heard about us.
"
End if
if trim(request.form("comments")) <> "" then
comments = trim(request.form("comments"))
'-- no scripting code allowed in comments
comments = replace(comments, "javascript", "")
comments = replace(comments, "<", "")
comments = replace(comments, "script", "")
comments = replace(comments, ">", "")
comments = replace(comments, "http://", "")
comments = replace(comments, "www.", "")
msg = msg & "Customer Comments:" & vbCRLF & comments
else
comments = ""
end if
if errormsg = "" then
customermsg = customermsg & vbCRLF & vbCRLF & msg
call sendmail(varEmailTo, email, varSubject, customermsg)
Response.Redirect varRedirectURL
end if
'printmsg = replace(msg, vbCRLF, "
")
End if
'------------------------------------------------------
' sendmail - send an email to visitor and to the store
'------------------------------------------------------
sub sendmail(emailTo, emailFrom, subject, BodyString)
dim sch, cdoConfig, cdoMessage
sch = "http://schemas.microsoft.com/cdo/configuration/"
Set cdoConfig = CreateObject("CDO.Configuration")
With cdoConfig.Fields
.Item(sch & "sendusing") = 2 ' cdoSendUsingPort
.Item(sch & "smtpserver") = "backup2.telepacific.net"
.update
End With
Set cdoMessage = CreateObject("CDO.Message")
With cdoMessage
Set .Configuration = cdoConfig
.From = "shopathome@sgcarpet.com"
.To = "shopathome@sgcarpet.com"
.Subject = subject
.TextBody = BodyString
.Send
End With
Set cdoMessage = Nothing
Set cdoConfig = Nothing
end sub
%>
Shop at Home for your New FlooringWe Bring the Store to your Door! |
Shop at Home with 3 Simple Steps:
|