% if (isNull(request.cookies("ckyUserID"))) or (request.cookies("ckyUserID")="") then response.redirect "index.asp" end if %> <% rowCount = 0 if getUserType(Request.Cookies("ckyUserID"))<>47 then 'response.redirect "home.asp" blnAdmin = false else blnAdmin = true end if if (request.QueryString("btnSave") = "Save") and (blnAdmin) then PublicationID = request.QueryString("PublicationID") strName = fixquote(request.QueryString("strName")) refCategoryID = request.QueryString("refCategoryID") refLanguageID = request.QueryString("refLanguageID") refPhysSuburbID = request.QueryString("refPhysSuburbID") refPhysCityID = request.QueryString("refPhysCityID") strLSM = fixquote(request.QueryString("strLSM")) strAge = fixquote(request.QueryString("strAge")) strURL = fixquote(request.QueryString("strURL")) strPost = fixquote(request.QueryString("strPost")) strLogin = fixquote(request.QueryString("strLogin")) strPhys = fixquote(request.QueryString("strPhys")) strFootprint = fixquote(request.QueryString("strFootprint")) strCopyNewsdesk = fixquote(request.QueryString("strCopyNewsdesk")) strDirections = fixquote(request.QueryString("strDirections")) lngReach = request.QueryString("lngReach") strCirculation = request.QueryString("strCirculation") strSwitchboard = request.QueryString("strSwitchboard") strFax = request.QueryString("strFax") strDescription = fixquote(request.QueryString("strDescription")) if PublicationID > 0 then s = "SELECT * From tblPublication WHERE strName = '" & strName & "' AND PublicationID <> " & PublicationID set rst = cn.execute(s) if not rst.eof then response.Write "" lngID = PublicationID else s = "Update tblPublication Set " & _ "refCategoryID = " & refCategoryID & ", " & _ "refLanguageID = " & refLanguageID & ", " & _ "refPhysSuburbID = " & refPhysSuburbID & ", " & _ "refPhysCityID = " & refPhysCityID & ", " & _ "strName = '" & strName & "', " & _ "strLSM = '" & strLSM & "', " & _ "strAge = '" & strAge & "', " & _ "strURL = '" & strURL & "', " & _ "strPost = '" & strPost & "', " & _ "strLogin = '" & strLogin & "', " & _ "strPhys = '" & strPhys & "', " & _ "strFootprint = '" & strFootprint & "', " & _ "strCopyNewsdesk = '" & strCopyNewsdesk & "', " & _ "strDirections = '" & strDirections & "', " & _ "strCirculation = '" & strCirculation & "', " & _ "strSwitchboard = '" & strSwitchboard & "', " & _ "strFax = '" & strFax & "', " & _ "strDescription = '" & strDescription & "', " & _ "lngReach = " & lngReach & " " & _ "WHERE PublicationID = " & PublicationID set rst1 = cn.execute(s) end if rst.close else s = "SELECT * From tblPublication WHERE strName = '" & strName & "'" set rst = cn.execute(s) if not rst.eof then btnAdd = true response.Write "" else s = "Insert Into tblPublication (" & _ "refCategoryID, " & _ "refLanguageID, " & _ "refPhysSuburbID, " & _ "refPhysCityID, " & _ "strName, " & _ "strLSM, " & _ "strAge, " & _ "strURL, " & _ "strPost, " & _ "strLogin, " & _ "strPhys, " & _ "strFootprint, " & _ "strCopyNewsdesk, " & _ "strDirections, " & _ "strCirculation, " & _ "strSwitchboard, " & _ "strFax, " & _ "strDescription, " & _ "lngReach) " & _ "values ( " & _ refCategoryID & ", " & _ refLanguageID & ", " & _ refPhysSuburbID & ", " & _ refPhysCityID & ", " & _ "'" & strName & "', " & _ "'" & strLSM & "', " & _ "'" & strAge & "', " & _ "'" & strURL & "', " & _ "'" & strPost & "', " & _ "'" & strLogin & "', " & _ "'" & strPhys & "', " & _ "'" & strFootprint & "', " & _ "'" & strCopyNewsdesk & "', " & _ "'" & strDirections & "', " & _ "'" & strCirculation & "', " & _ "'" & strSwitchboard & "', " & _ "'" & strFax & "', " & _ "'" & strDescription & "', " & _ lngReach & ")" set rst2 = cn.execute(s) end if rst.close end if elseif (request.QueryString("btnDelete") = "Delete") and (blnAdmin) then intNotDeleted=0 arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Select * From tblContact WHERE refPublicationID = " & arrID(i) set rst = cn.execute(s) if not rst.eof then intNotDeleted = intNotDeleted + 1 else s = "Delete From tblPublication WHERE PublicationID = " & arrID(i) set rst2 = cn.execute(s) end if rst.close next if intNotDeleted > 0 then Response.Write "" end if end if %>