A paging function: display "previous page next page" etc. WBOY Original
2016-07-25 09:02:51 1800browse
'************************************ ****************
'Function name: ShowPage 'Function: Display "previous page next page" and other information 'Parameter: sFileName ----Link address ' TotalNumber ----Total quantity ' MaxPerPage ----Quantity per page ' CurrentPage ----Current page ' ShowTotal ----Whether to display the total quantity ' ShowAllPages ---Whether to use a drop-down list to display all pages for jumping. ' strUnit ---- Counting unit ' ShowMaxPerPage ---- Whether to display the amount of information per page option box ' Return value: HTML code for information such as "previous page next page" '****** ************************************************ Function ShowPage(sfilename, totalnumber, MaxPerPage, CurrentPage, ShowTotal, ShowAllPages, strUnit, ShowMaxPerPage) Dim TotalPage, strTemp, strUrl, i
If totalnumber = 0 Or MaxPerPage = 0 Or IsNull(MaxPerPage) Then
ShowPage = " "
Exit Function
End If
If totalnumber Mod MaxPerPage = 0 Then
TotalPage = totalnumber MaxPerPage
Else
TotalPage = totalnumber MaxPerPage + 1
End If
If CurrentPage > TotalPage Then CurrentPage = TotalPage
"
If ShowTotal = True Then
strTemp = strTemp & "total" & totalnumber & " " & strUnit & " "
End If
If ShowMaxPerPage = True Then
strUrl = JoinChar(sfilename) & "MaxPerPage=" & MaxPerPage & "&"
Else
strUrl = JoinChar(sfilename)
End If
If CurrentPage = 1 Then
strTemp = strTemp & "Home Previous Page"
Else
strTemp = strTemp & "Home "
strTemp = strTemp & " Previous Page "
End If
If CurrentPage > = TotalPage Then
strTemp = strTemp & "Next page last page"
Else
strTemp = strTemp & "Next Page "
strTemp = strTemp & "Last Page "
End If
strTemp = strTemp & "Page:" & CurrentPage & " /" & TotalPage & " Page"
If ShowMaxPerPage = True Then
strTemp = strTemp & " " & strUnit & "/page"
Else
strTemp = strTemp & " " & MaxPerPage & " " & strUnit & "/Page"
End If
If ShowAllPages = True Then
If TotalPage > 20 Then
strTemp = strTemp & " Go to page Page"
Else
strTemp = strTemp & " Go to: "
For i = 1 To TotalPage
strTemp = strTemp & "If PE_CLng(CurrentPage) = PE_CLng(i) Then strTemp = strTemp & " selected "strTemp = strTemp & ">Page" & i & "Page "
Next
strTemp = strTemp & ""
End If
End If
strTemp = strTemp & "
"
ShowPage = strTemp
End Function
?> p>
Copy code
Statement: The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn