% 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 = true) then BeatID = Request.QueryString("BeatID") strDescription = fixquote(Request.QueryString("strDescription")) if BeatID > 0 then s = "SELECT * From tblBeat WHERE strDescription = '" & strDescription & "' AND BeatID <> " & BeatID set rst = cn.execute(s) if not rst.eof then Response.Write "" lngID = BeatID else s = "Update tblBeat Set strDescription = '" & strDescription & "' WHERE BeatID = " & BeatID set rst2 = cn.execute(s) end if rst.close else s = "SELECT * From tblBeat WHERE strDescription = '" & strDescription & "'" set rst = cn.execute(s) if not rst.eof then btnAdd = "Add" Response.Write "" else s = "Insert Into tblBeat (strDescription) values ('" & strDescription & "')" set rst2 = cn.execute(s) end if rst.close end if elseif (Request.QueryString("btnDelete") = "Delete") and (blnAdmin = true) then intNotDeleted=0 arrID = split(Request.QueryString("arrID"),",") for i = 0 to ubound(arrID) s = "Select * From tblContactBeat WHERE refBeatID = " & arrID(i) set rst = cn.execute(s) if not rst.eof then intNotDeleted = intNotDeleted + 1 else s = "Delete From tblBeat WHERE BeatID = " & arrID(i) set rst2 = cn.execute(s) end if next if intNotDeleted > 0 then Response.Write "" end if end if %>