<% 'open data connection Call OpenConn() %> <%'Include ADO constants include file for VBScript%> <% 'dim strDelimiter - The strDelimiter varible is defined in the common_utils.asp file. dim strAction dim strFirstName dim strLastName dim strOrganization dim bolSubscriberExists dim strFeedback dim strSelectedPostingTypes 'if the form information has been submitted then... If Request.Form <> "" Then dim intSubscriberId 'get the submitted form elements strAction = Request.Form("txtAction") strEmail = Request.Form("txtEmail") 'initialize the strSelectedPostingTypes variable to an empty string strSelectedPostingTypes = "" 'set the intSubscriberIsLive to true intSubscriberIsLive = 1 'depending on the strAction variable value Select Case LCase(strAction) 'if strAction is equal to 'get' then... Case "get" 'the application verifies the subscriber's existence and gets his info dim intSubscriberIsLive dim rsSubscriber dim rsSubscribedToPostings 'get the subscriber id into the intSubscriberId variable intSubscriberId = VerifySubscribersExistence(strEmail, intSubscriberIsLive) 'if the intSubscriberId variable is different than an empty string then... If intSubscriberId <> "" Then 'set the boolean value evaluating the existence of the subscriber in the database into the bolSubscriberExists variable bolSubscriberExists = True 'get the subscribed postings into the rsSubscribedToPostings recordset object Set rsSubscribedToPostings = GetSubscriberSelectedPostingType(intSubscriberId) 'loop through the posting types Do While Not rsSubscribedToPostings.Eof 'concatenate the posting type id and delimiter to the strSelectedPostingTypes variable strSelectedPostingTypes = strSelectedPostingTypes & rsSubscribedToPostings("POSTING_TYPE_ID") & strDelimiter 'move to the next record in the recordset rsSubscribedToPostings.MoveNext Loop 'get the subscriber information into the rsSubscriber recordset object Set rsSubscriber = GetSubscriberInfo(intSubscriberId) 'get the subscriber's information into the relevant variables strFirstName = rsSubscriber("SUBSCRIBER_FIRST_NAME") strLastName = rsSubscriber("SUBSCRIBER_LAST_NAME") strOrganization = rsSubscriber("SUBSCRIBER_ORGANIZATION") 'release the rsSubscriber recordset from memory rsSubscriber.Close Set rsSubscriber = Nothing 'set the feedback for the user strFeedback = "Please make any necessary changes, and click ""Update""." 'if the intSubscriberId variable is not different than an empty string then... Else 'set the boolean value of bolSubscriberExists to false bolSubscriberExists = False 'reset the value of strAction to input strAction = "input" 'set the feedback for the user strFeedBack = "Your profile could not be found. Please email the webmaster by clicking the link below if you have any questions." End If Case "modify" 'the application processes the subscriber's modified information dim intSusbscriberPostingTypeCounter dim arPostingTypes 'get the submitted subscriber id and selected posting types intSubscriberId = Request.Form("txtSubscriberId") strSelectedPostingTypes = Request.Form("txtSelectedPostingTypes") strOrganization = Request.Form("txtOrganization") 'if the user has selected posting types to subscribe to then... If strSelectedPostingTypes <> "" Then 'modify the subscriber's information Call ModifySubscriberUnsubscribe(CInt(intSubscriberId), strEmail, strOrganization) 'delete the user's posting type subscriptions Call Delete_Subscriber_PostingType(intSubscriberId) 'add the user's new posting type subscriptions: 'get the selected posting types into the arPostingTypes array variable arPostingTypes = Split(strSelectedPostingTypes, strDelimiter) 'for each posting type... For intSusbscriberPostingTypeCounter = LBound(arPostingTypes) To UBound(arPostingTypes) 'if the array item is not an empty string then... If Trim(arPostingTypes(intSusbscriberPostingTypeCounter)) <> "" Then 'add a posting type record related to the subscriber Call Add_Subscriber_PostingType(arPostingTypes(intSusbscriberPostingTypeCounter), intSubscriberId) End If Next 'set the feedback for the user strFeedback = "Your subscriber information has been updated successfully.

To unsubscribe/modify your subscription information for the Vitesse.ca Subscription Service, Please enter your e-mail address below:

" 'if the user has not selected posting types to subscribe to then... Else 'remove the subscriber from the database 'comment out the deletion of the subscriber because subscribers are also contacts (for Vitesse) 'Call DeleteSubscriber(intSubscriberId) 'modify the subscriber's information Call ModifySubscriberUnsubscribe(CInt(intSubscriberId), strEmail, strOrganization) 'delete the user's posting type subscriptions Call Delete_Subscriber_PostingType(intSubscriberId) 'set the feedback for the user strFeedback = "You have been successfully unsubscribed from Vitesse news." End If Case "delete" 'the application deletes the subscriber from the database 'get the subscriber id into the intSubscriberId variable intSubscriberId = VerifySubscribersExistence(strEmail, intSubscriberIsLive) 'if the intSubscriberId variable is different than an empty string then... If intSubscriberId <> "" Then 'remove the subscriber from the database 'comment out the deletion of the subscriber because subscribers are also contacts (for Vitesse) 'Call DeleteSubscriber(intSubscriberId) 'delete the user's posting type subscriptions Call Delete_Subscriber_PostingType(intSubscriberId) 'set the feedback for the user strFeedback = "You have been successfully unsubscribed from Vitesse news." 'if the intSubscriberId variable is not different than an empty string then... Else 'set the boolean value of bolSubscriberExists to false bolSubscriberExists = False 'reset the value of strAction to input strAction = "input" 'set the feedback for the user strFeedBack = "Your profile could not be found. Please email the webmaster by clicking the link below if you have any questions." End If End Select 'if the form information has not been submitted then... Else 'reset the value of strAction to input strAction = "input" 'set the feedback for the user strFeedback = "To unsubscribe/modify your subscription information for the Vitesse.ca Subscription Service,
Please enter your e-mail address below:
" End If %> Vitesse Re-Skilling Canada Inc. :: Unsubscribe :: onload="setSelectedPostingTypes(document.forms.frmUnsubscribe, document.forms.frmUnsubscribe.txtDelimiter.value, document.forms.frmUnsubscribe.txtSelectedPostingTypes.value);"<%End If%>>
<% 'if the application is in modify mode then... If strAction = "get" Then %>
<%=strFeedback%>
Email Address:
Name:

Organization:

<% 'Output the subscribeable posting type checkboxes Response.Write DisplayPostingTypeCheckboxes() End If %>
<% 'if the application is in get mode then... If strAction = "get" Then %> <% 'if the application is not in get mode then... Else %>
<% End If %>
If you experience any difficulties,
please contact info@vitesse.ca

www.vitesse.ca

<% 'open data connection Call CloseConn() %>