/var/www/(Del)pathways.org.hk/tc/gallerypagenav.php


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?
    
function pagenav() {
        global 
$limit,$offset,$numpage,$where,$gallerytype,$galleryid;
        if (
$where) {
            
$safewhere=urlencode($where);
        }
        echo 
"<div class='pagenav'><TABLE CELLPADDING=0 BORDER=0 CELLSPACING=0 WIDTH=100%><TR><TD align='right'>page number ";
            if (
$offset>=$limit) {
                
$newoff=$offset-$limit;
                echo 
"<A HREF=\"$PHP_SELF?page=galleryphoto.php&gallerytype=$gallerytype&offset=$newoff&where=$safewhere#show\">&lt;</A>";
            } else {
                echo 
"&lt;";
            }
            echo 
"&nbsp;";
            for (
$i=1;$i<=$numpage;$i++) {
                if (((
$i-1)*$limit)==$offset) {
                    print 
"<strong><font color='#000000'>$i</font></strong> ";
                } else {
                    
$newoff=($i-1)*$limit;
                    echo 
"<A HREF=\"$PHP_SELF?page=galleryphoto.php&gallerytype=$gallerytype&offset=$newoff&where=$safewhere#show\">$i</A> ";
                }
            }
            echo 
"&nbsp;";
            if (
$offset!=$limit*($numpage-1)) {
                
$newoff=$offset+$limit;
                echo 
"<A HREF=\"$PHP_SELF?page=galleryphoto.php&gallerytype=$gallerytype&offset=$newoff&where=$safewhere#show\">&gt;</A>";
            }else{
                echo 
"&gt;";
            }
            echo 
"</TD></TR></TABLE></div>";

    } 
// END FUNCTION
    
if ($numpage>1) {
        
pagenav();
    }
    
?>