1 % if ( $opt{'total'} != $opt{'num_rows'} && $opt{'maxrecords'} ) {
3 % unless ( $opt{'offset'} == 0 ) {
4 % $cgi->param('offset', $opt{'offset'} - $opt{'maxrecords'});
5 <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Previous</FONT></B></A>
11 % my $step = $opt{total} / 10; # 10 evenly spaced
12 % for ( my $poff = 0; $poff < $opt{total}; $poff += $opt{maxrecords} ) {
16 % $page <= 4 #first four
17 % || $page >= ( $opt{total} / $opt{maxrecords} ) - 3 #last four
18 % || abs( ($opt{offset}-$poff) / $opt{maxrecords} ) <= 3 #w/i 3 of current
19 % || $poff > $over # evenly spaced
22 % $over += $step if $poff > $over;
24 % if ( $opt{'offset'} == $poff ) {
26 <FONT SIZE="+2"><% $page %></FONT>
29 % $cgi->param('offset', $poff);
31 % if ( $page > $prevpage+1 ) {
35 <A HREF="<% $cgi->self_url %>"><% $page %></A>
43 % unless ( $opt{'offset'} + $opt{'maxrecords'} > $opt{'total'} ) {
44 % $cgi->param('offset', $opt{'offset'} + $opt{'maxrecords'});
45 <A HREF="<% $cgi->self_url %>"><B><FONT SIZE="+1">Next</FONT></B></A>
48 % $cgi->param('offset', $orig_offset); #so future $self_url invocations don't advance a page
55 my $orig_offset = $opt{'offset'};