?? summary_body.asp
字號:
<%sub summary_body()
dim totalart,Currentpage,totalpages,i,j,colname
sql="select summary_id,summary_title,summary_date,summary_count from summary order by summary_date ASC"
if request("keyword")<>"" then
sql="select summary_id,summary_title,summary_date,summary_count from summary where "&request("select")&" like '%"&request("keyword")&"%'order by summary_date ASC"
elseif request("keyword")<>"" then
sql="select summary_id,summary_title,summary_poster,summary_date,summary_count from summary where summary_title or summary_content like '%"&request("keyword")&"%'order by summary_date ASC"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
%>
<table width="<%=tablewidth%>" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF">
<tr>
<td width="580" valign="top" bgcolor="#eaf4ff" class="line">
<table width="98%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#09DD77" style="border-collapse: collapse">
<tr align="center">
<td height="25" width="55%" background="images/dh.gif"><B>概況標題</B></td>
<td width="20%" background="images/dh.gif"><B>瀏覽次數</B></td>
<td width="25%" background="images/dh.gif"><B>發表時間</B></td>
</tr>
<%
if not rs.eof then
rs.movefirst
rs.pagesize=summaryperpage
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
totalart=rs.recordcount
if currentpage<>1 then
if(currentpage-1)*summaryperpage<totalart then
rs.move(currentpage-1)*summaryperpage
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalart mod teachperpage)=0 then
totalpages=totalart\summaryperpage
else
totalpages=totalart\summaryperpage+1
end if
i=0
do while not rs.eof and i<summaryperpage
%>
<tr>
<td bgcolor="#FFFFFF" height="22"><a href="showsummary.asp?summary_id=<%=rs("summary_id")%>"><%if len(rs("summary_title"))>28 then
response.write ""&left(rs("summary_title"),26)&"..."
else
response.write ""&rs("summary_title")
end if%></a></td>
<td height="22" align="center" bgcolor="#FFFFFF"><%=rs("summary_count")%></td>
<td bgcolor="#FFFFFF" align="center" ><%=rs("summary_date")%> </td>
</tr>
<%
i=i+1
rs.movenext
loop
else
if rs.eof and rs.bof then
%>
<tr align="center">
<td bgcolor="#FFFFFF" height="22" colspan="3">當前沒有師資!</td>
</tr>
<%end if
end if%>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0" align="center">
<form name="form1" method="post" action="summary.asp?select=<%=request("select")%>&keyword=<%=request("keyword")%>">
<tr>
<td align="right"><%=currentpage%> /<%=totalpages%>頁,共<%=totalart%>條記錄,<%=summaryperpage%>篇/每頁.
<%
if currentpage>9 then
i=int(currentpage/10)*10-1
if i+9>totalpages then
showye=totalpages
else
showye=int(currentpage/10)*10+10
end if
elseif totalpages<=10 then
i=1
showye=totalpages
else
i=1
showye=10
end if
for j=i to showye
if j=currentpage then
%>
<B><%=j%></B>
<%else%>
<a href="summary.asp?page=<%=j%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>"><%=j%></a>
<%end if
next
if totalpages>currentpage then
if request("page")="" then
page=2
else
page=currentpage+1
end if%>
<a href="summary.asp?page=<%=page%>&select=<%=request("select")%>&keyword=<%=request("keyword")%>" title="下一頁">>></a>
<%end if%>
<input type="text" name="page" class="input" style="width:30px;">
<input name="Submit" type="image" value="Go" src="images/pic/go.gif" width="30" height="17"></td>
</tr>
</form>
</table>
<br>
<br> </td>
<td width="190" align="center" valign="top" bgcolor="#09DD77">
<%call summarycat()%>
</td>
</tr>
</table>
<%
rs.close
set rs=nothing
end sub%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -