end if
if int_curpage>int_totalpage then
int_curpage=int_totalpage
end if
end sub
'====================================================================
'showpage 创建分页导航条
'有首页、前一页、下一页、末页、还有数字导航
'
'====================================================================
public sub showpage()
dim str_tmp
str_url = geturl()
if int_totalrecord= 0 then call getpage()
'==================================================================
'显示分页信息,各个模块根据自己要求更改显求位置
'==================================================================
response.write ""
str_tmp=showfirstprv
response.write str_tmp
str_tmp=shownumbtn
response.write str_tmp
str_tmp=shownextlast
response.write str_tmp
str_tmp=showpageinfo
response.write str_tmp
response.write ""
end sub
'====================================================================
'showfirstprv 显示首页、前一页
'
'
'====================================================================
private function showfirstprv()
dim str_tmp,int_prvpage
if int_curpage=1 then
str_tmp=btn_first&" "&btn_prev
else
int_prvpage=int_curpage-1
str_tmp="<a href="""&str_url & "1" & """>" & btn_first&"</a> <a href=""" & str_url & cstr(int_prvpage) & """>" & btn_prev&"</a>"
end if
showfirstprv=str_tmp
end function
'====================================================================
'shownextlast 下一页、末页
'
'
'====================================================================
private function shownextlast()
dim str_tmp,int_nextpage
if int_curpage>=int_totalpage then
str_tmp=btn_next & " " & btn_last
else
int_nextpage=int_curpage+1
str_tmp="<a href=""" & str_url & cstr(int_nextpage) & """>" & btn_next&"</a> <a href="""& str_url & cstr(int_totalpage) & """>" & btn_last&"</a>"
end if
shownextlast=str_tmp
end function
'====================================================================
'shownumbtn 数字导航
'每次显示10页
'
'====================================================================
private function shownumbtn()
dim i,str_tmp,m,n
m = int_curpage - 4
n = int_totalpage
if n>1 then
for i = 1 to 10
if m < 1 then m = 1
if m > n then
exit for
end if
str_tmp=str_tmp & "[<a href=""" & str_url & cstr(i) & """>"&i&"</a>] "
m = m + 1
next
end if
shownumbtn=str_tmp
end function