<!-- #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 = "delguest" ) Then
				hasAuth = True
			Exit For
		End If
	Next
	
	If hasAuth = false Then
		Response.Write("<script language=javascript>alert('对不起，你没有权限，请联系超级管理员！');history.back(-1);</script>")
	Else
%>
<%
  set rs=Server.CreateObject("ADODB.Recordset")
  sqlstr="select * from guest Where ID=" & Trim(Request("ID"))
  rs.open sqlstr,conn,1,3
  if not rs.eof then
      rs.delete
  end if
  rs.close
  set rs=nothing
%>
<%
  set rs=Server.CreateObject("ADODB.Recordset")
  sqlstr="select * from Reply Where GuestID=" & Trim(Request("ID"))
  rs.open sqlstr,conn,1,3
  if not rs.eof then
      rs.delete
  end if
  rs.close
  set rs=nothing
%>
<%
  conn.close
  set conn=nothing
%>
<%
  'Response.Write "<script Language=Javascript>alert('删除留言成功!');location.href = 'javascript:history.back()';</script>"
%>
<%
  urlstr="state.asp?state=deletesuc&pn="+Trim(Request("pn"))
  response.Redirect urlstr
%>
<%End If%>
