?? newslist3.asp
字號:
<!--#include file="../include/bkconn.asp"-->
<!--#include file="checkUser.asp"-->
<%
dim rs,sql
dim page,maxPerPage
maxPerPage=10 '每頁顯示的記錄數
myKeyword=Request("myKeyword")
page=Request("page")
if (page="" or isempty(page)) then page=1
thisUrl="newsList.asp?myKeyword="&myKeyword
session("adminOldUrl")=thisUrl&"&page="&page
set rs=server.createobject("adodb.recordset")
sql="select * from new1 where 1=1"
if not (myKeyword="" or isempty(myKeyword) ) then
sql=sql&" and (title like '%"&myKeyword&"%' or content like '%"&myKeyword&"%')"
end if
sql=sql&" order by id desc"
'response.write sql
'response.End
rs.open sql,conn,1,1
rs.pagesize=MaxPerPage
%>
<html>
<head>
<title>新聞管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="../main.css" type="text/css">
<script language=Javascript>
<!--
function jumpTo(i){
if(i==1){
this.document.location="<%=thisUrl%>";}
if(i==2){
this.document.location="<%=thisUrl%>&page=<%=page-1%>";}
if(i==3){
this.document.location="<%=thisUrl%>&page=<%=page+1%>";}
if(i==4){
this.document.location="<%=thisUrl%>&page=<%=rs.pageCount%>";}
}
//-->
</script>
<script language=Javascript src="../include/opennew.js"--></script>
</head>
<body bgcolor="#9CC7EF" text="#000000" leftmargin="0" topmargin="0">
<div align="center"><br>
信息 管理 </div>
<table width="98%" border="1" bordercolordark=#9CC7EF bordercolorlight=#145AA0 cellspacing="0" cellpadding="4" align="center">
<tr>
<form method="post" action="newsList3.asp" name="form1">
<td colspan="2" bgcolor="#4296E7"> <div align="right"><font color="#FFFFFF">關鍵詞</font>
<input type="text" name="myKeyword" size="16" value="<%=myKeyword%>">
<input type="submit" name="Submit" value="搜索">
</div></td>
</form>
</tr>
<tr bgcolor="#5EA5E6">
<td width="65%" nowrap> <div align="center"><font color="#FFFFFF"> 標題</font></div></td>
<td width="16%" nowrap> <div align="center"><font color="#FFFFFF">發布日期</font></div></td>
</tr>
<%
dim rsID
i=1
if not (rs.eof or err) then rs.move (page-1)*maxPerPage
do while not (rs.eof or err)
rsID=rs("id")
newsDate=rs("newsDate")
%>
<tr>
<td width="65%" title="點擊查看具體信息" style="cursor:hand" onClick="Javascript:window.location='newsMod3.asp?id=<%=rs("id")%>'"><%=rs("title")%> </td>
<td width="16%"><%=year(newsDate)%>年<%=month(newsDate)%>月<%=day(newsDate)%>日</td>
</tr>
<%
i=i+1
if i>maxPerPage then exit do
rs.moveNext
loop
%>
<tr bgcolor="#4296E7">
<td colspan="2"> <div align="right"><font color=#FFFFFF><%=rs.recordCount%>
項 第<%=page%>/<%=rs.pageCount%> 頁 </font>
<%if page>1 then%>
<input type="button" name="Submit3" value="首頁" onClick="Javascript:jumpTo(1)">
<input type="submit" name="Submit4" value="上頁" onClick="Javascript:jumpTo(2)">
<%else%>
<input type="button" name="Submit3" value="首頁" disabled>
<input type="submit" name="Submit4" value="上頁" disabled>
<%end if
if rs.recordCount>page*maxPerPage then%>
<input type="submit" name="Submit5" value="下頁" onClick="Javascript:jumpTo(3)">
<input type="submit" name="Submit6" value="末頁" onClick="Javascript:jumpTo(4)">
<%else%>
<input type="submit" name="Submit5" value="下頁" disabled>
<input type="submit" name="Submit6" value="末頁" disabled>
<%end if%>
</div></td>
</tr>
</table>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -