<% '20130128 - changed "Car Reg" to "Twitter Handle" - pj 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) or (request.querystring("virtSave")=2)) and (blnAdmin) then theMonth = month(date) theDay = day(date) if theMonth < 10 then theMonth = "0" & theMonth end if if theDay < 10 then theDay = "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")) strFaxAlternate = fixquote(request.querystring("strFaxAlternate")) 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 ContactID, tblPublication.strName as thePub From tblContact, tblPublication WHERE PublicationID = refPublicationID AND tblContact.strName = '" & strName & "' AND refPublicationID = " & refPublicationID & " 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 & "', " & _ "strTel = '" & strTel & "', " & _ "strTelAlternate = '" & strTelAlternate & "', " & _ "strCell = '" & strCell & "', " & _ "strFaxAlternate = '" & strFaxAlternate & "', " & _ "strEmail = '" & strEmail & "', " & _ "strEmailAlternate = '" & strEmailAlternate & "', " & _ "strLastUser = '" & getUserName(getUserID(request.cookies("ckyUserID"))) & "', " & _ "strCarReg = '" & strCarReg & "', " & _ "memNotes = '" & memNotes & "', " & _ "memInterests = '" & memInterests & "', " & _ "strDateEdited = '" & strDateEdited & "', " & _ "strPAName = '" & strPAName & "', " & _ "strPATel = '" & strPATel & "', " & _ "strPAEmail = '" & strPAEmail & "' " & _ "WHERE ContactID = " & ContactID '"strFax = '" & strFax & "', " & _ '"strSwitchboard = '" & strSwitchboard & "', " & _ set rst1 = cn.execute(s) end if 'rst.close else s = "SELECT ContactID, tblPublication.strName as thePub From tblContact, tblPublication WHERE PublicationID = refPublicationID and tblContact.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, " & _ "strTel, " & _ "strTelAlternate, " & _ "strFaxAlternate, " & _ "strCell, " & _ "strEmail, " & _ "strEmailAlternate, " & _ "strCarReg, " & _ "memNotes, " & _ "memInterests, " & _ "strDateEdited, " & _ "strLastUser, " & _ "strPAName, " & _ "strPATel, " & _ "strPAEmail) " & _ "values ( "& _ refPublicationID & ", " & _ refShowID & ", " & _ refTitleID & ", " & _ refDesignationID & ", " & _ "'" & strName & "', " & _ "'" & strTel & "', " & _ "'" & strTelAlternate & "', " & _ "'" & strFaxAlternate & "', " & _ "'" & strCell & "', " & _ "'" & strEmail & "', " & _ "'" & strEmailAlternate & "', " & _ "'" & strCarReg & "', " & _ "'" & memNotes & "', " & _ "'" & memInterests & "', " & _ "'" & strDateEdited & "', " & _ "'" & getUserName(getUserID(request.cookies("ckyUserID"))) & "', " & _ "'" & strPAName & "', " & _ "'" & strPATel & "', " & _ "'" & strPAEmail & "') " '"'" & strSwitchboard & "', " & _ '"'" & strFax & "', " & _ 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 if request.querystring("virtSave") = 2 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_distributionlist.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) s = "Delete From tblContactDistributionList WHERE refContactID = " & arrID(i) set rst3 = cn.execute(s) next end if %> <!--#include file="title.htm"--> Contact Admin
<% x = swapIt(x) response.write "" response.write "" lngID = request.QueryString("lngID") if (request.QueryString("btnAdd") = "Add") or (lngID > 0) or (request.QueryString("setdefaults") > 0) then response.write "" if lngID > 0 then s = "SELECT tblContact.ContactID, tblPublication.strSwitchboard, tblPublication.strFax, tblContact.refPublicationID, tblContact.refShowID, tblContact.refTitleID, " & _ "tblContact.refDesignationID, tblContact.strName, tblContact.strTel, tblContact.strTelAlternate, tblContact.strFaxAlternate, tblContact.strCell, tblContact.strEmail, " & _ "tblContact.strEmailAlternate, tblContact.strCarReg, tblContact.memNotes, tblContact.memInterests, tblContact.strDateEdited, tblContact.strPAName, " & _ "tblContact.strPATel, tblContact.strPAEmail, tblContact.strLastUser " & _ "FROM tblContact LEFT OUTER JOIN " & _ "tblPublication ON tblContact.refPublicationID = tblPublication.PublicationID " & _ "WHERE ContactID = " & lngID set rst = cn.execute(s) if not rst.eof then refPublicationID = rst("refPublicationID") refShowID = rst("refShowID") refTitleID = rst("refTitleID") refDesignationID = rst("refDesignationID") strName = rst("strName") strSwitchboard = rst("strSwitchboard") strTel = rst("strTel") strTelAlternate = rst("strTelAlternate") strFax = rst("strFax") strFaxAlternate = rst("strFaxAlternate") strCell = rst("strCell") strEmail = rst("strEmail") strEmailAlternate = rst("strEmailAlternate") strCarReg = rst("strCarReg") memNotes = rst("memNotes") memInterests = rst("memInterests") strDateEdited = rst("strDateEdited") strPAName = rst("strPAName") strPATel = rst("strPATel") strPAEmail = rst("strPAEmail") strLastUser = rst("strLastUser") newedit = "Edit Contact" else lngID = 0 newedit = "New Contact" 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) end if rst.close else if request.QueryString("setdefaults")>0 then strDateEdited = request.QueryString("strDateEdited") strName = request.QueryString("strName") lngID = request.QueryString("ContactID") refShowID = Int(request.QueryString("refShowID")) refPublicationID = Int(request.QueryString("refPublicationID")) refTitleID = Int(request.QueryString("refTitleID")) refDesignationID = Int(request.QueryString("refDesignationID")) strSwitchboard = fixquote(request.querystring("strSwitchboard")) strTel = fixquote(request.querystring("strTel")) strTelAlternate = fixquote(request.querystring("strTelAlternate")) strFax = fixquote(request.querystring("strFax")) strFaxAlternate = fixquote(request.querystring("strFaxAlternate")) 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")) strLastUser = fixquote(request.querystring("strLastUser")) s = "SELECT * " & _ "FROM tblPublication " & _ "WHERE PublicationID = " & refPublicationID set rst = cn.execute(s) if not rst.eof then strSwitchboard = rst("strSwitchboard") strFax = rst("strFax") end if rst.close else lngID = 0 newedit = "New Contact" 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) end if end if x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" x = swapIt(x) response.write "" x = swapIt(x) response.write "" x = swapIt(x) response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" x = swapIt(x) response.write "" response.write "" response.write "" response.write "" if blnAdmin then response.write "" else response.write "" end if else if request.querystring("btnSave") = "Save" then response.write "" end if LB = request.querystring("LB") col = request.querystring("col") sort = request.querystring("sort") if col=3 then col = " thePub" elseif col=2 then col = " theShow" else col = " theContact" end if if sort=2 then by = " DESC" sort = 1 else by = " ASC" sort = 2 end if if LB<>"All" then response.write "" s = "SELECT tblContact.ContactID, tblContact.strName AS theContact, tblShow.strName AS theShow, tblPublication.strName AS thePub " & _ "FROM (tblContact LEFT JOIN tblShow ON tblContact.refShowID = tblShow.ShowID) INNER JOIN tblPublication ON tblContact.refPublicationID = tblPublication.PublicationID " & _ "WHERE Left(tblContact.strName, 1)='" & LB & "' " & _ "ORDER BY " & col & " " & by set rst = cn.execute(s) if blnAdmin then while not rst.eof x = swapIt(x) if len(trim(rst("theContact"))) > 0 then theContact = rst("theContact") else theContact = "No Description" end if response.write "" response.write "" rowCount = rowCount + 1 rst.movenext wend else while not rst.eof x = swapIt(x) if len(trim(rst("theContact"))) > 0 then theContact = rst("theContact") else theContact = "No Description" end if response.write "" response.write "" rowCount = rowCount + 1 rst.movenext wend end if rst.close else response.write "" s = "SELECT tblContact.ContactID, tblContact.strName AS theContact, tblShow.strName AS theShow, tblPublication.strName AS thePub " & _ "FROM (tblContact LEFT JOIN tblShow ON tblContact.refShowID = tblShow.ShowID) INNER JOIN tblPublication ON tblContact.refPublicationID = tblPublication.PublicationID " & _ "ORDER BY " & col & " " & by set rst = cn.execute(s) if blnAdmin then while not rst.eof x = swapIt(x) if len(rst("theContact"))>0 then theContact = rst("theContact") else theContact = "No Description" end if response.write "" response.write "" rowCount = rowCount + 1 rst.movenext wend else while not rst.eof x = swapIt(x) if len(rst("theContact"))>0 then theContact = rst("theContact") else theContact = "No Description" end if response.write "" response.write "" rowCount = rowCount + 1 rst.movenext wend end if rst.close end if x = 0 x = swapIt(x) x = swapIt(x) response.write "" if blnAdmin then response.write "" else response.write "" end if end if response.write "
Contact Admin
 
Title:Switchboard:
Name:Phone:
Designation:Alternate Phone:
PublicationCell:
ShowFax:
Edit Beats:" cntBeat = 0 s = "SELECT tblBeat.strDescription, tblContactBeat.refContactID " & _ "FROM tblBeat INNER JOIN tblContactBeat ON tblBeat.BeatID = tblContactBeat.refBeatID " & _ "WHERE (((tblContactBeat.refContactID)=" & lngID & ")) " & _ "ORDER BY tblBeat.strDescription" set rst = cn.execute(s) while not rst.eof cntBeat = cntBeat + 1 response.write "" rst.movenext wend rst.close response.write "
" & rst("strDescription") & "
Direct Fax:
Email:
Notes:Alternate Email:
Twitter Handle:
 
 
Edit Distribution Lists:" cntDistributionList = 0 s = "SELECT tblDistributionList.strDescription, tblContactDistributionList.refContactID " & _ "FROM tblDistributionList INNER JOIN tblContactDistributionList ON tblDistributionList.DistributionListID = tblContactDistributionList.refDistributionListID " & _ "WHERE (((tblContactDistributionList.refContactID)=" & lngID & ")) " & _ "ORDER BY tblDistributionList.strDescription" set rst = cn.execute(s) while not rst.eof cntDistributionList = cntDistributionList + 1 response.write "" rst.movenext wend rst.close response.write "
" & rst("strDescription") & "
PA Name:
PA Tel:  
PA Email:Date Card Updated:
Last User:
  
ContactShowPublication
" & theContact & "" & rst("theShow") & "" & rst("thePub") & "
" & theContact & "" & rst("theShow") & "" & rst("thePub") & " 
ContactShowPublication
" & theContact & "" & rst("theShow") & "" & rst("thePub") & "
" & theContact & "" & rst("theShow") & "" & rst("thePub") & " 
 
List Total: " & rowCount & "  
List Total: " & rowCount & " 
" %>