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,$productcatid; if ($where) { $safewhere=urlencode($where); } echo "<TABLE CELLPADDING=0 BORDER=0 CELLSPACING=0 WIDTH=100%><TR><TD align='right' class='pagenav'>"; if ($offset>=$limit) { $newoff=$offset-$limit; echo "<A HREF=\"$PHP_SELF?page=product.php&productcatid=$productcatid&offset=$newoff&where=$safewhere#show\" class='pagenav'><</A>"; } else { echo "<"; } echo " "; 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=product.php&productcatid=$productcatid&offset=$newoff&where=$safewhere#show\" class='pagenav'>$i</A> "; } } echo " "; if ($offset!=$limit*($numpage-1)) { $newoff=$offset+$limit; echo "<A HREF=\"$PHP_SELF?page=product.php&productcatid=$productcatid&offset=$newoff&where=$safewhere#show\" class='pagenav'>></A>"; }else{ echo ">"; } echo "</TD></TR></TABLE>";
} // END FUNCTION if ($numpage>1) { pagenav(); } ?>
|