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

📄 admin_news_show.asp

📁 商业网站/图片管理系统/投票系统/新闻管理系统/
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<%option explicit%>
<%
if request.cookies("admin_OK")="" then
	response.redirect("admin_login.html")
end if
%>
<!--后台新闻管理-->
<%dim db
db=0
%>
<!--#include file="../config/db.asp"-->
<!--#include file="../config/function.inc.asp"-->

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>后台新闻管理</title>
<link href="../css/mycss.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
-->
</style>
</head>
<%
dim sql,rst,sql1,rst1,sqlfy,page,pagelistnum,myErrors
set rst=server.CreateObject("adodb.recordset")
set rst1=server.CreateObject("adodb.recordset")
on error resume next
%>
<%
'------------------------处理参数---------------------------------
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>&nbsp;<a href="admin_newsclass.asp">添加分类</a></p>
<form action="" method="post" enctype="multipart/form-data" name="form1" target="_blank" id="form1">
	选择需要操作的分类:
	<select name="select" size="1" onChange="javascript:location='admin_news_show.asp?c='+this.value;">
		<option value="0" selected="selected">所有分类</option>
		<%
		sql="select * from shop_newsclass where nc_upid=0"
		rst.open sql,conn,1,1
		do while not rst.eof
			sql1="select * from shop_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>
<div align="center">
	<table width="780" height="48" border="1" cellpadding="0" cellspacing="0" bordercolor="#333333">
		<tr>
			<td height="17" align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">新闻ID</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">所属分类</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">新闻标题</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">新闻内容</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="center">新闻图片</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">浏览次数</div></td>
			<td align="center" valign="middle" bgcolor="#DCDCDC"><div align="left">管理</div></td>
		</tr>
		<%
		sql="select top " & (page*pagelistnum) & " * from shop_newsclass,shop_news where n_ncid=nc_id"
		sqlfy="select count(*) as num from shop_newsclass,shop_news where n_ncid=nc_id"'分页函数所需SQL语句
		if 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	
		if rst.eof and rst.bof then
			response.Write("<div align='center' class='STYLE1'>还没有记录,或参数错误</div>")	
			response.End()	
		end if
			do while not rst.eof 
						
		%>
		<tr>
			<td><div align="left"><%=rst("n_id")%></div></td>
			<td><div align="left"><%=rst("nc_name")%></div></td>
			<td><div align="left">
				<%response.write cutstr(rst("n_title"),20,"..")%>
			</div></td>
			<td><div align="left">
				<%response.write cutstr(rst("n_content"),20,"..")%>
			</div></td>
			<td>
				<div align="center">
					<% if rst("n_image")<>"" then %>
					<img src="../upfile/<%=rst("n_image")%>">
					<%end if%>			
				</div></td>
			<td><div align="left"><%=rst("n_show")%></div></td>
			<td>
				<div align="left">
					<%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>
		</tr>
		<%
				rst.movenext
			loop
		rst.close
		
		%>
	</table>
	
</div>
<%
	fy sqlfy,page,pagelistnum,"admin_news_show.asp?t="
%>
<%
		set rst1=nothing
		set rst=nothing
		conn.close
		set conn=nothing

%>
</body>
</html>

⌨️ 快捷键说明

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