<html>
<head>
<title>WLoH-rating</title>
- <style type="text/css">
-body {
- color: black;
- background: white;
- font-family: sans-serif;
-}
-table {
- border-collapse: collapse;
- border: 1px solid black;
-}
-td, th {
- border: 1px solid black;
- padding: 5px;
-}
-td.num {
- text-align: right;
-}
-.even {
- background-color: #ddd;
-}
- </style>
+ <link rel="stylesheet" href="/style" type="text/css" />
</head>
<body>
<h1>WLoH-rating</h1>
- <p>Ratingen er basert på spilledata fra WLoH (takk til Lobotommy
+ <p><em>Dette er et hobbyprosjekt fra tredjepart, og ikke en offisiell del av
+ <a href="http://wordfeud.aasmul.net/">Wordfeud Leage of Honour</a>.</em></p>
+
+ <p>Ratingen er dog basert på spilledata fra WLoH (takk til Lobotommy
for tilgang!), og oppdateres
hver hele time. Den er fullstendig uoffisiell, og har ingen innflytelse
på WLoH, men brukes for å estimere vinnersannsynligheter i
150-0, 0-150 eller 150-150 ignoreres.</li>
</ul>
+ <h2>Divisjonsoversikt</h2>
+
+ <table>
+ <tr>
+ <th>Div.</th>
+ <th>Snitt</th>
+ <th>Std.avvik</th>
+ </tr>
+EOF
+
+$q = $dbh->prepare('SELECT divisjon,AVG(rating) AS avg_rating,STDDEV(rating) AS stddev_rating FROM ratings NATURAL JOIN siste_divisjon GROUP BY divisjon ORDER BY divisjon');
+$q->execute;
+
+my $i = 0;
+while (my $ref = $q->fetchrow_hashref) {
+ if (++$i % 2 == 0) {
+ print " <tr class=\"odd\">\n";
+ } else {
+ print " <tr class=\"even\">\n";
+ }
+ printf " <th>%d.</th>\n", $ref->{'divisjon'};
+ printf " <td class=\"num\">%.1f</td>\n", $ref->{'avg_rating'};
+ printf " <td class=\"num\">%.1f</td>\n", $ref->{'stddev_rating'};
+ print " </tr>\n";
+}
+
+print <<"EOF";
+ </table>
+
<h2>Rankingliste</h2>
<table>
ORDER BY rating DESC');
$q->execute;
-my $i = 0;
+$i = 0;
while (my $ref = $q->fetchrow_hashref) {
if (++$i % 2 == 0) {
print " <tr class=\"odd\">\n";