sub ShowPage(Url,TotleNum,NumPerPage,page,ShowJump,pagestyle)
  '函数名:showpage(Url,TotleNum,NumPerPage,ShowJump)
    '作  用:显示分页代码
    '参  数:Url:传递查询参数
    '        TotleNum:总条数
 '        NumPerPage:每页条数
 '        ShowJump:是否显示跳转按钮 (true or false)
 '        pagestyle:  1:上一页下一页    2:多页
 if TotleNum<=NumperPage Then Exit Sub 
    Url=trim(Url)
 'arrurl=Url       '为跳转框实现GET功能
 if Url<>"" then Url=Url&"&"
 Dim strTemp
 if TotleNum mod NumPerPage=0 then
     n= TotleNum\NumPerPage
   else
     n= TotleNum\NumPerPage+1
   end if 
  ' strTemp= "<table align='center'  width=""94%""><tr><td align=""right"">"
 strTemp=strTemp & "页次:" & Page & "/" & n & "页 "
 strTemp=strTemp & NumPerPage & "条/页 "
 strTemp=strTemp & "共" & TotleNum & "条 &nbsp;&nbsp;&nbsp;&nbsp;" 
  select case pagestyle
    case 1
 if Page<2 then
      strTemp=strTemp & "<font color=""#999999"">首页 上页</font> "
   else
      strTemp=strTemp & "<a href='?" & Url & "page=1'  class=""link"">首页</a> "
      strTemp=strTemp & "<a href='?" & Url & "page=" & (Page-1) & "'  class=""link"">上页</a> "
   end if
   if n-Page<1 then
      strTemp=strTemp & "<font color=""#999999"">下页 尾页</font> "
   else
      strTemp=strTemp & "<a href='?" & Url & "page=" & (Page+1) & "'  class=""link"">下页</a> "
      strTemp=strTemp & "<a href='?" & Url & "page=" & n & "'  class=""link"">尾页</a>  "
   end if
  case 2
    if page-1 mod 10=0 then
  p=(page-1) \ 10
 else
  p=(page-1) \ 10
 end if
 if p*10>0 then strTemp=strTemp &"<a href='?" & Url & "page="&p*10&"' title=上十页 >[&lt;&lt;]</a>   "
    uming_i=1
 for ii=p*10+1 to P*10+10
     if ii=page then 
          strTemp=strTemp &"<strong><font color=#ff0000>["+Cstr(ii)+"]</font></strong> "
     else
       strTemp=strTemp &"<a href='?" & Url & "page="&ii&"'>["+Cstr(ii)+"]</a> "
     end if
  if ii=n then exit for
   uming_i=uming_i+1
 next
   if ii<=n and uming_i=11 then strTemp=strTemp &"<a href='?" & Url & "page="&ii&"' title=下十页>[&gt;&gt;]</a>  "
   end select 
 
  
 if ShowJump=True then strTemp=strTemp & "  &nbsp;跳至第&nbsp;<input type=text size=3 name=""Page"">页 <input type=""Submit"" name=""Submit"" value=""跳转""  class=""sbe_button""> "
 'strTemp=strTemp & "</td></tr></table>"
 response.write strTemp
 
end sub

posted on 2010-07-30 13:47  houbusheng123  阅读(185)  评论(0编辑  收藏  举报