<% 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 CategoryID = Request.QueryString("CategoryID") strDescription = fixquote(Request.QueryString("strDescription")) if CategoryID > 0 then s = "SELECT * From tblCategory WHERE strDescription = '" & strDescription & "' AND CategoryID <> " & CategoryID set rst = cn.execute(s) if not rst.eof then Response.Write "" lngID = CategoryID else s = "Update tblCategory Set strDescription = '" & strDescription & "' WHERE CategoryID = " & CategoryID set rst2 = cn.execute(s) end if rst.close else s = "SELECT * From tblCategory WHERE strDescription = '" & strDescription & "'" set rst = cn.execute(s) if not rst.eof then btnAdd = "Add" Response.Write "" else s = "Insert Into tblCategory (strDescription) values ('" & strDescription & "')" 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 tblPublication WHERE refCategoryID = " & arrID(i) set rst = cn.execute(s) if not rst.eof then intNotDeleted = intNotDeleted + 1 else s = "Delete From tblCategory WHERE CategoryID = " & arrID(i) set rst2 = cn.execute(s) end if next if intNotDeleted > 0 then Response.Write "" end if end if %> Category Admin
<% lngID = Request.QueryString("lngID") CBW = request.querystring("CBW") x = swapIt(x) Response.Write "" Response.Write "" Response.Write "" if (Request.QueryString("btnAdd") = "Add") or (lngID >0) or (CBW<>"") then if lngID > 0 then s = "SELECT * From tblCategory WHERE CategoryID = " & lngID set rst = cn.execute(s) if not rst.eof then strDescription = rst("strDescription") newedit = "Edit Category" else lngID = 0 newedit = "New Category" end if rst.close else lngID = 0 newedit = "New Category" end if x = swapIt(x) if blnAdmin then Response.Write "" else Response.Write "" end if if CBW <> "" then x = swapIt(x) response.write "" x = swapIt(x) response.write "
Category Admin
 
" & newedit & "  " response.write "
" & newedit & "
 
" if CBW="All" then s = "SELECT tblContact.ContactID, tblContact.strName AS theContact, tblShow.strName AS theShow, tblPublication.strName AS thePub " & _ "FROM (tblContact INNER JOIN tblPublication ON tblContact.refPublicationID = tblPublication.PublicationID) LEFT JOIN tblShow ON tblContact.refShowID = tblShow.ShowID " & _ "WHERE (((tblPublication.refCategoryID)=" & lngID & ")) " & _ "ORDER BY tblContact.strName" else s = "SELECT tblContact.ContactID, tblContact.strName AS theContact, tblShow.strName AS theShow, tblPublication.strName AS thePub " & _ "FROM (tblContact INNER JOIN tblPublication ON tblContact.refPublicationID = tblPublication.PublicationID) LEFT JOIN tblShow ON tblContact.refShowID = tblShow.ShowID " & _ "WHERE (((tblPublication.refCategoryID)=" & lngID & ")) AND Left(tblContact.strName, 1)='" & CBW & "' " & _ "ORDER BY tblContact.strName" end if set rst = cn.execute(s) while not rst.eof x = swapIt(x) response.write "" rowCount = rowCount + 1 rst.movenext wend rst.close response.write "" response.write "
ContactPublicationShow
" & rst("theContact") & "" & rst("thePub") & "" & rst("theShow") & "
 
Related Contacts: " & rowCount & "
" else response.write " " end if else LB = request.querystring("LB") if request.querystring("btnSave") = "Save" then response.write "" end if if LB<> "All" then s = "SELECT * From tblCategory WHERE Left(strDescription, 1)='" & LB & "' Order By strDescription" set rst = cn.execute(S) if blnAdmin then while not rst.eof x = swapIt(x) response.write "" & rst("strDescription") & "" rowCount = rowCount + 1 rst.movenext wend else while not rst.eof x = swapIt(x) response.write "" & rst("strDescription") & " " rowCount = rowCount + 1 rst.movenext wend end if rst.close else s = "SELECT * From tblCategory Order By strDescription" set rst = cn.execute(s) if blnAdmin then while not rst.eof x = swapIt(x) Response.write "" & rst("strDescription") & "" rowCount = rowCount + 1 rst.movenext wend else while not rst.eof x = swapIt(x) Response.write "" & rst("strDescription") & " " 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 "List Total: " & rowCount & "  " else Response.Write "List Total: " & rowCount & " " end if end if Response.Write "" %>