⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 admin_comment.asp

📁 俄罗斯方块源码 俄罗斯方块源码 俄罗斯方块源码
💻 ASP
字号:
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<%
if session("admin")="" then
  response.redirect "admin_login.asp"
end if

'10 友情链接管理
if not checkflag("10") then
  call mb("对不起,您没有管理评论的权限!","",0)
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>网友评论相关</title>
<script language=javascript src="mouse_up.js"></script>
<link href="admin.css" rel="stylesheet" type="text/css">
</head>

<body leftmargin="5" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="0" bgcolor="#000000" vspace="0" hspace="0">
  <tr bgcolor="#EFEBEF"> 
    <td height="27"><table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr> 
          <td width="86%"><font color="#FF3000">.:: 您可以在这里进行[评论管理]相关操作</font></td>
          <td width="14%" height="20" align="center"><a href="javascript:this.location.reload()"><img src="images/refresh.gif" alt="刷新" width="40" height="12" border="0"></a></td>
        </tr>
      </table></td>
  </tr>
  <tr > 
    <td height="1" bgcolor="#000000"></td>
  </tr>
</table>
<%
if request("action")="del" then
  call del()
else
  call showcomment()
end if

sub showcomment()

response.expires=0

'on error resume next

dim totalpage,maxperpage,totalrecords,i,CurrentPage

currentpage=request("page")
if not isinteger(currentpage) then
  currentpage=1
else
  currentpage=clng(currentpage)
end if

maxperpage=15
totalrecords=0
totalpage=1
i=1

set rs=server.createobject("adodb.recordset")
sql="select * from comment order by id desc,comid desc"
rs.open sql,conn,1,1

if not(rs.bof and rs.eof) then
  rs.pagesize=maxperpage
  rs.absolutepage=currentpage
  totalpage=rs.pagecount
  totalrecords=rs.recordcount
end if
%>
<br>
<br>
<form action="?action=del" method="post" name="del" id="del">
  <table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
    <tr align="center" bgcolor="#EFEBEF"> 
      <td width="5%" height="23"><font color="#000000">ID</font></td>
      <td width="17%" height="23"><font color="#000000">网友大名</font></td>
      <td width="21%" height="23"><font color="#000000">网友Email</font></td>
      <td width="48%" height="23"><font color="#000000">评论内容</font></td>
      <td width="9%" height="23"><font color="#000000">删 除</font></td>
    </tr>
    <%do until rs.eof or i>maxperpage%>
    <tr bgcolor="#FFFFFF"> 
      <td height="23">&nbsp;<%=rs("comid")%></td>
      <td height="23">&nbsp;<%=rs("name")%></td>
      <td height="23">&nbsp; <%=rs("email")%> </td>
      <td height="23">&nbsp; <%=rs("comment")%> </td>
      <td height="23" align="center"><input name="comid" type="hidden" id="comid" value="<%=rs("comid")%>">
        <input name="sel<%=rs("comid")%>" type="checkbox" id="sel<%=rs("comid")%>" value="on"></td>
    </tr>
    <%rs.movenext
   i=i+1
   loop
   
  %>
    <tr align="center" bgcolor="#FFFFFF"> 
      <td height="30" colspan="5"> 
        <input name="Submit" type="submit" class="button" value=" 删除所选 ">
         
<input name="chkall" type="checkbox" id="chkall" onclick="CheckAll(this.form)" value="">
        &nbsp;全 选 </td>
    </tr>
  <%if totalrecords>0 then%>
    <tr bgcolor="#FFFFFF"> 
      <td height="23" colspan="5"> 
        <% call showpage("admin_comment.asp",totalrecords,maxperpage,true,true,"条评论")%>
      </td>
    </tr>
    <%
  end if%>
  </table>
  <script language=javascript>
<!--
function CheckAll(form)  {
  for (var i=0;i<form.elements.length;i++)    {
    var e = form.elements[i];
    if (e.name != 'chkall')       
	 e.checked = form.chkall.checked; 
   }
  }
-->
</script>
</form>
<%
rs.close
set rs=nothing

end sub

sub del()

dim comid:comid=request("comid")
dim j

comid=split(comid,",")

for j=0 to ubound(comid)
  if request("sel"&trim(comid(j)))="on" then   '如果评论选上
    conn.execute("delete from comment where comid="&clng(trim(comid(j))))
  end if
next

call mb("删除评论成功!","admin_comment.asp",1)

end sub
%>
</body>
</html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -