'*********************************************************
'Function name: ShowPage
'Function: Display information such as "Previous Page Next Page"
'Parameter: sFileName----link address
'TotalNumber---Total Number
'MaxPerPage----Number of each page
'ShowTotal----Does the total number be displayed
'ShowAllPages--Whether to display all pages with a drop-down list for redirection. Some pages cannot be used, otherwise a JS error will occur.
'strUnit----Counting Units
'Return value: HTML code for information such as "Previous page Next page"
'*********************************************************
functionShowPage(sFileName,TotalNumber,MaxPerPage,ShowTotal,ShowAllPages,strUnit)
dimTotalPage,strTemp,strUrl,i
ifTotalNumber=0orMaxPerPage=0orisNull(MaxPerPage)then
ShowPage=""
exitfunction
endif
iftotalnumbermodmaxperpage=0then
TotalPage=totalnumber/maxperpage
Else
TotalPage=totalnumber/maxperpage+1
endif
ifCurrentPage>TotalPagethenCurrentPage=TotalPage
strTemp="<tablealign='center'><tr><td>"
ifShowTotal=truethen
strTemp=strTemp&"共<b>"&totalnumber&"</b>"&strUnit&""
endif
strUrl=JoinChar(sfilename)
ifCurrentPage<2then
strTemp=strTemp&"Homepage Previous Page"
Else
strTemp=strTemp&"<ahref='"&strUrl&"page=1'>Home</a>"
strTemp=strTemp&"<ahref='"&strUrl&"page="&(CurrentPage-1)&"'>Previous Page</a>"
endif
ifCurrentPage>=TotalPagethen
strTemp=strTemp&"Next page last page"