update empty fixture to something that is more up to date.
[sgn.git] / cgi-bin / phenome / individual.pl
blobd3c3ea80a568d04fcb4e9ee07d8cd94165c87ac8
1 use strict;
2 use warnings;
4 use CGI;
5 use CXGN::Phenome::Individual;
6 use CXGN::DB::Connection;
7 use CatalystX::GlobalContext qw( $c );
9 my $cgi = CGI->new;
10 my $individual_id = $cgi->param("individual_id");
12 my $dbh = $c->dbc->dbh;
14 unless ($individual_id =~m /^\d+$/) {
15 $c->throw( is_error=>0,
16 message => "No individual exists for identifier $individual_id",
19 my $individual = CXGN::Phenome::Individual->new($dbh, $individual_id) ;
20 #redirecting to the stock page
21 my $stock_id = $individual->get_stock_id;
22 $c->throw(is_error=>0,
23 message=>"No individual exists for identifier $individual_id",
24 ) if !$stock_id;
25 print $cgi->redirect("/stock/$stock_id/view", 301);