package wloh_common;
+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 output_last_sync {
my $dbh = shift;
my $ref = $dbh->selectrow_hashref('SELECT EXTRACT(EPOCH FROM last_sync) AS last_sync FROM last_sync');
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) = @_;
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);