% 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") or (request.querystring("virtSave")=1)) and (blnAdmin) then theMonth = month(date) theDay = day(date) if theMonth < 10 then theMonth = "0" & theMonth end if if theDay < 10 then theMonth = "0" & theDay end if strDateEdited = theDay & "/" & theMonth & "/" & year(date) strName = fixquote(request.QueryString("strName")) ContactID = request.QueryString("ContactID") refShowID = request.QueryString("refShowID") refPublicationID = request.QueryString("refPublicationID") refTitleID = request.QueryString("refTitleID") refDesignationID = request.QueryString("refDesignationID") strSwitchboard = fixquote(request.querystring("strSwitchboard")) strTel = fixquote(request.querystring("strTel")) strTelAlternate = fixquote(request.querystring("strTelAlternate")) strFax = fixquote(request.querystring("strFax")) strCell = fixquote(request.querystring("strCell")) strEmail = fixquote(request.querystring("strEmail")) strEmailAlternate = fixquote(request.querystring("strEmailAlternate")) strCarReg = fixquote(request.querystring("strCarReg")) memNotes = fixquote(request.querystring("memNotes")) memInterests = fixquote(request.querystring("memInterests")) strPAName = fixquote(request.querystring("strPAName")) strPATel = fixquote(request.querystring("strPATel")) strPAEmail = fixquote(request.querystring("strPAEmail")) if ContactID > 0 then s = "SELECT * From tblContact WHERE strName = '" & strName & "' AND refShowID = " & refShowID & " AND ContactID <> " & ContactID set rst = cn.execute(s) if not rst.eof then response.Write "" lngID = ContactID else s = "Update tblContact Set " & _ "refPublicationID = " & refPublicationID & ", " & _ "refShowID = " & refShowID & ", " & _ "refTitleID = " & refTitleID & ", " & _ "refDesignationID = " & refDesignationID & ", " & _ "strName = '" & strName & "', " & _ "strSwitchboard = '" & strSwitchboard & "', " & _ "strTel = '" & strTel & "', " & _ "strTelAlternate = '" & strTelAlternate & "', " & _ "strFax = '" & strFax & "', " & _ "strCell = '" & strCell & "', " & _ "strEmail = '" & strEmail & "', " & _ "strEmailAlternate = '" & strEmailAlternate & "', " & _ "strCarReg = '" & strCarReg & "', " & _ "memNotes = '" & memNotes & "', " & _ "memInterests = '" & memInterests & "', " & _ "strDateEdited = '" & strDateEdited & "', " & _ "strPAName = '" & strPAName & "', " & _ "strPATel = '" & strPATel & "', " & _ "strPAEmail = '" & strPAEmail & "' " & _ "WHERE ContactID = " & ContactID set rst1 = cn.execute(s) end if rst.close else s = "SELECT * From tblContact WHERE strName = '" & strName & "'" set rst = cn.execute(s) if not rst.eof then btnAdd = true response.Write "" else s = "Insert Into tblContact ("& _ "refPublicationID, " & _ "refShowID, " & _ "refTitleID, " & _ "refDesignationID, " & _ "strName, " & _ "strSwitchboard, " & _ "strTel, " & _ "strTelAlternate, " & _ "strFax, " & _ "strCell, " & _ "strEmail, " & _ "strEmailAlternate, " & _ "strCarReg, " & _ "memNotes, " & _ "memInterests, " & _ "strDateEdited, " & _ "strPAName, " & _ "strPATel, " & _ "strPAEmail) " & _ "values ( "& _ refPublicationID & ", " & _ refShowID & ", " & _ refTitleID & ", " & _ refDesignationID & ", " & _ "'" & strName & "', " & _ "'" & strSwitchboard & "', " & _ "'" & strTel & "', " & _ "'" & strTelAlternate & "', " & _ "'" & strFax & "', " & _ "'" & strCell & "', " & _ "'" & strEmail & "', " & _ "'" & strEmailAlternate & "', " & _ "'" & strCarReg & "', " & _ "'" & memNotes & "', " & _ "'" & memInterests & "', " & _ "'" & strDateEdited & "', " & _ "'" & strPAName & "', " & _ "'" & strPATel & "', " & _ "'" & strPAEmail & "')" set rst2 = cn.execute(s) if request.querystring("virtSave") = 1 then s = "SELECT Max(ContactID) as theID From tblContact WHERE strName = '" & strName & "'" set rst3 = cn.execute(s) if not rst3.eof then response.redirect "admin_contact_beat.asp?CID=" & rst3("theID") else lngID = 0 end if end if end if rst.close end if elseif (request.QueryString("btnDelete") = "Delete") and (blnAdmin) then arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Delete From tblContact WHERE ContactID = " & arrID(i) set rst1 = cn.execute(s) s = "Delete From tblContactBeat WHERE refContactID = " & arrID(i) set rst2 = cn.execute(s) next end if %>