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

📄 admin_news_show.asp

📁 [FIF]ASP互动视频VIP教程 书包
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="../config/db.asp"-->
<!--#include file="../config/function.inc.asp"-->
<html>
<head>
<title>后台新闻管理</title><meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body,td,th {
	font-size: 12px;
}
-->
</style></head>
<% on error resume next
    dim sql,rst,rst1,sql1
    set rst=server.createobject("adodb.recordset")
	set rst1=server.createobject("adodb.recordset")
'处理参数
pagelistnum=15'设置每页显示15件商品
if request.QueryString("page")="" then
  page=1
else
  page=request.QueryString("page")
end if
if session("admin_ncid")="" then session("admin_ncid")="0"
if request.QueryString("c")<>"" then session("admin_ncid")=request.QueryString("c")
%>

<body>
<div align="center">后台新闻管理
</div>
<p>功能:<a href="admin_news_add.asp?act=news" target="_blank">添加新闻</a></p>
<p>
<form  method="post" enctype="multipart/form-data"  name="form1" target="_blank" id="form1">
  选择需要操作的分类:
  <select name="upid1" id="upid1" onChange="javascript:location='admin_news_show.asp?c='+this.value;">
    <option value="0" selected>==所有分类==</option>
    <%  
	sql="select * from tbl_newsclass where nc_upid=0"
	rst.open sql,conn,1,1
	do while not rst.eof 

	sql1="select * from tbl_newsclass where nc_upid=" & rst("nc_id")
	rst1.open sql1,conn,1,1
	  do while not rst1.eof
%>
    <option value=<%=rst1("nc_id")%> <% if cint(session("admin_ncid"))=rst1("nc_id") then response.Write(" selected") %>><%=rst("nc_name")%>--><%=rst1("nc_name")%></option>
<%
	  rst1.movenext
	  loop
	  rst1.close
  rst.movenext
  loop
  rst.close
%>
  </select>
</form></p>
<p>新闻列表:</p>
<table width="100%" border="1" cellspacing="0" cellpadding="0">
  <tr>
    <td width="100"><div align="center"><strong>新闻id</strong></div></td>
    <td width="100"><div align="center"><strong>所属分类</strong></div></td>
    <td width="200"><div align="center"><strong>新闻标题</strong></div></td>
    <td width="200"><div align="center"><strong>新闻内容</strong></div></td>
    <td width="80"><div align="center"><strong>浏览次数</strong></div></td>
    <td width="200"><div align="center">管理</div></td>
  </tr>

<%
sql="select top " & (page*pagelistnum) & " * from tbl_news,tbl_newsclass where n_ncid=nc_id"
sqlfy="select count(*) as num from tbl_news,tbl_newsclass where n_ncid=nc_id"'翻页函数所需SQL语句
if cint(session("admin_ncid"))<>0 then'只显示选中的类别
  sql=sql & " and nc_id=" & session("admin_ncid")
  sqlfy=sqlfy & " and nc_id=" & session("admin_ncid")
end if
sql=sql & " order by n_top asc,n_id desc"
rst.open sql,conn,1,1
rst.PageSize=pagelistnum
rst.AbsolutePage=page
do while not rst.eof 
%>
  <tr>
    <td width="100"><div align="center"><%=rst("n_id")%></div></td>
    <td width="100"><%=rst("nc_name")%></td>
    <td width="200"><div align="center"><% response.write cutstr(rst("n_title"),20,"..") %></div></td>
    <td width="200"><div align="center"><% response.write cutstr(rst("n_content"),20,"..") %></div></td>
    <td width="80"><div align="center"><%=rst("n_show")%></div></td>
    <td width="200"><div align="center">
<% if rst("n_top")=true then %>
      <a href="admin_news_act.asp?act=top1&id=<%=rst("n_id")%>" target="_blank">取消置顶</a>
      <% else %>
	  <a href="admin_news_act.asp?act=top&id=<%=rst("n_id")%>" target="_blank">置顶</a>
<% end if %>

    <a href="admin_news_modify.asp?act=modify&id=<%=rst("n_id")%>" target="_blank">修改</a>&nbsp;<a href="admin_news_act.asp?act=del&id=<%=rst("n_id")%>&file=<%=rst("n_image")%>" target="_blank" onClick="javascript:return confirm('您确定要删除此链接吗?');">删除</a></div></td>
	
<%
  rst.movenext
  loop
  rst.close
  set rst=nothing
%>
  </tr>
</table>
<div align="center"><br>
<%
	fy sqlfy,page,pagelistnum,"admin_news_show.asp?t="
%>
</div>
</body>
</html>

⌨️ 快捷键说明

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