<!-- #include file="common.asp"-->
<!-- #include file="isadm.asp" -->
<%
	Dim zsb_auth, hasAuth
	hasAuth = False
	zsb_auth = Split( Trim( session("zsb_auth") ), ",", -1, 1 )
	For Each auth In zsb_auth
		If ( auth = "settop" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
%>
<%
		If Trim(Request("op")) = "top" Then
			set rs=Server.CreateObject("ADODB.Recordset")
			sqlstr="select ID,TopG from guest Where ID=" & Trim(Request("ID"))
			rs.open sqlstr,conn,1,3
			if not rs.eof then
				rs("TopG") = True
				rs.update
			end if
			rs.close
			set rs=nothing
			conn.close
			set conn=nothing
		Elseif Trim(Request("op")) = "untop" Then
			set rs=Server.CreateObject("ADODB.Recordset")
			sqlstr="select ID,TopG from guest Where ID=" & Trim(Request("ID"))
			rs.open sqlstr,conn,1,3
			If not rs.eof then
				rs("TopG") = False
				rs.update
			End if
			rs.close
			set rs=nothing
			conn.close
			set conn=nothing
		End If
%>
<%
  Response.Write("<script Language=Javascript>alert('设置成功!');location.href='manage.asp?pn=" & Trim(Request("pn")) & "';</script>")
%>
<%End If%>
