Function Makepage(RecordCounts,ThisPage,FrontPage,AllPage,PageCounts)
if
ThisPage < 1
then
ThisPage = 1
elseif ThisPage > PageCounts then
ThisPage = PageCounts
end if
if AllPage > PageCounts then
AllPage = PageCounts
end if
if ThisPage - FrontPage < 1 then
Start = 1
sEnd = AllPage
elseif ThisPage + AllPage - FrontPage > PageCounts
then
Start = PageCounts - AllPage + 1
sEnd = PageCounts
else
Start = ThisPage - FrontPage
sEnd = ThisPage - FrontPage + AllPage - 1
end if
for i = Start to sEnd
if i = 1 then
Url = "1"
else
Url = i
end if
if i = ThisPage then
Pages = Pages & "<font color=""#ff0000""><b>["&i&"]</b></font> "
else
Pages = Pages & "<a href=""../"&Url&"/"">["&i&"]</a> "
end if
next
if ThisPage = 1 then
Fpage = "首页"
Lpage = "上一页"
else
Fpage = "<a
href=""../1/"">首页</a>"
if ThisPage = 2 then
Fpage = "<a
href=""../1/"">上一页</a>"
else
Lpage = "<a
href=""../"&ThisPage - 1&"/"">上一页</a>"
end if
end if
if ThisPage = PageCounts then
Npage = "下一页"
Rpage = "尾页"
else
Npage = "<a
href=""../"&ThisPage + 1&"/"">下一页</a>"
Rpage = "<a
href=""../"&PageCounts&"/"">尾页</a>"
end if
Makepage = "共"&RecordCounts&"条记录 页次:"&ThisPage&"/"&PageCounts&"页 "&Fpage&" "&Lpage&" "&Pages&" "&Npage&" "&Rpage&" "
Makepage = Makepage & "<select name=""page"" onChange=javascript:location.href=""../""+document.all.page.options[document.all.page.selectedIndex].value+""/"" size=""1"">"
for i = 1 to PageCounts
Makepage = Makepage & "
<option value="""&i&""" "
if ThisPage = i then Makepage = Makepage & "selected"
Makepage = Makepage & ">第"&i&"页</option>"
next
Makepage = Makepage & "</select>"
End Function