summary_body.asp

来自「南鄂电子商务学校网: 学校概况、校园动态、师资力量、教学成果、师生论坛、友情链接」· ASP 代码 · 共 122 行

ASP
122
字号
<%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%>
              &nbsp;&nbsp;&nbsp;&nbsp; <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 + =
减小字号Ctrl + -
显示快捷键?