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

📄 news_admin.asp

📁 使用Asp+Access+FSO+Jmail+Servu开发
💻 ASP
字号:
<!--#include file="admin.asp"-->

<%if Request.QueryString("do")="yes" then
chk_admin_login(3)
dim SQL, Rs, contentID,CurrentPage
CurrentPage = request("Page")
contentID=request("ID")
set rs=server.createobject("adodb.recordset")
sqltext="delete from [news] where Id="& contentID
rs.open sqltext,conn,3,3
set rs=nothing
conn.close
response.write"<script>alert('删除成功!');location.href='news_admin.asp'</script>"
end if
set rs=server.createobject("adodb.recordset")
sqltext="select * from [news] order by id desc"
rs.open sqltext,conn,1,1

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
<script language=JavaScript>
function del()
{
	if (confirm("真的要删除这条记录吗?删除后将无法恢复!"))
	{
		return true;
	}
	else
	{
		return false;
	}
}
</script>
</head>
<body>
<table width="550" border="1" align="center" cellpadding="4" cellspacing="0" class="table-line">
  <tr class="td-title-color">
    <td colspan="4" align="center"><table  border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="shadow">新闻管理</td>
        </tr>
      </table></td>
  </tr>
  <tr>
    <td colspan="4"><a href="news_add.asp"><img src="images/addnew.jpg" width="126" height="24" border="0"></a></td>
  </tr>
  <tr class="td-title-color">
    <td width="37" height="25" align="center"> ID</td>
    <td width="295" align="center"> 新闻标题</td>
    <td width="64" align="center"> 新闻类型</td>
    <td width="112" align="center"> 操 作</td>
  </tr>
  <%
if not rs.eof then
do while not rs.eof
%>
  <tr onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#BFDFFF'">
    <td height="22" align="center"> <%=rs("id")%></td>
    <td>&nbsp;&nbsp;<%=rs("title")%> [<%=rs("time")%>]</td>
    <td align="center">
      <%select case rs("type")
	  case "news"
	  Response.Write("最新公告")
      case "help"
      Response.Write("帮助信息")
      end select%>
    </td>
    <td align="center"> <a href=../news_show.asp?Id=<%=rs("id")%> target="_blank">查看</a> | <a href="news_edit.asp?id=<%=rs("id")%>">修改</a> | <a href="news_admin.asp?id=<%=rs("id")%>&do=yes" onClick="return del();">删除</a></td>
  </tr>
  <% 
rs.movenext 
loop 
end if
rs.close
%>
</table>

</body>
</html>

⌨️ 快捷键说明

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