📄 comment.asp
字号:
<!--#include file="../Session.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../../css/site.css" rel="stylesheet" type="text/css">
<body>
<table width="100%" border="0" cellpadding="3" cellspacing="1">
<tr align="center">
<td height="50" colspan="7" valign="middle" class="tdstyle"><strong><font size="3">评论管理</font></strong></td>
</tr>
<tr>
<td width="5%" align="center" valign="middle" class="tdstyle"><strong>编号</strong></td>
<td width="35%" align="center" valign="middle" class="tdstyle"><strong>评论商品</strong></td>
<td width="10%" align="center" valign="middle" class="tdstyle"><strong>评论人</strong></td>
<td width="21%" align="center" valign="middle" class="tdstyle"><strong>评论时间</strong></td>
<td width="10%" align="center" valign="middle" class="tdstyle"><strong>状态</strong></td>
<td width="10%" align="center" valign="middle" class="tdstyle"><strong>回复</strong></td>
<td width="10%" align="center" valign="middle" class="tdstyle"><strong>删除</strong></td>
</tr>
<%
if request("Act")="Yes" then
if request("State")="1" then
conn.execute("update Comment set State=0 where id="&request("id")&"")
else
conn.execute("update Comment set State=1 where id="&request("id")&"")
end if
end if
if request("Del")="Yes" then
conn.execute("Delete From Comment where id="&Request("id")&"")
Response.write "<script>alert(""删除成功"");window.close();window.opener.location.reload();</script>"
end if
Set rs = Server.CreateObject("ADODB.Recordset")
rs.Open "Select * from Comment Order By id DESC", conn, 3, 2
if rs.eof then
Response.Write("<tr bgcolor=#ffffff><td height=25 colspan=7 align=center valign=middle class=text>暂无产品评论</td></tr>")
response.end
end if
Set rs1=Server.CreateObject("ADODB.Recordset")
sql="Select * from Merchandise where id="&rs("cpid")&" Order By id DESC"
rs1.open sql,conn,0,1
TradeName=rs1("TradeName")
rs1.close
rs.pagesize = 10
if request("page")="" or IsNumeric(request("page"))=False then
page = 1
else
page=int(request("page"))
end if
if page>rs.pagecount then
page=rs.pagecount
end if
if not rs.BOF then
Rs.Move Rs.PageSize*(page-1)
end if
i=1
do while not rs.eof and i<=rs.pagesize
%>
<tr>
<td align="center" valign="middle" class="tdstyle"><%=i%></td>
<td align="center" valign="middle" class="tdstyle"><%=TradeName%></td>
<td align="center" valign="middle" class="tdstyle">
<%if rs("name")="" then
Response.Write("匿名")
else
Response.Write(""&rs("name")&"")
end if
%>
</td>
<td align="center" valign="middle" class="tdstyle"><%=rs("Data")%></td>
<td align="center" valign="middle" class="tdstyle"><%if rs("State")="0" then%> <input name="submit" type="button" class="button2" value="未审核" onClick="window.location='?Act=Yes&State=<%=rs("State")%>&Id=<%=rs("Id")%>'">
<%else%> <input name="submit" type="button" class="button3" value="己审核" onClick="window.location='?Act=Yes&State=<%=rs("State")%>&Id=<%=rs("Id")%>'">
<%end if%></td>
<td align="center" valign="middle" class="tdstyle"><input name="submit" type="button" class="button2" value="回复/修改" onClick="window.location='Answer.asp?id=<%=rs("id")%>'"></td>
<td align="center" valign="middle" class="tdstyle">
<input name="submit" type="button" class="button2" value="删 除" onClick="window.location='?Del=Yes&id=<%=rs("id")%>'"></td>
</tr>
<tr>
<td colspan="7" style="WORD-WRAP: break-word" class="text"> 【评论内容】<%=rs("Text")%> <% if rs("Answer")<>"" then Response.Write "<br><font color=#FF6600> 【评论回复】"&rs("Answer")&"</font>" %> </td>
</tr>
<%
i=i+1
rs.MoveNext
loop
%>
<tr>
<form name=form method=post action=?>
<td height="30" colspan="7" align="center" valign="middle" class="tdstyle">
<%
if rs.recordcount<>0 then
if page-1 mod 10=0 then
p=(page-1) \ 10
else
p=(page-1) \ 10
end if
response.write "页次:"& page &"/"& rs.pagecount &"页 每页"& rs.pagesize &" 共"& rs.recordcount &"条记录"&_
" 分页:"
if rs.pagecount>1 and page<>1 then response.write "<a href=?page=1 title='首页'>[|<]</a> "
if p*10>0 then response.write "<a href='?page="&p*10&"' title=上十页>[<<]</a> "
uming_i=1
for ii=p*10+1 to P*10+10
if ii=page then
response.write "<font color=#ff0000>["+Cstr(ii)+"]</font> "
else
response.write "<a href='?page="&ii&"'>["+Cstr(ii)+"]</a> "
end if
if ii=rs.pagecount then exit for
uming_i=uming_i+1
next
if ii<=rs.pagecount and uming_i=11 then response.write "<a href='?page="&ii&"' title=下十页>[>>]</a> "
if rs.pagecount>1 and page<>rs.pagecount then response.write "<a href=?page="& rs.pagecount &" title='尾页'>[>|]</a>"
response.write(" 跳页:<input type=text name=page size=2 maxlength=3 class=input1> <input type=submit name=Submit value=Go class=button>")
end if%>
</td>
</form>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -