]> git.sesse.net Git - wloh/blobdiff - www/index.pl
Move get_max_season() into the common package.
[wloh] / www / index.pl
index fb4d8ce87034cfd2107729f76ef94c8720ca4c10..109caae89e568f69e70bb1e0ecc47ec3ee6ebe82 100755 (executable)
@@ -39,12 +39,6 @@ sub color {
        return int(255.0 * ($x ** (1.80)));
 }
 
-sub get_max_season {
-       my $dbh = shift;
-       my $ref = $dbh->selectrow_hashref('SELECT MAX(sesong) AS max_sesong FROM fotballserier');
-       return $ref->{'max_sesong'};
-}
-
 sub get_divisions {
        my ($dbh, $season) = @_;
 
@@ -361,7 +355,7 @@ my $subdivision = $cgi->param('avdeling') // -1;
 my $match_player = $cgi->param('spiller');
 my $match_position = $cgi->param('posisjon');
 
-my $season = get_max_season($dbh);
+my $season = wloh_common::get_max_season($dbh);
 my @divisions = get_divisions($dbh, $season);
 $division = 1 if (!grep { $_ == $division } @divisions);
 my @subdivisions = get_subdivisions($dbh, $season, $division);