<% 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 BeatID = request.QueryString("BeatID") CID = request.QueryString("CID") BID = request.QueryString("BID") if BeatID > 0 then s = "SELECT * From tblContactBeat WHERE refContactID = " & CID & " AND refBeatID = " & BID & " AND ContactBeatID <> " & BeatID set rst = cn.execute(s) if not rst.eof then response.Write "" lngID = ContactBeatID else s = "Update tblContactBeat Set refBeatID = " & BID & ", refContactID = " & CID & " WHERE ContactBeatID = " & BeatID set rst1 = cn.execute(s) end if rst.close else s = "SELECT * From tblContactBeat WHERE refContactID = " & CID & " AND refBeatID = " & BID set rst = cn.execute(s) if not rst.eof then btnAdd = true response.Write "" else s = "Insert Into tblContactBeat (refBeatID, refContactID) values (" & BID & ", " & CID & ")" set rst2 = cn.execute(s) end if end if elseif (request.QueryString("btnDelete") = "Delete") and (blnAdmin) then arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Delete From tblContactBeat WHERE ContactBeatID = " & arrID(i) set rst2 = cn.execute(s) next end if %> <!--#include file="title.htm"--> Beat Admin
<% CID = request.QueryString("CID") s = "SELECT tblContact.ContactID, tblContact.strName AS theContact, tblPublication.strName AS thePub " & _ "FROM tblPublication INNER JOIN tblContact ON tblPublication.PublicationID = tblContact.refPublicationID " & _ "WHERE ContactID = " & CID set rst = cn.execute(s) if not rst.eof then theContact = "Contact Beat Admin:   " & rst("theContact") & "   >>>   " & rst("thePub") else theContact = "Contact Beat Admin UNKNOWN" end if rst.close x = swapIt(x) response.write "" response.write "" response.write "" response.write "" lngID = request.QueryString("lngID") if (request.QueryString("btnAdd") = "Add") or (lngID > 0) then if lngID > 0 then s = "SELECT * From tblContactBeat WHERE ContactBeatID = " & lngID set rst = cn.execute(s) if not rst.eof then BID = rst("refBeatID") newedit = "Edit Beat" else lngID = 0 newedit = "New Beat" end if rst.close else lngID = 0 newedit = "New Beat" end if x = swapIt(x) response.write "" response.Write "" if blnAdmin then response.write "" else response.write "" end if else s = "SELECT tblBeat.strDescription, tblContactBeat.* " & _ "FROM tblBeat INNER JOIN tblContactBeat ON tblBeat.BeatID = tblContactBeat.refBeatID " & _ "WHERE (((tblContactBeat.refContactID)=" & CID & "))" & _ "ORDER BY tblBeat.strDescription" set rst = cn.execute(s) if blnAdmin then while not rst.eof x = swapIt(x) response.write "" rowCount = rowCount + 1 rst.movenext wend else while not rst.eof x = swapIt(x) response.write "" rowCount = rowCount + 1 rst.movenext wend end if rst.close x = 0 x = swapIt(x) response.write "" if blnAdmin then response.write "" else response.write "" end if end if response.write "
" & theContact & "
 
" & newedit & "
  
" & rst("strDescription") & "
" & rst("strDescription") & " 
 
List Total: " & rowCount & "  
List Total: " & rowCount & " 
" %>