<!--#include file="include/nowshop.asp"-->
<%
call aspsql()
set rs=conn.execute("select * from bsetup")
pages=clng(rs("pages1"))		'每页评论数
jianju=clng(rs("book_jianju"))		'间距
bad=cstr(rs("bad"))			'脏话过滤
view=cstr(rs("view1"))			'评论是否需要审核
mailyes=clng(rs("mailyes1"))		'是否必填邮箱
prodid=trim(request("prodid"))
name=trim(request.form("name"))
mail=trim(request.form("mail"))
nr=trim(request.form("nr"))
jibie=trim(request.form("jibie"))
%>
<!--#include file="include/nowshop.asp" -->
<html><head><title>商品评论-<%=sitename%>-<%=siteurl%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="description" content="<%=sitedescription%>">
<meta name="keywords" content="<%=sitekeywords%>">
<link rel="stylesheet" href="css.css" type="text/css">
</head>
<body text="#000000" leftmargin="20" topmargin="20" marginwidth="0" marginheight="0" bbackground="images/<%=skin%>/background.gif" >
  <!--#include file="top.asp"-->
  <table height=20><tr><td></td></tr></table>
<%
set rs=conn.execute("select ProdName from bproduc where prodid='"&prodid&"'")
if not (rs.eof and rs.bof) then response.write "以下是【"&rs("ProdName")&"】的所有用户评论：<br><br>"
set rs=Server.CreateObject("ADODB.RecordSet")
sql="select * from pinglun where prodid='"&prodid&"' and view='1' order by AddDate desc"
rs.open sql,conn,1,3
if rs.eof and rs.bof then
response.write "<br>暂时没有用户对此商品提交评论。<br><br>"
else
rs.pageSize = pages '每页记录数
allPages = rs.pageCount	'总页数
page = Request("page")	'从浏览器取得当前页

'if是基本的出错处理

If not isNumeric(page) then page=1

if isEmpty(page) or clng(page) < 1 then
page = 1
elseif clng(page) >= allPages then
page = allPages 
end if
rs.AbsolutePage = page			'转到某页头部
do while not rs.eof and pages>0
%>
<table cellSpacing=1 cellPadding=0 width=80% border=0>
<tr><td>
<table cellSpacing=3 cellPadding=3 width=100% align=center border=0>
<%
response.write "<tr><td width=100% >"
for j=1 to rs("jibie")
response.write "<font color=#ff5b02>★</font>"
next
response.write"&nbsp;&nbsp;&nbsp;&nbsp;时间："&rs("adddate")&"</td></tr>"
response.write"<tr><td bgcolor=#F7F3F7>&nbsp;&nbsp;评价人："&rs("name")&"</td></tr>"
	nr=rs("nr")			'内容
	bad1=split(bad,"/")		'过滤脏话
	for t=0 to ubound(bad1)
	nr=replace(nr,bad1(t),"***")
	next
response.write "<tr><td bgcolor=#FFFBFF>&nbsp;&nbsp;评价词："&replace(server.htmlencode(nr),vbCRLF,"<BR>")&"</td></tr></table></td></tr></table>"
response.write "<table border=0 height='"&jianju&"'><tr><td></td></tr></table>"
pages = pages - 1
rs.movenext
if rs.eof then exit do
loop
end if

response.write "<br>总计"&RS.RecordCount&"条评论 "
if page = 1 then
response.write "<font color=darkgray>首页 前页</font>"
else
response.write "<a href=pinglun.asp?prodid="&prodid&"&page=1>首页</a> <a href=pinglun.asp?prodid="&prodid&"&page="&page-1&">前页</a>"
end if
if page = allpages then
response.write "<font color=darkgray> 下页 末页</font>"
else
response.write " <a href=pinglun.asp?prodid="&prodid&"&page="&page+1&">下页</a> <a href=pinglun.asp?prodid="&prodid&"&page="&allpages&">末页</a>"
end if
response.write " 第"&page&"页 共"&allpages&"页 "

conn.close
set conn=nothing
%>
</td></tr>
</table>
  <table height=20><tr><td></td></tr></table>

  <!--#include file="down.asp"-->
</body>
