% 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 %>