<% 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 DistributionListID = request.QueryString("DistributionListID") CID = request.QueryString("CID") BID = request.QueryString("BID") if DistributionListID > 0 then s = "SELECT * From tblContactDistributionList WHERE refContactID = " & CID & " AND refDistributionListID = " & BID & " AND ContactDistributionListID <> " & DistributionListID set rst = cn.execute(s) if not rst.eof then response.Write "" lngID = ContactDistributionListID else s = "Update tblContactDistributionList Set refDistributionListID = " & BID & ", refContactID = " & CID & " WHERE ContactDistributionListID = " & DistributionListID set rst1 = cn.execute(s) end if rst.close else s = "SELECT * From tblContactDistributionList WHERE refContactID = " & CID & " AND refDistributionListID = " & BID set rst = cn.execute(s) if not rst.eof then btnAdd = true response.Write "" else s = "Insert Into tblContactDistributionList (refDistributionListID, 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 tblContactDistributionList WHERE ContactDistributionListID = " & arrID(i) set rst2 = cn.execute(s) next end if %> <!--#include file="title.htm"--> Distribution List 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 Distribution List Admin:   " & rst("theContact") & "   >>>   " & rst("thePub") else theContact = "Contact Distribution List 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 tblContactDistributionList WHERE ContactDistributionListID = " & lngID set rst = cn.execute(s) if not rst.eof then BID = rst("refDistributionListID") newedit = "Edit Distribution List" else lngID = 0 newedit = "New Distribution List" end if rst.close else lngID = 0 newedit = "New Distribution List" end if x = swapIt(x) response.write "" response.Write "" if blnAdmin then response.write "" else response.write "" end if else s = "SELECT tblDistributionList.strDescription, tblContactDistributionList.* " & _ "FROM tblDistributionList INNER JOIN tblContactDistributionList ON tblDistributionList.DistributionListID = tblContactDistributionList.refDistributionListID " & _ "WHERE (((tblContactDistributionList.refContactID)=" & CID & "))" & _ "ORDER BY tblDistributionList.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 & " 
" %>