📄 managepinglun.asp
字号:
<!--#include file="conn.asp"-->
<%call time_out()%>
<%
if instr(session("proview"),"s4")=0 then
response.Write "<script language=javascript>alert('您无权操作!');window.location.href='index.asp';</script>"
response.end
end if%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>管理商品评论</title>
</head>
<body>
<%pro_name=trim(request("pro_name"))
action=trim(request("action"))
id=trim(request("id"))
if action="del" then
conn.execute("delete from pinglun where id="&id)
response.redirect("managepinglun.asp")
end if
%>
<form name="form1" method="post" action="managepinglun.asp?action=search">
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolordark="ffffff" bordercolorlight="f0f0f0">
<tr>
<td width="20%"> </td>
<td>评论商品:</td>
<td align="center">
<input type="text" name="pro_name"> </td>
<td><input type="submit" name="Submit" value="查询"></td>
<td width="20%"> </td>
</tr>
</table>
</form>
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr align="center" bgcolor="6699cc">
<td height="25">评论商品</td>
<td>评论人</td>
<td>评论标题</td>
<td>评论类型</td>
<td>删除</td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
if action="search" then
sql="select a.id,a.pid,a.user_name,a.pingluntype,a.title,a.addtime,b.pid,b.pro_name from pinglun a,product b where 1=1"
if pro_name<>"" then
sql=sql & " and pro_name like '%"&pro_name&"%'"
end if
sql = sql & " and a.pid=b.pid order by addtime DESC"
else
sql="select a.id,a.pid,a.user_name,a.pingluntype,a.title,a.addtime,b.pid,b.pro_name from pinglun a,product b where a.pid=b.pid order by addtime DESC"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then%>
<tr><td colspan="6" height="25">暂无记录</td></tr>
<%
else
rs.pagesize=18
page = cint(request("page"))
if page = "" then page = 1
if not(isnumeric(page)) then page=1
if page<1 then page=1
if page >= rs.pagecount then page = rs.pagecount
rs.absolutepage = page
for j=1 to rs.PageSize
if (j mod 2)<>0 then
bgcolor="ffffff"
else
bgcolor="CBDDE7"
end if
%>
<tr align="center" bgcolor="<%=bgcolor%>">
<td height="25"><%=rs("pro_name")%></td>
<td><%=rs("user_name")%></td>
<td><%=rs("title")%></td>
<td><%=rs("pingluntype")%></td>
<td><a href="managepinglun.asp?action=del&id=<%=rs("id")%>" onclick="return confirm('确定删除此评论吗?')">删除</a></td>
</tr>
<%rs.movenext
if rs.eof then exit for
next
%>
<tr>
<td height="25" colspan="6" align="center">
<p align="center">共有记录<%=rs.recordcount%>条
<%=page%>/<%=rs.pagecount%>
<%if page>1 then%><a href="<%request.ServerVariables("document_name")%>?action=<%=action%>&pro_name=<%=pro_name%>&page=1">首页</a><%else%><%response.write("首页")%><%end if%>
<%if page>1 then%>
<A href="<%request.servervariables("document_name")%>?page=<%=page-1%>&action=<%=action%>&pro_name=<%=pro_name%>"><<</A>
<%end if%>
<% if page<rs.pagecount then%>
<A href="<%request.servervariables("document_name")%>?page=<%=page+1%>&action=<%=action%>&pro_name=<%=pro_name%>">>></A>
<%end if%>
<%if page<rs.pagecount then%><a href="<%request.ServerVariables("document_name")%>?action=<%=action%>&pro_name=<%=pro_name%>&page=<%=rs.pagecount%>">尾页</a><%else%><%response.write("尾页")%><%end if%>
转到第 <SELECT onChange="window.location='?action=<%=action%>&pro_name=<%=pro_name%>&page='+this.value" name=gopage>
<%for x=1 to rs.pagecount%>
<OPTION <%if x=page then%>selected<%end if%> value=<%=x%>><%=x%></OPTION>
<%next%>
</SELECT> 页</td>
</tr>
<%
end if
rs.close
set rs=nothing
%>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -