4 % if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) {
6 % unless ( $opt{'offset'} == 0 ) {
7 % $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'});
9 <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A>
16 % my $step = $opt{total} / 10; # 10 evenly spaced
17 % for ( my $poff = 0; $poff < $opt{total}; $poff += $opt{maxrecords} ) {
21 % $page <= 4 #first four
22 % || $page >= ( $opt{total} / $opt{maxrecords} ) - 3 #last four
23 % || abs( ($opt{offset}-$poff) / $opt{maxrecords} ) <= 3 #w/i 3 of current
24 % || $poff > $over # evenly spaced
27 % $over += $step if $poff > $over;
29 % if ( $opt{'offset'} == $poff ) {
31 <FONT SIZE="+2"><% $page %></FONT>
34 % $cgi->param('offset', $poff);
36 % if ( $page > $prevpage+1 ) {
40 <A HREF="<% $cgi->self_url %>"><% $page %></A>
48 % unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) {
49 % $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'});
51 <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A>