<!--#include file="config.asp"-->
<%
If Newasp.CheckPost = False Then
	Call OutAlertScript("<li>您提交的数据不合法，请不要从外部提交。</li>")
	Response.End
End If
If Cint(Newasp.membergrade) = 999 Or Trim(Session("AdminName")) <> "" Then
	If Newasp.ChkNumeric(Request("guestid")) > 0 Then
		If Newasp.ChkNumeric(Request("replyid")) > 0 Then
			Call DelGuestReply
		Else
			Call DelGuestBook
		End If
	Else
		Call OutAlertScript("错误的系统参数!")
	End If
Else
	Call OutAlertScript("本页面为管理专用，您没有权限登陆本页！")
End If
CloseConn
'================================================
'过程名：DelGuestBook
'作  用：删除留言
'================================================
Sub DelGuestBook()
	Dim guestid
	If Not IsNumeric(Request("guestid")) Then
		Call OutAlertScript("错误的系统参数!")
		Exit Sub
	Else
		guestid = CLng(Request("guestid"))
	End If
	Newasp.Execute("DELETE FROM xp90com_GuestBook WHERE guestid="& guestid)
	Newasp.Execute("DELETE FROM xp90com_GuestReply WHERE guestid="& guestid)
	Call OutputScript("删除留言成功！","index.asp")
End Sub
'================================================
'过程名：DelGuestReply
'作  用：删除回复留言
'================================================
Sub DelGuestReply()
	Dim replyid,guestid
	If Not IsNumeric(Request("replyid")) Or Not IsNumeric(Request("guestid")) Then
		Call OutAlertScript("错误的系统参数!")
		Exit Sub
	Else
		replyid = CLng(Request("replyid"))
		guestid = CLng(Request("guestid"))
	End If
	Newasp.Execute("DELETE FROM xp90com_GuestReply WHERE id="& replyid)
	Newasp.Execute ("UPDATE xp90com_GuestBook SET ReplyNum=ReplyNum-1 WHERE guestid="& guestid)
	Call OutputScript("删除回复成功！","index.asp")
End Sub
%>
