<%
function FieldOK(FieldName)
if Request.Form(FieldName) = "" and Request.Form("send") then
FieldOK = false
else
FieldOK = true
end if
end function
function FieldWithDefaultOK(DefaultValue, FieldName)
if Request.Form(FieldName) = DefaultValue and Request.Form("send") then
FieldWithDefaultOK = false
else
FieldWithDefaultOK = true
end if
end function
%>
<%if Request.Form("send") <> "" then
if Request.Form("Prenom") = "" or FieldWithDefaultOk("Jour", "Day") = false or FieldWithDefaultOk("Mois", "Month") = false or FieldWithDefaultOk("Year", "Year") = false or Request.Form("CodeRegional") = "" or Request.Form("Tel1") = "" or Request.Form("Tel2") = "" or Request.Form("Courriel") = "" then
Response.Write("Please fill all mandatory fields *")
end if
end if
if Request.Form("Prenom") <> "" and FieldWithDefaultOk("Jour", "Day") and FieldWithDefaultOk("Mois", "Month") and FieldWithDefaultOk("Year", "Year") and Request.Form("CodeRegional") <> "" and Request.Form("Tel1") <> "" and Request.Form("Tel2") <> "" and Request.Form("Courriel") <> "" then
Set Mailer = Server.CreateObject("CDONTS.NewMail")
' Variable ajoutée par Max
Dim bodyMail
' Construire le contenu du mail
bodyMail = bodyMail & "IDENTIFICATION " & vbCrLf & vbCrLf
bodyMail = bodyMail & "Name: " & Request.Form("Titre") & " " & Request.Form("Prenom") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Telephone: " & Request.Form("CodeRegional") & "-" & Request.Form("Tel1") & "-" & Request.Form("Tel2") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Email: " & Request.Form("Courriel") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Appointment date: " & Request.Form("Day") & " " & Request.Form("Month") & " " & Request.Form("Year") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Optometrist: " & Request.Form("Optometriste") & vbCrLf & vbCrLf& vbCrLf & vbCrLf
bodyMail = bodyMail & "OUR CARE " & vbCrLf & vbCrLf
bodyMail = bodyMail & "How would you rate your eye exam? " & Request.Form("examen") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Your optometrist took the time to explain all the stages of your eye exam... " & Request.Form("explications") & vbCrLf & vbCrLf
bodyMail = bodyMail & "In your opinion, would you say that the eye exam you received was thorough and complete? " & Request.Form("complet") & vbCrLf & vbCrLf& vbCrLf & vbCrLf
bodyMail = bodyMail & "OUR SERVICES " & vbCrLf & vbCrLf
bodyMail = bodyMail & "The communications with our office to arrange your appointment were: " & Request.Form("communication") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Would you say that our clinic is easily accessible? " & Request.Form("acces") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Your greeting at reception was: " & Request.Form("accueil") & vbCrLf & vbCrLf
bodyMail = bodyMail & "During your visit, did we meet all your needs? " & Request.Form("besoins") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Do you have any suggestions on how we could improve? " & Request.Form("suggestions") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Improvements suggestions: " & Request.Form("suggestionamelioration") & vbCrLf & vbCrLf & vbCrLf & vbCrLf
bodyMail = bodyMail & "OUR PRODUCTS" & vbCrLf & vbCrLf
bodyMail = bodyMail & "Would you say that our selection of eye glass frames is: " & Request.Form("choixmontures") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Would you say that our selection of sunglasses is: " & Request.Form("choixsolaires") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Did we find the perfect frame for you? " & Request.Form("montureideale") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Did our clinic staff answer all of your questions and offer appropriate solutions regarding our products offered? " & Request.Form("choixdeproduits") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Are there any brands of frames or sunglasses that we didn’t have in stock that you would recommend we carry? " & Request.Form("montures") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Frames suggestions: " & Request.Form("monturessuggestion") & vbCrLf & vbCrLf
bodyMail = bodyMail & "If you did not purchase frames during your visit, please specify the main reason: " & Request.Form("raisonachat") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Other reason: " & Request.Form("raisonachatautre") & vbCrLf & vbCrLf & vbCrLf & vbCrLf
bodyMail = bodyMail & "RELATIONSHIP WITH YOU " & vbCrLf & vbCrL
bodyMail = bodyMail & "How did you hear about our clinic? " & Request.Form("hear") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Referal: " & Request.Form("hearautre") & vbCrLf& vbCrLf
bodyMail = bodyMail & "Would you recommend our clinic to your family and/or friend? " & Request.Form("recommend") & vbCrLf & vbCrLf
bodyMail = bodyMail & "I would not recommend for the wollowing reasons: " & Request.Form("recommendno") & vbCrLf& vbCrLf
bodyMail = bodyMail & "Would you be interested in being kept informed of clinic promotions, offers or updates by email? " & Request.Form("contactme") & vbCrLf & vbCrLf
bodyMail = bodyMail & "Comments: " & Request.Form("remarques") & vbCrLf & vbCrLf
Mailer.Body = bodyMail
' Envoyer le mail
Mailer.From = Request.Form("Courriel")
Mailer.To = "dr.robock@cogeco.net"
Mailer.Cc = Request.Form("Courriel")
Mailer.Subject = "Survey - Family Optometry Dr E.L Robock"
Mailer.Send
%>
// Thank you for your participation.
Your comments will be taken into consideration.
We wish you a very pleasant day! //
<%
else
%>
Our aim is to offer you the highest quality service and care and to be your optometry clinic of choice for all your future eyecare needs.
We thank you for taking the time to fill out the following questionnaire. Your answers will give us a good indicator of what you think about our standard of care, services, products and our relationship with you.