📄 admin_info_pl.asp
字号:
<!--#include file="config.asp" -->
<!--#include file="conn.asp" -->
<!--#include file="admin_admininfo.asp"-->
<!--#include file="sub_change.asp" -->
<!--#include file="admin_turnpage.asp" -->
<%
if session("adminname")<>adminname or session("adminpwd")<>adminpwd then
response.Redirect("admin_login.asp")
end if
Dim RowCount
RowCount = 50 '每页显示的记录条数
dim order,del,res,adel,messageinfo
order=trim(request("order"))
del=left(trim(request.QueryString("del")),2)
res=trim(request.QueryString("res"))
adel=trim(request.QueryString("adel"))
userip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
If userip = "" Then userip = Request.ServerVariables("REMOTE_ADDR")
if del="ok" then
dim rs_del,deldata,delbox,i
delbox=trim(request.form("delbox"))
set rs_del=server.CreateObject("adodb.recordset")
deldata = split(delbox,", ")
For i=0 To Ubound(deldata)
rs_del.open "select * from 资讯评论 where 编号="&deldata(i),conn,3,3
If rs_del.recordcount=1 Then
rs_del("审核")=0
rs_del.update
End If
rs_del.close
Next
set rs_del=nothing
if Ubound(deldata)+1=0 then
messageinfo="你没有选择删除任何评论!"
else
messageinfo="删除成功!共删除资讯 <b>" &Ubound(deldata)+1&"</b> 条"
end if
end if
if res<>"" and IsNumeric(res) then
dim rs_res
set rs_res=server.CreateObject("adodb.recordset")
rs_res.open "select * from 资讯评论 where 编号="&res,conn,3,3
If rs_res.recordcount=1 Then
rs_res("审核")=1
rs_res.update
messageinfo=" <b>恢复成功!</b>"
End If
rs_res.close
set rs_res=nothing
end if
if adel="ok" then
dim rs_adel
set rs_adel=server.CreateObject("adodb.recordset")
rs_adel.open "delete from 资讯评论 where 审核=0",conn,3,3
rs_adel.close
set rs_adel=nothing
messageinfo="<b>从数据库中删除成功!</b>"
end if
dim rs,msg
set rs=server.CreateObject("adodb.recordset")
select case order
case "isnew"
if strchange(trim(request.QueryString("num")))<>"" and IsNumeric(strchange(trim(request.QueryString("num")))) then
msg="最新评论: <u>"&strchange(trim(request.QueryString("num")))&"</u> 条"
rs.open "select top "&strchange(trim(request.QueryString("num")))&" * from 资讯评论 where 审核=1 order by 编号 desc",conn,1,1
else
msg="抱歉!无法取得评论数,显示所有评论!"
rs.open "select * from 资讯评论 where 审核=1 order by 编号 desc",conn,1,1
end if
case "isinfo"
msg="<u>"&strchange(trim(request.QueryString("name")))&"</u> 的资讯评论"
rs.open "select * from 资讯评论 where 资讯编号="&strchange(trim(request.QueryString("id")))&" order by 编号 desc",conn,1,1
case "isdel"
msg="<b>已删除评论</b>"
rs.open "select * from 资讯评论 where 审核=0 order by 编号 desc",conn,1,1
case "isall"
msg="<b>所有评论(包括删除评论)</b>"
rs.open "select * from 资讯评论 order by 编号 desc",conn,1,1
case else
msg="<b>所有评论</b>"
rs.open "select * from 资讯评论 where 审核=1 order by 编号 desc",conn,1,1
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>【后台管理】资讯评论管理 - <%=sitename%></title>
<link href="admin.css" rel="stylesheet" type="text/css">
<SCRIPT language='javascript' src='inc/pop.js'></SCRIPT>
<script language="VBScript">
<!--
Function isdel()
dim myvar
myvar = MsgBox (Chr(10) &" 确定要删除全部未审核评论? "&Chr(13) & Chr(10)& Chr(10) &" 该操作不可恢复!请慎重使用!"& Chr(10), 1+48+256, "警告")
if myvar=1 then window.location="?adel=ok&order=<%=order%>"
End Function
-->
</script>
</head>
<body leftmargin="0" topmargin="0">
<div align="center">
<!--#include file="admin_top_info.asp" -->
<br>
<script language=Javascript>
function checkall(all)//用于判断全选记录的函数
{
var a = document.getElementsByName("delbox");
for (var i=0; i<a.length; i++) a[i].checked = all.checked;
}
</script>
<table width="90%" border="1" cellpadding="0" cellspacing="0" bordercolor="#999999">
<tr>
<td height="40" align="center" style="line-height: 16pt"><b>资讯评论管理</b></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="5" cellspacing="1" bgcolor="#DFEAF2">
<tr bgcolor="#333333">
<td height="20" bgcolor="#FFFFFF">选择:
<a href="?">所有评论</a> ※
<a href="?order=isdel">已删除评论</a>|<a href="?order=isall">含删除所有评论</a> ※
最新评论:<a href="?order=isnew&num=20">20</a>|<a href="?order=isnew&num=50">50</a>|<a href="?order=isnew&num=100">100</a>
<%if order="isdel" or order="isall" then response.write " ※ <a style='color: #FF0000' href='VBScript:isdel()'>彻底从数据库中删除记录"%></a></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="10" style="border-collapse: collapse" height="30">
<tr>
<td align="left" width="40%"><%response.write msg&" 共有<font color='red'>"&rs.recordcount& "</font>条记录"%><%if messageinfo<>"" then response.write "<br><font color='red'>"&messageinfo&"</font>"%></td>
<td align="right"><%Call TurnPage(Rs,RowCount)%></td>
</tr>
</table>
<table width="90%" border="0" cellpadding="3" cellspacing="1" bgcolor="#DFEAF2">
<tr bgcolor="#0099FF">
<td colspan="2" height="30"> <input type="checkbox" name="chkall" value="on" onclick="checkall(this)" ID="Checkbox2"><b><font color="#FFFFFF"> 全选所有</font></b></td>
</tr>
<form method="POST" action="?id=<%=id%>&del=ok" name="admin_info_pl">
<%Do while Not rs.eof and not rs.bof and RowCount>0%>
<tr bgcolor="#FFFFFF" onMouseOver='this.style.backgroundColor="#E7F4F8"' onMouseOut='this.style.backgroundColor=""'>
<td width="40"> <%if rs("审核")=1 then response.write "<input type='checkbox' name='delbox' value='"&rs("编号")&"' ID='Checkbox1'>"%></td>
<td width="*">
<%
if rs("审核")=1 then
response.write "<font color=#FF0000>·</font>" &rs("发言内容")& "<br>"
else
response.write "<font color=#666666>·<strike>" &rs("发言内容")& "</strike></font><br>"
end if
response.write "<font color=#999999>" &rs("发言者姓名")&" | "&rs("发言者联系方式")&" | "&rs("发言时间")&" | "&rs("ip")&"</font>"
set rsinfo=server.CreateObject("adodb.recordset")
rsinfo.open "select * from 资讯 where 编号=" & rs("资讯编号"),conn,1,1
If rsinfo.recordcount=1 then
response.write " 【<a href='admin_info_pl.asp?order=isinfo&id="&rs("资讯编号")&"&name="&rsinfo("名称")&"' title='查看该资讯所有评论'>"& rsinfo("名称")&"</a>(<a href='admin_info_mod.asp?id="&rsinfo("编号")&"' title='修改该资讯'>修改</a> | <a href='admin_city_mod.asp?ct="&rsinfo("城市")&"'>"&rsinfo("城市")&"</a>)】 "
end if
rsinfo.close
set rsinfo=nothing
if rs("审核")=0 then response.write " <a style='color:red' href='?order="&order&"&res="&rs("编号")&"'>【恢复】</a>"
%>
</td>
</tr>
<%
RowCount = RowCount - 1
rs.movenext
Loop
rs.close
set rs=nothing
%>
<tr bgcolor="#0099FF">
<td colspan="2" height="30"> <input type="checkbox" name="chkall" value="on" onclick="checkall(this)" ID="Checkbox2"><b><font color="#FFFFFF"> 全选所有</font></b></td>
</tr>
<tr>
<td height="50" colspan="2" align="center"><input type="submit" value=" 删 除 " name="mod"> <input type="reset" value=" 重 置 " name="B2"></td>
</tr>
</form>
</table>
</div>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -