📄 news_admin.asp
字号:
<%
if request.cookies("adminok")="" then
response.redirect "shop_login.htm"
end if
%>
<!--#include file="setup.asp" -->
<%
dim pmcount,pageno
pmcount=25
dim rs,sql
set rs=server.createobject("adodb.recordset")
%>
<html>
<head>
<title>新闻管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../news/style.css" type="text/css">
<script language="javascript">
function view(id){
var id;
window.open('view.asp?id='+id,'_blank','status=no,scrollbars=yes,top=20,left=110,width=580,height=420');
}
</script>
</head>
<body bgcolor="#FFFFFF">
<div align="center">
<script language="JavaScript">
function cdel(id,cata,page){
var id;
if (confirm("你真的要删除这条新闻吗?")){
document.location.href="news_delete.asp?action=del&id="+id+"&cataid="+cata+"&pageno="+page;
}
}
</script>
<%=news_title%> - 管理 </div>
<table width="100%" border="0" align="center" cellspacing="3" cellpadding="3">
<tr>
<td colspan="2"><%=news_title%> - <font color="#FF0000">N</font><font color="#FF9900">e</font><font color="#00CC00">w</font><font color="#0000FF">s</font>
center</td>
</tr>
<tr>
<td width="1" valign="top"> </td>
<td nowrap>
<table width="100%" border="1" cellspacing="0" cellpadding="0" bordercolordark="#FFFFFF" bordercolorlight="#000000">
<tr>
<td colspan="4" bgcolor="#8CAAE7">
<div align="right">...::
<%
response.write catid
%>
::...</div>
</td>
</tr>
<tr>
<%if request("cataid")="" then%>
<td width="14%" bgcolor="#BECFF1">
<div align='center'>类别</div>
</td>
<%end if%>
<td width="63%" bgcolor="#BECFF1">
<div align="center">标题</div>
</td>
<td width="15%" bgcolor="#BECFF1">
<div align="center">修改</div>
</td>
<td width="8%" bgcolor="#BECFF1">
<div align='center'>删除</div>
</td>
</tr>
<%
if cataid="" then
sql="select * from news order by id desc"
else
sql="select * from news where cataid='"&catid&"' order by id desc"
end if
rs.open sql,conn,1,1
rcount=rs.recordcount
if pmcount="" or isempty(pmcount) or pmcount<1 then
pmcount=25
end if
rs.pagesize=pmcount '设置每页数
mpage=rs.pagecount '得到总页数
pageno=request("pageno")
if isempty(pageno) or cint(pageno)<1 or cint(pageno)>mpage then
pageno=1
end if
if rs.bof and rs.eof then
response.write "<tr><td colspan='5'><div align='center'>没有新闻</div></td></tr>"
else
rs.absolutepage=pageno '将指针移至指定页的第一条记录
loopno=pmcount
do while not rs.eof and loopno>0
%>
<tr>
<%if request("cataid")="" then%>
<td width="14%">
<div align='center'><%=rs("cataid")%></div>
</td>
<%end if%>
<td width="63%"><a href="javascript:view(<%=rs("id")%>)">
<% if rs("special") then
response.write "●"& rs("title")
else
response.write "○"& rs("title")
end if
if rs("image")<>"" then
response.write "<img src='images/news.gif' border=0>"
end if
select case right(rs("linkurl"),4)
case ".zip"
response.write "<img src='images/zip.gif' border=0>"
case ".rar"
response.write "<img src='images/rar.gif' border=0>"
case ".exe"
response.write "<img src='images/exe.gif' border=0>"
end select%>
</a></td>
<td width="15%">
<div align='center'><a href="news_editnews.asp?id=<%=rs("id")%>">修改</a></div>
</td>
<td width="8%">
<div align='center'><a href="javascript:cdel('<%=rs("id")%>','<%=cataid%>','<%=pageno%>')">删除</a></div>
</td>
</tr>
<%
rs.movenext
loopno=loopno-1
loop
end if
rs.close
set rs=Nothing
endconnection
%>
</table>
<table width="100%" border="0" cellspacing="2" cellpadding="2" class=buinput>
<tr align="right">
<td>
<%
if cint(pageno)>1 then%>
[<a href='news_admin.asp?cataid=<%=cataid%>&pageno=<%=pageno-1%>'>上一页</a>]
<%
end if
if cint(pageno)<cint(mpage) then
%>
[<a href='news_admin.asp?cataid=<%=cataid%>&pageno=<%=pageno+1%>'>下一页</a>]
<%end if%>
共<%=cstr(pageno)&"/"&cstr(mpage)&"页 "&cstr(rcount)%>条新闻</td>
</tr>
</table>
</td>
</tr>
</table>
<script language="JavaScript">
document.write("<hr width='80%' size='1'>");
document.write("<div align='center' style=fontsize:9pt;><font face='Verdana, Arial, Helvetica, sans-serif'>");
document.write("<a href=<%=homepage_link%> target=_blank><font color=red><%=homepage_title%></font></a> - <a href=<%=news_location%>\default.asp><font color=black><%=news_title%></font></a><br>");
document.write("<br>");
var current_version="<%=current_version%>";
</script>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -