<%args> $id => undef $display_set => undef % unless (@awards) % { % } % else % {
 
 

No Awards
% foreach my $award_title (@awards) { % my @awds1 = $db->select_rows( sql => "select award_eng,award_big5,name_eng,name_big5,award_results.award_year,award_title_eng,award_title_big5,is_win from awards,award_results,people,movies,award_titles where awards.id=award_id and movie_id=? and people.id=people_id and movies.id=movie_id and award_title_id=award_titles.id and award_eng=\"$award_title->{award_eng}\"" , bind => [ $id ], hashref => 1 ); %if(scalar @awds1 gt 0){ % foreach my $awd1 (@awds1) { % if ($awd1->{award_eng} eq $award_title->{award_eng}){ % if($awd1->{is_win} eq 1) { % } else { %} % } % } % } % } % foreach my $award_title1 (@awards) { % my @awds2 = $db->select_rows( sql => "select award_eng,award_results.award_year,award_title_eng,is_win from awards,award_results,movies,award_titles where awards.id=award_id and movie_id=? and people_id is NULL and movies.id=movie_id and award_title_id=award_titles.id and award_eng=\"$award_title1->{award_eng}\"" , bind => [ $id ], hashref => 1 ); %if(scalar @awds2 gt 0){ % foreach my $awd2 (@awds2) { % if ($awd2->{award_eng} eq $award_title1->{award_eng}){ % if($awd2->{is_win} eq 1) { % } else { %} % } % } % } % }
<% $award_title->{award_eng} %>
<% $awd1->{name_eng} %>WonNominated<% $awd1->{award_title_eng} %> (<% $awd1->{award_year} %>)
<% $award_title1->{award_eng} %>
<% $awd2->{name_eng} %>WonNominated<% $awd2->{award_title_eng} %> (<% $awd2->{award_year} %>)
% } <%init> ### Check for errors # This'll be passed to /db/common/error.mhtml if # required args are missing my @missing_args; # Required args push(@missing_args, 'id') unless ($id); push(@missing_args, 'display_set') unless ($display_set); # Call error.mhtml if we're missing something if (@missing_args) { $m->comp('/db/common/error.mhtml', errors => [ { description => 'Missing arguments', args => \@missing_args } ], display_set => $display_set ); } my $db = new HKMDB::Database; my @awards = $db->select( table => 'awards', select => [ 'id', 'award_eng', 'award_big5' ], order_by => 'award_' . $display_set );