📄 admin_remark.asp
字号:
<!--#include file="admin_head.asp"-->
<br><br>
<%
if Request("action") = "del" then
remarkid = Request("remarkid")
Unid = Request("Unid")
sql = "Delete from article_remark where Unid = " & remarkid
Conn.Execute(sql)
Response.write "<script>alert(""删除成功"");location.href=""admin_remark.asp?unid="& Unid &""";</script>"
Response.end
end if
Unid = Request("Unid")
'-----修改每页显示个数 Start--------
const MaxPerPage=10
'-----修改每页显示个数 End --------
dim totalPut
dim CurrentPage
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<table width="95%" border="1" cellspacing="0" cellpadding="3" align="center" bordercolorlight="#ECEEE4" bordercolordark="#CCCABC">
<tr>
<td colspan="8" align="center" height="30" background="image/tablebg.gif"><b>
文 章 评 论 管 理</b></td>
</tr>
<tr align="center">
<td height="25">评论内容</td>
<td>作者</td>
<td>IP</td>
<td>文章标题</td>
<td>操作</td>
</tr>
<tr align="center">
<td height="25" colspan="7">
<%
Set rs=Server.CreateObject("Adodb.Recordset")
if Unid = "" then
Sql = "SELECT article_remark.username, article_remark.content, article_remark.ip,article_remark.articleid,article_info.title,article_remark.Unid FROM article_remark INNER JOIN article_info ON article_remark.articleID = article_info.Unid ORDER BY article_remark.Unid DESC"
else
Sql = "SELECT article_remark.username, article_remark.content, article_remark.ip,article_remark.articleid,article_info.title,article_remark.Unid FROM article_remark INNER JOIN article_info ON article_remark.articleID = article_info.Unid WHERE article_remark.articleid = "& Unid &" ORDER BY article_remark.Unid DESC"
end if
rs.open sql,conn,1,1
if rs.eof and rs.bof then
Response.Write "<center><font color=red>还没有会员发表评论。</font></center>"
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"admin_remark.asp"
showContent
showpage totalput,MaxPerPage,"admin_remark.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"admin_remark.asp"
showContent
showpage totalput,MaxPerPage,"admin_remark.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"admin_remark.asp"
showContent
showpage totalput,MaxPerPage,"admin_remark.asp"
end if
end if
rs.close
set rs = nothing
end if
sub showContent
dim i
i=0
%>
</td>
</tr>
<%
do while not rs.eof
username = rs(0)
content = rs(1)
ip = rs(2)
articleid = rs(3)
title = rs(4)
remarkid = rs(5)
%>
<tr align="center">
<td height="25" align="left"><%=Qcdn.HTMLcode(content)%></td>
<td><%=username%></td>
<td><%=ip%></td>
<td><a href="list.asp?unid=<%=articleid%>" target="_blank"><%=title%></a></td>
<td><a href="javascript:ConfirmDele(<%=remarkid%>)">删除</a></td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
<tr align="center">
<td height="25" colspan="7">
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<table cellspacing=1 width='100%' border=0 colspan='4' ><form method=Post action="""&filename&"?unid="& Unid &"""><tr><td align=right> "
if CurrentPage<2 then
response.write "共<b><font color=red>"&totalnumber&"</font></b>条评论 首页 上一页 "
else
response.write "共<b><font color=red>"&totalnumber&"</font></b>条评论 <a href="&filename&"?page=1&unid="& Unid &">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&unid="& Unid &">上一页</a> "
end if
if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&unid="& Unid &">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&unid="& Unid &">尾页</a>"
end if
response.write " 页次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>页 "
response.write " <b>"&maxperpage&"</b>条评论/页 "
%>
转到:
<select name='page' size='1' style="font-size: 9pt" onChange='javascript:submit()'>
<%for i = 1 to n%>
<option value='<%=i%>' <%if CurrentPage=cint(i) then%> selected <%end if%>>第<%=i%>页</option>
<%next%>
</select> <%
response.write "</td></tr></FORM></table>"
end function
%>
</td>
</tr>
<tr align="center">
<td height="25" colspan="7"> </td>
</tr>
</table>
<script language="javascript">
function ConfirmDele(remarkid)
{
if(confirm("\n你确认删除吗?"))
{
location.href="admin_remark.asp?action=del&remarkid="+remarkid+"&Unid=<%=unid%>";
}
}
</script>
<!--#include file="admin_copy.asp"-->
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -