% 'Include Security 'do not include security because this file is referenced from the client side Server.Execute("/admin/includes/popup_security.asp") %> <%'Include Data Connection%> <%'Include ADO constants include file for VBScript%> <% 'open data connection OpenConn() %> <%'Include Utility Scripts%> <% dim intGroupID dim strGroupName dim intGroupParentID dim intGroupParentID2 dim strGroupDescriptions dim datDateCreated dim strDateCreated strMode = Trim(Request.QueryString("mode")) intGroupID = Trim(Request.QueryString("id")) If Request.Form <> "" Then 'BEGIN: ADD/EDIT (DB TRANSACTION) dim strDel dim arContactsAndGroups dim intContactCounter dim strUserFeedback dim intSubscriberIsLive dim intNewParent 'get form elements values strMode = Request.Form("txtMode") 'If the group is other, hardcode it to the variable if Request.Form("txtGroupID") = "5" Then strGroupName = "Other" strGroupDescription = Request.Form("hidDescription") Else strGroupName = Request.Form("txtGroupName") strGroupDescription = Request.Form("txtDescription") End if datDateCreated = Request.Form("txtDate") 'strEmail = Request.Form("txtEmail") 'strOrganization = Request.Form("txtOrganization") intFormGroupID = Request.Form("txtGroupID") strDel = Request.Form("txtDelimiter") 'strSubscriberType = Request.Form("txtSubscriberType") strRefererURL = Request.Form("txtRefererURL") arContactsAndGroups = Split(Request.Form("txtSelected"), strDel) intOldOption = Request.Form("txtOldOption") intNewOption = Request.Form("optParent") intNewParent = intNewOption 'strRelevantEducation = Request.Form("txtRelevantEducation") 'intFirstDegreeObtainedCountryId = CInt(Request.Form("selCountry")) 'intContactTypeId = CInt(Request.Form("selContactType")) 'strEmploymentStatus = Request.Form("selEmploymentStatus") 'strStatementOfInterest = Request.Form("txtStatementOfInterest") 'intYearsOfProfessionalExperience = Request.Form("txtYearsOfProExperience") 'if the application is in 'edit' mode If LCase(strMode) = "edit" Then 'Check if the user has moved a group to another group if intNewOption <> intOldOption then 'Assign the new parent id to that given group Call ModifyParent(intFormGroupID, intNewOption) end if 'Modify the group Name and description Call ModifyGroupInfo(intFormGroupID, strGroupName, strGroupDescription) Call Delete_LookUpGroup(intFormGroupID) For intContactCounter = LBound(arContactsAndGroups) To UBound(arContactsAndGroups) 'if the array item is not an empty string then... If Trim(arContactsAndGroups(intContactCounter)) <> "" Then 'add a posting type record related to the subscriber Call Add_ContactsToGroup(arContactsAndGroups(intContactCounter), intFormGroupID) End If Next 'if the application is in 'add' mode else 'Add a new group intFormGroupID = AddGroupInfo(intNewParent, strGroupName, strGroupDescription, datDateCreated) Call Delete_LookUpGroup(intFormGroupID) For intContactCounter = LBound(arContactsAndGroups) To UBound(arContactsAndGroups) 'if the array item is not an empty string then... If Trim(arContactsAndGroups(intContactCounter)) <> "" Then 'add a Subscriber ID record related to the Group ID record Call Add_ContactsToGroup(arContactsAndGroups(intContactCounter), intFormGroupID) End If Next End If If Request.Form("txtImport") = "1" Then Response.Write("") Else Session("FeedbackMode") = LCase(strMode) Session("FeedbackError") = err.number Session("FeedbackModule") = "groups" Session("Referer") = strRefererURL Server.Execute("/admin/feedback.asp") End If else If LCase(strMode) = "edit" Then dim rsGetEditGroups set rsGetEditGroups = PopulateGroupEditForm(intGroupId) do while not rsGetEditGroups.EOF strGroupName = rsGetEditGroups("GROUP_NAME") strGroupDescriptions = rsGetEditGroups("GROUP_DESCRIPTIONS") intGroupParentID = rsGetEditGroups("GROUP_PARENT_ID") strDateCreated = rsGetEditGroups("GROUP_DATE_CREATED") rsGetEditGroups.MoveNext loop dim rsGetEditGroups2 set rsGetEditGroups2 = PopulateGroupEditForm(intGroupId) do while not rsGetEditGroups.EOF strGroupName2 = rsGetEditGroups("GROUP_NAME") strGroupDescriptions2 = rsGetEditGroups("GROUP_DESCRIPTIONS") intGroupParentID2 = rsGetEditGroups("GROUP_PARENT_ID") strDateCreated2 = rsGetEditGroups("GROUP_DATE_CREATED") rsGetEditGroups2.MoveNext loop end if %>
<% 'END: INPUT (ADD/EDIT) End If %> <% 'close data connection CloseConn() %>