5 use CXGN
::DB
::Connection
;
8 use CatalystX
::GlobalContext
'$c';
10 my $page = CXGN
::Page
->new("view_fish.pl","john,marty");
11 my ($image_size) = $page->get_encoded_arguments('size');
12 my ($clone_id) = $page->get_encoded_arguments('id');
13 my ($image_id) = $page->get_encoded_arguments('image_id');
15 # Argument validation.
16 unless ($clone_id && $image_id) {
17 $page->message_page ("This page requires two arguments, and at least one wasn't supplied.");
19 unless (($clone_id =~ /\d+/) && ($image_id =~ /\d+/)) {
20 $page->message_page ("Bogus page arguments supplied ($clone_id, $image_id)");
24 unless ($image_size =~ /(full|small)/i) {
25 $image_size = 'small';
28 my $dbh = CXGN
::DB
::Connection
->new;
29 # ensure that the image_id is a fish image
31 if ($dbh->selectrow_array("select fish_result_id from fish_result_image where image_id = ?", undef, $image_id)) {
32 $image = SGN
::Image
->new( $dbh, $image_id, $c );
36 my $fish_table = CXGN
::Fish
::fish_image_html_table
($dbh, $clone_id);
39 if ($image_size =~ /full/i) {
40 $image_url = $image->get_image_url('large');
41 $size_control = "<b>Size:</b>
42 <a href=\"?id=$clone_id&image_id=$image_id&size=small\">Small</a>
43 Full"
45 $image_url = $image->get_image_url();
46 $size_control = "<b>Size:</b> Small
47 <a href=\"?id=$clone_id&image_id=$image_id&size=full\">Full</a>"
50 $page->header("View FISH image");
52 <a href="/maps/physical/clone_info.pl?id=$clone_id">Return to Clone info page</a>
60 <a href="/image/index.pl?image_id=$image_id"><img src=\"$image_url\" /></a>
64 $page->message_page("Clone image not found.");