zoukankan      html  css  js  c++  java
  • asp通用分页函数

     1<%dim rs3,pm3,bg
     2page=clng(request("page"))
     3set rs3 = server.createobject("adodb.recordset")
     4sql3 = "select distinct brlword from userinfo where bfenshuduan='"&key&"' order by brlword"
     5rs3.open sql3,conn,1,1
     6if rs3.eof then
     7%>
     8    <tr>
     9      <td width="580" colspan="5">
    10    <p align="center"><font color="#FF0000">对不起,没有符合条件的高校!</font>
    11
    12      </td>
    13    </tr>
    14    <tr>
    15     <td width="580" colspan="5">
    16<else %>
    17<%
    18const maxperpage=1
    19dim currentpage
    20rs3.pagesize=maxperpage
    21currentpage=request.querystring("pageid")
    22if currentpage="" then
    23currentpage=1
    24elseif currentpage<1 then
    25currentpage=1
    26else
    27currentpage=clng(currentpage)
    28    if currentpage > rs3.pagecount then
    29    currentpage=rs3.pagecount
    30    end if
    31end if
    32
    33if not isnumeric(currentpage) or currentpage="" then
    34currentpage=1
    35end if
    36dim totalput,n
    37totalput=rs3.recordcount
    38if totalput mod maxperpage=0 then
    39n=totalput\maxperpage
    40else
    41n=totalput\maxperpage+1
    42end if
    43if n=0 then
    44n=1
    45end if
    46rs3.move(currentpage-1)*maxperpage
    47i=0
    48do while i< maxperpage and not rs3.eof
    49        %>
    50        <tr>
    51        <td><%=getschoolinfo(rs3("brlword"),1)%></td>
    52        <td><%=getschoolinfo(rs3("brlword"),2)%></td>
    53        <td><%=getschoolinfo(rs3("brlword"),5)%></td>
    54        <td><%=getschoolinfo(rs3("brlword"),3)%></td>
    55        <td><%=getschoolinfo(rs3("brlword"),4)%></td>
    56      </tr>
    57<%                                                                         
    58i=i+1                                                      
    59rs3.movenext                                                        
    60loop                                                                                 
    61                                    
    62%>   
    63    </table>
    64<p align="center">页数:<%=currentpage%>/<=n%>                                                       
    65       <%k=currentpage                                                                                
    66       if k<>1 then%>                                                            
    67       <a href="picitop2.asp?pageid=1">首页</a>                                                                                
    68       <a href="picitop2.asp?pageid=<%=k-1%>&key=<%=key%>">上一</a>                                                                                
    69       <%else%>                                                            
    70       首页 上一页                                                                                
    71       <%end if%>                                                            
    72       <%if k<>then%>                                                                                
    73       <a href="picitop2.asp?pageid=<%=k+1%>&key=<%=key%>">下一</a>                                                                                
    74       <a href="picitop2.asp?pageid=<%=n%>&key=<%=key%>">尾页</a>                                                                                
    75       <%else%>                                                            
    76       下一页 尾页                                                                                
    77       <%end if%>                                                            
    78     共为您找到<font color="red"><%=totalput%></font>所高校
    79 
  • 相关阅读:
    QT QQuickView嵌入到QT MDI中
    地理入门-经纬度时区速成总结篇(转)
    Linux下系统时间函数、DST等相关问题总结(转)
    camera接口---MIPI CSI-2接口、DVP接口和FPD-Link III LVDS、GMSL等接口对比(转)
    基于spi FLASH的嵌入式文件系统 littlefs(转)
    PID 温控系统 解决方法(转)
    单相计量芯片RN8209D使用经验分享(转)
    【开源】EasyFlash 新年发布 V4.0 beta 版,完全重写(转)
    在uboot中加入cmd_run命令,运行环境变量(转)
    MPU6050开发 -- 数据分析(转)
  • 原文地址:https://www.cnblogs.com/icejd/p/190053.html
Copyright © 2011-2022 走看看