📄 pinglun.asp
字号:
<!--#include file="conn.asp"--><!--#include file="check_user.asp"-->
<%
Product_id=request.QueryString("Product_id")
Product_name=request.QueryString("Product_name")
%>
<html>
<head>
<title>用户评论</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../images/css.css" rel="stylesheet" type="text/css">
<style>
td{font-size:9pt;line-height:120%;color:#353535;}
body{font-size:9pt;line-height:120%}
a:link { color: #000000; text-decoration: none }
a:visited { color: #000000; text-decoration: none }
a:active { color: #000000; text-decoration: none }
a:hover { color: #336699; text-decoration: none; position: relative; right: 0px; top: 1px }
</style>
</head>
<body background="../pic/bg.jpg" marginwidth="00">
<p>
<table width="590" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#00CCFF" bordercolordark="#FFFFFF">
<tr>
<td height="21" bgcolor="#00CCFF">对商品:[<font color="#FFFFFF"><B><%=Product_name%></B></font>]的全部评论:</td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from shop_pinglun where Product_id="&request("Product_id")&" order by pinglunid desc",conn,1,1
if rs.recordcount=0 then
response.write"<tr><td height=24><div align=center>暂无评论 <a href=javascript:history.back(1)>返回上页</a></div></td></tr>"
else
rs.PageSize =5 '每页记录条数
iCount=rs.RecordCount '记录总数
iPageSize=rs.PageSize
maxpage=rs.PageCount
page=request("page")
if Not IsNumeric(page) or page="" then
page=1
else
page=cint(page)
end if
if page<1 then
page=1
elseif page>maxpage then
page=maxpage
end if
rs.AbsolutePage=Page
if page=maxpage then
x=iCount-(maxpage-1)*iPageSize
else
x=iPageSize
end if
%>
<tr>
<td height="24"><table width="100%" border="0" cellspacing="0" cellpadding="5" align="center">
<%
For i=1 To x
%>
<tr>
<td> <table width="100%" border="0" cellspacing="0" cellpadding="2">
<tr>
<td width="5%" align="right"><img src="../images/image002.gif" width="15" height="15"></td>
<td colspan="2"><b>主题:</b><a href="../pinglunll.asp?id=<%=rs("pinglunid")%>&Product_name=<%=Product_name%>" title="<%=trim(rs("pingluntitle"))%>"><%=trim(rs("pingluntitle"))%></a></td>
<td width="29%"><img src="../images/pingji/<%=rs("pingji")%>.gif" width="79" height="14"></td>
</tr>
<tr>
<td width="5%"> </td>
<td colspan="2"><b>作者:</b><%=trim(rs("pinglunname"))%> (<%=trim(rs("pinglundate"))%>)</td>
<td width="29%"><%=trim(rs("ip"))%></td>
</tr>
<tr>
<td width="5%"> </td>
<td colspan="2">
<%if len(rs("pingluncontent"))>20 then
response.write left(rs("pingluncontent"),16)&"... <a href=../pinglunll.asp?id="&rs("pinglunid")&"&Product_name="&Product_name&">[详细内容]</a>"
else response.write rs("pingluncontent")
end if%>
</td>
<td valign="top"><a href="pingLun_up.asp?pinglunid=<%=rs("pinglunid")%>&Product_name=<%=Product_name%>&Product_id=<%=rs("Product_id")%>">答复</a>
<a href="pingLun_up.asp?up=del&pinglunid=<%=rs("pinglunid")%>&Product_id=<%=rs("Product_id")%>&Product_name=<%=Product_name%>&pingji=<%=rs("pingji")%>" onClick="return confirm('你确认删除该条评论吗?')">删除</a></td>
</tr>
<%if trim(rs("huifu"))<>"" then%>
<tr>
<td width="5%"> </td>
<td width="7%"> </td>
<td colspan="2"><b><font color="#CC3333">管理员回复:</font></b><%=rs("huifu")%>
</td>
</tr>
<%end if%>
<tr background="../images/bj_x1.gif">
<td height=1 colspan=4></td>
</tr>
</table></td>
</tr>
<%
rs.movenext
next
%>
</table>
</td>
</tr>
<%
call PageControl(iCount,maxpage,page,"border=0 align=center","<p align=center>")
end if
rs.close
set rs=nothing
%>
</table>
<p>
<%
'定义分页显示
Sub PageControl(iCount,pagecount,page,table_style,font_style)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table " & Table_style & ">" & vbCrLf )
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><TR>" & vbCrLf )
Response.Write("<TD align=right>" & vbCrLf )
Response.Write(font_style & vbCrLf )
if page<=1 then
Response.Write ("首页 " & vbCrLf)
Response.Write ("上页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=1>首页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page-1) & ">上页</A> " & vbCrLf)
end if
if page>=pagecount then
Response.Write ("下页 " & vbCrLf)
Response.Write ("尾页 " & vbCrLf)
else
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & (Page+1) & ">下页</A> " & vbCrLf)
Response.Write("<A HREF=" & action & "?" & temp & "Page=" & pagecount & ">尾页</A> " & vbCrLf)
end if
Response.Write(page & "/" & pageCount & "页" & vbCrLf)
Response.Write(" 共有" & iCount & "条评论" & vbCrLf)
Response.Write(" 转到" & "<INPUT TYEP=TEXT NAME=page SIZE=1 Maxlength=5 VALUE=" & page & ">" & "页" & vbCrLf & "<INPUT type=submit style=""font-size: 9pt"" value=GO class=b2>")
Response.Write("</TD>" & vbCrLf )
Response.Write("</TR></form>" & vbCrLf )
Response.Write("</table>" & vbCrLf )
End Sub
%>
<p> </p>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -