One paging function: displays "previous page" and so on.
-
'*************************************** ***********
- 'Function name: ShowPage
- 'Usage: displays "previous page" and other information
- 'Parameter: sFileName ---- link address
- 'Totalnumber ---- Total number
- 'Maxperpage'-number of pages per page
- 'Currentpage ---- current page
- 'Showtotal ---- whether to display the total number
- 'Showallpages --- whether to use the drop-down list to display all pages for redirect.
- 'Strunit ---- count unit
- 'Showmaxperpage ---- whether to display the information on each page option box
- 'Return value: the html code for "previous page" and other information
- '*************************************** ***********
- 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
-
StrTemp ="
"
- 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 Page"
- Else
- StrTemp = strTemp & "homepage"
- StrTemp = strTemp & "previous page"
- End If
-
If CurrentPage> = TotalPage Then
- StrTemp = strTemp & "next last page"
- Else
- StrTemp = strTemp & "next page"
- StrTemp = strTemp & "last page"
- End If
- StrTemp = strTemp & "page times:"& 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 toPage"
- Else
- StrTemp = strTemp & ":"For I = 1 To TotalPageStrTemp = strTemp &"If PE_CLng (CurrentPage) = PE_CLng (I) Then strTemp = strTemp & "selected"StrTemp = strTemp & "> page" & I &""NextStrTemp = strTemp &""
- End If
- End If
- StrTemp = strTemp &"
|
"
- ShowPage = strTemp
- End Function
- ?>
|