<% Response.Buffer=true %> <% dim page_id dim process dim plugin_id dim redirectString dim confirmMessage dim postedFrom dim c_status dim contact_id dim c_firstName dim c_lastName dim c_title dim c_organisation dim c_address1 dim c_address2 dim c_town dim c_county dim c_postcode dim c_country dim c_phone dim c_fax dim c_email1 dim c_email2 dim c_url dim c_desc dim c_webCategory dim c_openNodes '-- Get form values page_id = request.form("page_id") process = request.form("process") plugin_id = request.form("plugin_id") postedFrom = request("postedFrom") c_status = request("c_status") contact_id = request("contact_id") c_title = getContentDBReady(request("c_title")) c_firstName = getContentDBReady(request("c_firstName")) c_lastName = getContentDBReady(request("c_lastName")) c_organisation = getContentDBReady(request("c_organisation")) c_address1 = getContentDBReady(request("c_address1")) c_address2 = getContentDBReady(request("c_address2")) c_town = getContentDBReady(request("c_town")) c_county = getContentDBReady(request("c_county")) c_postcode = getContentDBReady(request("c_postcode")) c_country = getContentDBReady(request("c_country")) c_phone = getContentDBReady(request("c_phone")) c_fax = getContentDBReady(request("c_fax")) c_email1 = getContentDBReady(request("c_email1")) c_email2 = getContentDBReady(request("c_email2")) c_url = getContentDBReady(request("c_url")) c_desc = getContentDBReady(request("c_desc")) c_webCategory = request("selectedCategories") c_openNodes = request("openNodes") c_scope = request("c_scope") '-- This field is purely to trap spammers dim c_address0 dim c_url2 c_address0 = request("c_address0") c_url2 = request("c_url2") '-- Spammer tests if len(c_address0) then response.redirect("../agencysubmit.asp?submitted=false") if len(c_url2) then response.redirect("../agencysubmit.asp?submitted=false") if instr(c_desc, "[url") then response.redirect("../agencysubmit.asp?submitted=false") if instr(c_desc, "[URL") then response.redirect("../agencysubmit.asp?submitted=false") if instr(c_desc, "href=") then response.redirect("../agencysubmit.asp?submitted=false") if c_email1 = c_email2 then response.redirect("../agencysubmit.asp?submitted=false") if process = "update" then redirectString = "../admin/ia.asp?"&_ "page_id=" & page_id &_ "&mode=managePlugins" &_ "&editType=manage" &_ "&pluginID=" & plugin_id &_ "&pluginFunc=contactAddEdit" &_ "&contact_id=" & contact_id &_ "&openNodes=" & c_openNodes &_ "&errorMsg" confirmMessage = "Contact%20updated" else if postedFrom = "CMS" then redirectString = "../admin/ia.asp?"&_ "page_id=" & page_id &_ "&mode=managePlugins" &_ "&editType=manage" &_ "&pluginID=" & plugin_id &_ "&pluginFunc=contactAddEdit" else redirectString = "../agencysubmit.asp?"&_ "returned=true" end if redirectString = redirectString &_ "&newcFirstName=" & c_firstName &_ "&newcLastName=" & c_lastName &_ "&newcTitle=" & c_title &_ "&newcOrg=" & c_organisation &_ "&newcAdd1=" & c_address1 &_ "&newcAdd2=" & c_address2 &_ "&newcTown=" & c_town &_ "&newcCounty=" & c_county &_ "&newcPostCode=" & c_postcode &_ "&newcCountry=" & c_country &_ "&newcPhone=" & c_phone &_ "&newcFax=" & c_fax &_ "&newcEmail1=" & c_email1 &_ "&newcEmail2=" & c_email2 &_ "&newcURL=" & c_url &_ "&newcDesc=" & c_desc &_ "&newcCat=" & c_webCategory &_ "&newcOpenNodes=" & c_openNodes &_ "&newcScope=" & c_scope &_ "&errorMsg" confirmMessage = "Contact%20added" end if if len(c_lastName) < 1 AND len(c_organisation) < 1 then Response.Redirect(redirectString & "=cNameZeroLength") 'if len(c_webCategory) < 1 then Response.Redirect(redirectString & "=cCatsZeroLength") if process = "add" then if postedFrom = "website" then c_webCategory = agencyThemesCatParent & ", " & c_webCategory c_openNodes = agencyThemesCatParent end if strSQL = "INSERT into plugin_contacts ("&_ "contact_firstName, "&_ "contact_lastName, "&_ "contact_title, "&_ "contact_organisation, "&_ "contact_address1, "&_ "contact_address2, "&_ "contact_town, "&_ "contact_county, "&_ "contact_postcode, "&_ "contact_country, "&_ "contact_phone, "&_ "contact_fax, "&_ "contact_email1, "&_ "contact_email2, "&_ "contact_url, "&_ "contact_desc, "&_ "contact_webCategory, "&_ "contact_openNodes, "&_ "contact_status, "&_ "contact_scope" &_ ") VALUES ("&_ "'" & c_firstName & "', "&_ "'" & c_lastName & "', "&_ "'" & c_title & "', "&_ "'" & c_organisation & "', "&_ "'" & c_address1 & "', "&_ "'" & c_address2 & "', "&_ "'" & c_town & "', "&_ "'" & c_county & "', "&_ "'" & c_postcode & "', "&_ "'" & c_country & "', "&_ "'" & c_phone & "', "&_ "'" & c_fax & "', "&_ "'" & c_email1 & "', "&_ "'" & c_email2 & "', "&_ "'" & c_url & "', "&_ "'" & c_desc & "', "&_ "'" & c_webCategory & "', "&_ "'" & c_openNodes & "', "&_ "'" & c_status & "', "&_ "'" & c_scope & "')" else strSQL = "UPDATE plugin_contacts set "&_ "contact_firstName = '" & c_firstName & "', "&_ "contact_lastName = '" & c_lastName & "', "&_ "contact_title = '" & c_title & "', "&_ "contact_organisation = '" & c_organisation & "', "&_ "contact_address1 = '" & c_address1 & "', "&_ "contact_address2 = '" & c_address2 & "', "&_ "contact_town = '" & c_town & "', "&_ "contact_county = '" & c_county & "', "&_ "contact_postcode = '" & c_postcode & "', "&_ "contact_country = '" & c_country & "', "&_ "contact_phone = '" & c_phone & "', "&_ "contact_fax = '" & c_fax & "', "&_ "contact_email1 = '" & c_email1 & "', "&_ "contact_email2 = '" & c_email2 & "', "&_ "contact_url = '" & c_url & "', "&_ "contact_desc = '" & c_desc & "', "&_ "contact_webCategory = '" & c_webCategory & "', "&_ "contact_openNodes = '" & c_openNodes & "', "&_ "contact_status = '" & c_status & "', "&_ "contact_scope = '" & c_scope & "' "&_ "WHERE contact_id = " & contact_id end if 'response.write strSQL 'response.end RunSQL strSQL if process = "add" then gSQL = "SELECT contact_id from plugin_contacts order by contact_id desc limit 1" Set gRS = LoadRSFromDB(gSQL) if not gRS.EOF then contact_id = gRS("contact_id") end if set gRS = nothing end if '--------------------------------------------------- ' UPDATE THE CATEGORY LOOKUP TABLE '--------------------------------------------------- call updateLookUpTable("plugin_contacts_category_lu", "contact_id", "c_id", contact_id, c_webCategory) '--------------------------------------------------- ' REDIRECT BACK '--------------------------------------------------- if postedFrom = "CMS" then response.redirect("../admin/ia.asp?page_id=" & page_id & "&mode=managePlugins&editType=manage&pluginID=" & plugin_id & "&confirmMsg=" & confirmMessage & "") else call notifyAllEditors(14, 3, contact_id) response.redirect("../agencysubmit.asp?submitted=true") end if %>