<!--#include file="conn.asp"-->
<%
if session("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
else
if request.cookies("sundxshop")("admin")="" then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('请先登录！');location.href='index.asp' ;</script>"
response.End
end if
end if
if session("rank")>1 then
conn.close
set conn = nothing
response.Write "<script language='javascript'>alert('你无权管理商品评论！');history.go(-1);</script>"
response.End
end if

dim action
action=FormatSQL(SafeRequest("action",0))
select case action
case "del"
if request.form("audit").count=0 then
response.write "<script language=javascript>alert('您没有选择要删除的评论？');history.go(-1);</script>"
response.End
end if
conn.execute ("delete from review where reviewid in ("&request.form("audit")&")")
response.write "<script language=javascript>alert('批量删除成功!');history.go(-1);</script>"
response.end
case "audit"
if request.form("audit").count=0 then
response.write "<script language=javascript>alert('您没有选择要审核的评论？');history.go(-1);</script>"
response.End
end if
conn.execute "update review set audit=1 where reviewid in ("&request.form("audit")&")"
response.write "<script language=javascript>alert('批量审核成功!');history.go(-1);</script>"
response.end
case "delzhou"
dim theday
theday=date-7
conn.execute ("delete from review where reviewdtm<#"&theday&"# and audit=0")
response.write "<script language=javascript>alert('一周前未审核评论删除成功!');history.go(-1);</script>"
response.end
case "delall"
conn.execute ("delete from review where audit=0")
response.write "<script language=javascript>alert('所有未审核评论删除成功!');history.go(-1);</script>"
response.end
end select
%>
