📄 news_1.asp
字号:
<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<%if session("admin")="" then
response.redirect "../index.asp"
end if%>
<%=citycss%>
<br>
<table width="97%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<form name="form1" method="post" action="news_1.asp?action=search">
<tr align=center bgcolor=#efefef><td height=25 align=center><input type="text" name="word"> <input type="submit" name="Submit" value="广告搜索"></td></tr>
</form>
</table>
<br>
<table width="97%" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr align=center bgcolor=#efefef>
<%
if request("action")="search" then
sql= "select * from news where title like'%"&request("word")&"%' and key1=false order by id desc"
else
sql="select * from news where key1=false order by id desc"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "暂无内容"
else
'分页的实现
listnum=20
Rs.pagesize=listnum
page=Request("page")
if (page-Rs.pagecount) > 0 then
page=Rs.pagecount
elseif page = "" or page < 1 then
page = 1
end if
Rs.absolutepage=page
'编号的实现
j=rs.recordcount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if%>
<td width="4%" height=20>编号</td>
<td width=*>广告名称</td>
<td width="10%">添加人</td>
<td width="5%">点击</td>
<td width="16%">添加时间</td>
<td width="5%">状态</td>
<td width="5%">删除</td>
</tr>
<%do while not rs.eof and i<listnum
n=n+1%>
<tr align=center height=20>
<td><%=n%></td>
<td align=left> <a href=newsedit.asp?id=<%=rs("id")%>&yp=news_1&page=<%=request("page")%>><%=rs("title")%></a></td>
<td><%if rs("enrol")=0 then%><font color=red>自己发布</font><%elseif rs("enrol")=1 then%><font color=blue>代理发布</font><%elseif rs("enrol")=2 then%>后台发布<%end if%></td>
<td><%=rs("htc")%></td>
<td><%=rs("date")%></td>
<td><%if rs("key1")=false then%><a href=newssave.asp?id=<%=rs("id")%>&key=true&action=key1&page=<%=request("page")%>&yp=news_1><font color=red>未审</font></a><%end if%></td>
<td><a href="newssave.asp?id=<%=rs("id")%>&action=del&yp=news_1&page=<%=request("page")%>">删除</a></td>
</tr>
<%rs.movenext
i=i+1
j=j-1
loop%>
<tr>
<%filename="news_1.asp"%>
<%response.write "<form method=post action="&filename&">"%>
<td colspan=10 align=right bgcolor=#cccccc><%=Rs.recordcount%> 条新闻 <%=listnum%> 条新闻/页 共 <%=Rs.pagecount%> 页
<% if page=1 then %>
<%else%>
<a href=<%=filename%>><strong>|<<</strong></a>
<a href=<%=filename%>?page=<%=page-1%>><strong><<</strong></a>
<a href=<%=filename%>?page=<%=page-1%>><b>[<%=page-1%>]</b></a>
<%end if%>
<% if Rs.pagecount=1 then %>
<%else%>
<b>[<%=page%>]</b>
<%end if%>
<% if Rs.pagecount-page <> 0 then %>
<a href=<%=filename%>?page=<%=page+1%>><b>[<%=page+1%>]</b></a>
<a href=<%=filename%>?page=<%=page+1%>><strong>>></strong></a>
<a href=<%=filename%>?page=<%=Rs.pagecount%>><strong>>>|</strong></a>
<%end if%>
<%response.write "转到:<input type='text' name='page' class=input size=4 maxlength=10 value="&page&">"
response.write " <input type='submit' class=input value='>>' name='cndok'>"%> </td>
<%end if%></tr>
</form>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -