<%if session("login")<>true then response.Redirect("index.asp")%>
<!--#include file="adminconn.asp" -->
<%
  if session("aleave")="" and session("userkey")="" then
      response.redirect "index.asp"
	  response.end
  end if
%>
<%
if session("userkey")>8 then
dim referer
referer = Request.ServerVariables("HTTP_REFERER")

if Request("action") = "headyes" then
 call headyes()
elseif request("action") = "headno" then
 call headno()
elseif request("action") = "tuijianno" then
 call tuijianno()
elseif request("action") = "tuijianyes" then
 call tuijianyes()
elseif request("action") = "ifshowno" then
 call ifshowno()
elseif request("action") = "ifshowyes" then
 call ifshowyes()
else
response.write"<script language=javascript>alert('对不起，操作错误！');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
%>


<%sub headno()
set rs=server.createobject("adodb.recordset")
sql="select id,top from news where id="&request("id")
rs.open sql,conn,1,3
rs("top")=0
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub%>


<%sub headyes()
set rs=server.createobject("adodb.recordset")
sql="select id,top from news where id="&request("id")
rs.open sql,conn,1,3
rs("top")=1
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub%>


<%sub tuijianno()
set rs=server.createobject("adodb.recordset")
sql="select id,tuijian from news where id="&request("id")
rs.open sql,conn,1,3
rs("tuijian")=0
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub%>


<%sub tuijianyes()
set rs=server.createobject("adodb.recordset")
sql="select id,tuijian from news where id="&request("id")
rs.open sql,conn,1,3
rs("tuijian")=1
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub%>


<%sub ifshowno()
set rs=server.createobject("adodb.recordset")
sql="select id,ifshow from news where id="&request("id")
rs.open sql,conn,1,3
rs("ifshow")=0
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub%>


<%sub ifshowyes()
set rs=server.createobject("adodb.recordset")
sql="select id,ifshow from news where id="&request("id")
rs.open sql,conn,1,3
rs("ifshow")=1
rs.update
rs.close
set rs=nothing
response.redirect (referer)
end sub

else
response.write"<script language=javascript>alert('对不起，你没有此管理权限！');"
response.write"javascript:history.go(-1)</script>"
response.end
end if
%>

