From: Steinar H. Gunderson
Date: Sun, 25 Mar 2012 15:21:41 +0000 (+0200)
Subject: Factor out the division selector into its own function.
X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=aad9399b1ff68ba788c922872288b1e778484af1;p=wloh
Factor out the division selector into its own function.
---
diff --git a/www/index.pl b/www/index.pl
index ef2e15e..b754d4c 100755
--- a/www/index.pl
+++ b/www/index.pl
@@ -77,6 +77,50 @@ sub get_subdivisions {
return @subdivisions;
}
+sub print_division_selector {
+ my ($dbh, $divisions, $subdivisions, $division, $subdivision) = @_;
+
+ print <<"EOF";
+
+EOF
+}
+
sub make_table {
my ($lowest_division, $used_ratings, $used_cov) = @_;
@@ -216,51 +260,15 @@ printf <<"EOF", $match_stddev;
Tallene vil variere litt fra gang til gang fordi utregningen skjer ved randomisering.
Spillerne er sortert etter nick.
-
-
-EOF
+print_division_selector($dbh, \@divisions, \@subdivisions, $division, $subdivision);
# Get players and ratings
my $sum_rating = 0.0;
@@ -305,6 +313,7 @@ while (my $ref = $q->fetchrow_hashref) {
$cov->{$ref->{'player1'}}{$ref->{'player2'}} = $ref->{'cov'};
}
+my $max_division = $divisions[$#divisions];
my $lowest_division = ($division == $max_division);
make_table($lowest_division, {}, {});