3 use CXGN
::DB
::Connection
;
5 use CXGN
::Page
::FormattingHelpers qw
/ page_title_html info_section_html columnar_table_html /;
6 use CXGN
::Insitu
::Toolbar
;
7 use CXGN
::Insitu
::Experiment
;
8 use CXGN
::Insitu
::ExperimentSearch
;
10 use CXGN
::People
::Person
;
12 my $page = CXGN
::Page
->new();
13 my $dbh = CXGN
::DB
::Connection
->new();
16 print page_title_html
( qq{ <a href
="/insitu/">Insitu
</a
> Database
} );
18 display_toolbar
("search");
20 my $exp_search = CXGN
::Insitu
::ExperimentSearch
->new();
21 my $exp_query = $exp_search->new_query();
25 $exp_search->page_size(10);
27 my %params = $page->get_all_encoded_arguments();
29 $exp_query->from_request(\
%params);
37 $result = $exp_search->do_search($exp_query);
38 $total_results=$result->total_results();
39 if ($total_results <= 0 ) {
40 print "<b>No results</b>\n";
44 while (my $r = $result->next_result()) {
45 #push @results, [ $r->[0], $r->[1], $r->[2], $r->[3], $r->[4], $r->[5], $r->[6], $r->[7], $r->[8], $r->[9] ];
46 my $experiment_id = $r->[0];
47 my $experiment = CXGN
::Insitu
::Experiment
->new($dbh, $experiment_id);
48 my $experiment_name = $experiment->get_name();
49 my $tissue = $experiment->get_tissue();
50 my $stage = $experiment->get_stage();
51 my $experiment_image_count = $experiment->get_images();
52 my $submitter = CXGN
::People
::Person
->new($dbh, $experiment->get_user_id());
53 my $submitter_name = $submitter->get_first_name()." ".$submitter->get_last_name();
54 push @results, [ qq { <a href
="/insitu/detail/experiment.pl?experiment_id=$experiment_id&action=view">$experiment_name</a
> }, $stage, $tissue, $experiment_image_count, $submitter_name ];
57 $page_html = $exp_search->pagination_buttons_html($exp_query, $result);
64 $html .= columnar_table_html
( headings
=> [ 'Experiment', 'Stage', 'Tissue', '# images', 'Submitter' ],
67 print info_section_html
( title
=>"Insitu Search Results", subtitle
=>"$total_results"." Results" , empty_message
=>"No results" , contents
=>$html.$page_html);
69 print info_section_html
( title
=>"Search again", contents
=>"<form action=\"#\">".$exp_query->to_html()."</form><br />" );