<% Option Explicit %> <% Dim section : section = "" Dim subsection : subsection = "" %> <% Dim objDAL : Set objDAL = new dataAccessObject Dim objFunctions : Set objFunctions = New GeneralFunctionsObject Dim objValidate : Set objValidate = New ValidationObject Dim intErrNum Dim strErrDesc Dim blnFormPosted : blnFormPosted = False Dim strMode : strMode = "" Dim strCompany Dim strFirstName Dim strLastName Dim strEmail Dim strEmailConfirm Dim strNewsletterConsent Dim i, blnSubscribeAntiques, blnSubscribeFineart, arrNewsletterConsent Dim rsEmailCheck 'Get the mode If Request.Form.Count > 0 Then blnFormPosted = True End If 'retrieve values from the form if necessary If blnFormPosted = True Then 'get values from the form strCompany = Replace(Trim(Request.Form("company")), "'", "''") strFirstName = Replace(Trim(Request.Form("firstname")), "'", "''") strLastName = Replace(Trim(Request.Form("lastname")), "'", "''") strEmail = Replace(Trim(Request.Form("email")), "'", "''") strEmailConfirm = Replace(Trim(Request.Form("email2")), "'", "''") strNewsletterConsent = Request.Form("newsletterConsent") arrNewsletterConsent = Split(strNewsletterConsent, ",") blnSubscribeAntiques = False blnSubscribeFineart = False For Each i in arrNewsletterConsent If Trim(i) = "Antiques" Then blnSubscribeAntiques = True End If If Trim(i) = "Fineart" Then blnSubscribeFineart = True End If Next 'validate the form if necessary - this occurs when the user has clicked publish 'setup the validation rules for each field objValidate.CreateField "company", "Company" objValidate.Fields("company").IsRequired = False objValidate.Fields("company").MaxLength = 100 objValidate.CreateField "firstname", "First Name" objValidate.Fields("firstname").IsRequired = True objValidate.Fields("firstname").MaxLength = 50 'objValidate.Fields("firstname").InputMask = voMaskAlphaNum objValidate.CreateField "lastname", "Last Name" objValidate.Fields("lastname").IsRequired = True objValidate.Fields("lastname").MaxLength = 50 'objValidate.Fields("lastname").InputMask = voMaskAlphaNum objValidate.CreateField "email", "E-mail" objValidate.Fields("email").IsRequired = True objValidate.Fields("email").MaxLength = 50 objValidate.Fields("email").InputMask = voMaskEmail objValidate.CreateField "email2", "E-mail Confirmation" objValidate.Fields("email2").IsRequired = True objValidate.Fields("email2").MaxLength = 50 objValidate.Fields("email2").InputMask = voMaskEmail objValidate.CreateField "newsletterConsent", "E-newsletter type" objValidate.Fields("newsletterConsent").IsRequired = True 'objValidate.Fields("newsletterConsent").InputMask = voInputTypeMultiSelect objValidate.OpenErrorSummaryLineHTML = "
  • " objValidate.CloseErrorSummaryLineHTML = "
  • " 'perform the actual validation objValidate.AutoCheckFormValues() If strEmail <> strEmailConfirm Then objValidate.AppendErrorMessage "email", "The E-mail addresses do not match. Please re-enter your E-mail." End If 'if the data should be added If objValidate.ErrorsExist = False Then 'check if email address exists 'On Error Resume Next Set rsEmailCheck = objDAL.GetNewsletterSubscriptionByEmail(strEmail) intErrNum = Err.Number strErrDesc = Err.Description 'On Error Goto 0 If intErrNum <> 0 Then objFunctions.HandleErrorEx intErrNum, strErrDesc, "DataAccessLayer.GetNewsletterSubscriptionByEmail", true End If If rsEmailCheck.EOF = True Then 'insert email into newsletter subscription table 'On Error Resume Next Call objDAL.SubscribeEmailToNewsletter(strCompany, strFirstName, strLastName, strEmail, blnSubscribeAntiques, blnSubscribeFineart) intErrNum = Err.Number strErrDesc = Err.Description 'On Error Goto 0 If intErrNum <> 0 Then objFunctions.HandleErrorEx intErrNum, strErrDesc, "DataAccessLayer.SubscribeEmailToNewsletter", true End If Response.Redirect "newsletterSubscriptionConfirmation.asp?msg=" & Server.UrlEncode("EmailSubscribed") Else 'update newsletter subscription table by email 'On Error Resume Next Call objDAL.UpdateNewsletterSubscription(strCompany, strFirstName, strLastName, strEmail, blnSubscribeAntiques, blnSubscribeFineart) intErrNum = Err.Number strErrDesc = Err.Description 'On Error Goto 0 If intErrNum <> 0 Then objFunctions.HandleErrorEx intErrNum, strErrDesc, "DataAccessLayer.UpdateNewsletterSubscription", true End If Response.Redirect "newsletterSubscriptionConfirmation.asp?msg=" & Server.UrlEncode("SubsciptionUpdated") End If End If End If %> Rumi Antiques

    NEWSLETTER SUBSCRIPTION

    If you would like to receive information regarding recent additions to our Antique and Fine Art inventory, news and up-coming special events we invite you to subscribe to our e-newsletter.

    * denotes required fields

    <% If objValidate.ErrorsExist = True Then %>

    The following errors have occurred:
    <%=objValidate.ErrorSummary %>

    <% End If %>
    Company  
    * First Name  
    * Last Name  
    * E-mail  
     
    * E-mail Confirmation  
     

    Subscribe me to Rumi Galleries e-newsletter. I am interested in:

     
    checked<% Elseif blnSubscribeAntiques = True Then %>checked<% Else %><% End If %>>

    Antiques

    checked<% Elseif blnSubscribeFineart = True Then %>checked<% Else %><% End If %>>

    Fine Art

           

    We value your privacy. We do not sell or share your personal information with third parties. Should you no longer wish to receive emails from us, you may unsubscribe at any time.