Call ModifySubscriber(CInt(intSubscriberId), strFirstName, strLastName, strEmail, strOrganization, intSubscriberIsLive, strRelevantEducation, intFirstDegreeObtainedCountryId, intContactTypeId, strEmploymentStatus, strStatementOfInterest, intYearsOfProfessionalExperience) 'delete posting type records related to the selected subscriber id Call Delete_Subscriber_PostingType(intSubscriberId) 'if the application is in 'add' mode Else 'verify the subscriber's existence intSubscriberId = VerifySubscribersExistence(strEmail, intSubscriberIsLive) 'if the susbscriber does not exist then... If intSubscriberId = "" Then 'add Subscriber intSubscriberId = AddSubscriber(strFirstName, strLastName, strEmail, strOrganization, intSubscriberIsLive, strRelevantEducation, intFirstDegreeObtainedCountryId, intContactTypeId, strEmploymentStatus, strStatementOfInterest, intYearsOfProfessionalExperience) 'if the susbscriber does exist then... Else 'modify Posting Type Name Call ModifySubscriber(CInt(intSubscriberId), strFirstName, strLastName, strEmail, strOrganization, intSubscriberIsLive, strRelevantEducation, intFirstDegreeObtainedCountryId, intContactTypeId, strEmploymentStatus, strStatementOfInterest, intYearsOfProfessionalExperience) 'delete posting type records related to the selected subscriber id Call Delete_Subscriber_PostingType(intSubscriberId) End If End If '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 'if the this transaction is initiated from the client (user) side of the site then... If strRefererURL <> "" Then 'if any error occurred then... If err.number <> 0 Then 'set the querystring with the error code strRefererURL = strRefererURL & "?subscribed=" & err.number 'if no errors occurred then... Else 'set the querystring with ok strRefererURL = strRefererURL & "?subscribed=ok" End If 'redirect the user to the refering page and inform the user of the occurence of any errors Response.Redirect(strRefererURL) End If 'give the user feedback with regards to the success of the add/edit database transaction Session("FeedbackMode") = LCase(strMode) Session("FeedbackError") = err.number Session("FeedbackModule") = "subscriber" 'Response.Write("") Server.Execute("/admin/feedback.asp") 'END: ADD/EDIT (DB TRANSACTION) Else 'BEGIN: INPUT (ADD/EDIT) 'get the application's transaction mode strMode = Trim(Request.QueryString("mode")) 'get the subscriber's type strSubscriberType = Trim(Request.QueryString("type")) 'if application is in edit mode then... If LCase(strMode) = "edit" Then 'begin: get current Posting Type info to be edited dim rsSubscriber intSubscriberId = Trim(Request.QueryString("id")) 'if intSubscriberId is not a valid value then... If Not IsNumeric(intSubscriberId) or Not (intSubscriberId <> "") Then 'close the window Response.write("") 'if intSubscriberId is a valid value then... Else 'get the related Subscriber information Set rsSubscriber = GetSelectedSubscriber(CInt(intSubscriberId)) End If 'if intSubscriberId does not relate to an existing Subscriber id then... If rsSubscriber.EOF Then 'release the recordset from memory rsSubscriber.Close set rsSubscriber = Nothing 'release the connection object from memory before closing the window conn.Close Set conn = Nothing 'close the window Response.write("") 'if intSubscriberId does relate to an existing Subscriber id then... Else 'get the subscriber information into the relevant variables strFirstName = rsSubscriber("SUBSCRIBER_FIRST_NAME") strLastName = rsSubscriber("SUBSCRIBER_LAST_NAME") strEmail = rsSubscriber("SUBSCRIBER_EMAIL") strOrganization = rsSubscriber("SUBSCRIBER_ORGANIZATION") intContactTypeId = rsSubscriber("CONTACT_TYPE_ID") intFirstDegreeObtainedCountryId = rsSubscriber("SUBSCRIBER_COUNTRY_OF_FIRST_DEGREE") strRelevantEducation = rsSubscriber("SUBSCRIBER_RELEVANT_EDUCATION") strEmploymentStatus = rsSubscriber("SUBSCRIBER_EMPLOYMENT_STATUS") strStatementOfInterest = rsSubscriber("SUBSCRIBER_STATEMENT_OF_INTEREST") intYearsOfProfessionalExperience = rsSubscriber("SUBSCRIBER_YEARS_OF_PROFESSIONAL_EXPERIENCE") 'release the recordset from memory rsSubscriber.Close set rsSubscriber = Nothing End If 'end: get current subscriber info to be edited 'if application is in add mode then... Else strFirstName = "" strLastName = "" strOrganization = "" End If %> ============================== <% If LCase(strMode) = "edit" Then %> <% Else %> <% End If %>