<!-- #include file="common.asp"-->
<!-- #include file="isadm.asp" -->
<%
Dim zsb_auth, hasAuth, SQL, Action
hasAuth = False
zsb_auth = Split( Trim( session("zsb_auth") ), ",", -1, 1 )
Action = Trim(Request.QueryString("op"))
On Error Resume Next
If Action="del" Then
	For Each auth In zsb_auth
		If ( auth = "delguest" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
		SQL="delete from [Reply] where ID="&Trim(Request("RID"))
		conn.Execute(SQL)
		conn.Close
		set conn=Nothing
	
		Response.Write "<script language=Javascript>alert('删除回复成功!');location.href='"&Request("RetUrl")&"?pn="&Request("pn")&"&GID="&Request("GID")&"';</script>"
	End If
ElseIf Action="aud" Then
  For Each auth In zsb_auth
		If ( auth = "auditing" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
		SQL="update [Reply] set AudStatus='"&Request("aud")&"' where ID="&Trim(Request("RID"))
		On Error Resume Next
		conn.Execute(SQL)
		conn.Close
		set conn=Nothing
	
		Response.Write "<script language=Javascript>alert('回复审核成功!');location.href='"&Request("RetUrl")&"?pn="&Request("pn")&"&GID="&Request("GID")&"';</script>"
	End If
ElseIf Action="view" Then
  For Each auth In zsb_auth
		If ( auth = "auditing" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
		SQL="update [Reply] set RNoview="&Request("view")&" where GuestID="&Trim(Request("GID"))
		conn.Execute(SQL)
		SQL="update [Guest] set ReNoView="&Request("view")&" where ID="&Trim(Request("GID"))
		conn.Execute(SQL)
		conn.Close
		set conn=Nothing
	
		Response.Write "<script language=Javascript>alert('回复显示状态设置成功!');location.href='"&Request("RetUrl")&"?pn="&Request("pn")&"&GID="&Request("GID")&"';</script>"
	End If	
ElseIf Action="sview" Then
  For Each auth In zsb_auth
		If ( auth = "auditing" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
		SQL="update [Reply] set RNoview="&Request("view")&" where ID="&Trim(Request("RID"))
		conn.Execute(SQL)
		conn.Close
		set conn=Nothing
	
		Response.Write "<script language=Javascript>alert('回复显示状态设置成功!');location.href='"&Request("RetUrl")&"?pn="&Request("pn")&"&GID="&Request("GID")&"';</script>"
	End If	
ElseIf Action="rep" Then
  For Each auth In zsb_auth
		If ( auth = "modguest" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
		SQL="update [Guest] set RepUnabled="&Request("rep")&" where ID="&Trim(Request("GID"))
		On Error Resume Next
		conn.Execute(SQL)
		conn.Close
		set conn=Nothing
	
		Response.Write "<script language=Javascript>alert('设置成功!');location.href='"&Request("RetUrl")&"?pn="&Request("pn")&"&GID="&Request("GID")&"';</script>"
	End If
End If
%>