make test pass for multicat parsing with two xlsx files for testing.
[sgn.git] / cgi-bin / community / groups / biofools / index.pl
blob43418bc772e60b28bd9578163cf5add8ad3eeadc
1 use CXGN::Page;
2 use CXGN::Tools::File;
3 my $page = CXGN::Page->new("Biofools Group Page", "Chris Carpita");
5 my ($left_bound, $record_size) =
6 $page->get_arguments(
7 qw/ left_bound record_size /);
9 $left_bound ||= 1;
10 $record_size ||= 20;
12 my ($content, $size, $total) = CXGN::Tools::File::get_div_sections(
13 "families.txt",
14 $record_size,
15 $left_bound - 1
18 my $navbar = nav_bar($left_bound, $size, $total);
19 my $navinfo = nav_info($left_bound, $size, $total);
21 my $wholebar = <<HTML;
22 <table width="100%">
23 <tr>
24 <td style="text-align:left">
25 $navinfo
26 </td>
27 <td style="text-align:right">
28 $navbar
29 </td></tr></table>
30 HTML
32 $page->header();
35 print <<HTML;
36 <center>
37 <h2>Biofools Home Page</h2>
38 $wholebar
39 <hr>
40 $content
42 $wholebar
43 </center>
44 HTML
46 $page->footer();
49 sub nav_bar {
50 my ($lb, $size, $total) = @_;
51 my $next_lb = $lb + $size;
52 $next_lb = $total - $size + 1 if $next_lb >= $total;
53 my $prev_lb = $lb - $size;
54 $prev_lb = 1 if $prev_lb < 1;
56 my $last_lb = $total - $size + 1;
57 my $first_lb = 1;
59 my $content = <<HTML;
60 <a href="?left_bound=$first_lb&record_size=$size">&lt;&lt; First</a>&nbsp;&nbsp;
61 <a href="?left_bound=$prev_lb&record_size=$size">&lt; Prev</a>&nbsp;&nbsp;
62 <a href="?left_bound=$next_lb&record_size=$size">Next &gt;</a>&nbsp;&nbsp;
63 <a href="?left_bound=$last_lb&record_size=$size">Last &gt;&gt;</a>
64 HTML
65 return $content;
69 sub nav_info {
70 my ($lb, $size, $total) = @_;
71 my $last = $lb + $size - 1;
72 return "Records $lb - $last out of $total";