X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fplayer.pl;h=93d93282d5a57a77b73f5fd33793854b38cb221d;hp=80011b0d6ba0c0b1acea1e226d95e81b276e3f17;hb=31c8c1f081e2f04dd0a2635aa27cf8dfdfb1f400;hpb=a2c8a5e21746cd1f040f412e6c534b1f0601e5b6 diff --git a/html/player.pl b/html/player.pl index 80011b0..93d9328 100755 --- a/html/player.pl +++ b/html/player.pl @@ -12,6 +12,12 @@ my $dbh = ccbs::db_connect(); my $player = $dbh->selectrow_hashref('SELECT * FROM players NATURAL JOIN countries NATURAL LEFT JOIN clubs WHERE player=?', undef, $id); my $bestsongs = ccbs::db_fetch_all($dbh, 'SELECT song,title,score,tournament,tournamentname FROM ( SELECT DISTINCT ON (song) song,score,tournament FROM scores WHERE player=? AND score IS NOT NULL ORDER BY song,score DESC ) t1 NATURAL JOIN songs NATURAL JOIN tournaments ORDER BY score DESC LIMIT 10', $id); +my ($countries, $clubs); +unless ($ccbs::ccbs_noadmin) { + $countries = ccbs::db_fetch_all($dbh, 'SELECT * FROM countries ORDER BY countrycode'); + $clubs = ccbs::db_fetch_all($dbh, 'SELECT * FROM clubs ORDER BY clubcode'); +} + # Fetch all scores and count a bit my $columns = 0; my @allsongs = (); @@ -38,6 +44,8 @@ ccbs::process_template('player.tmpl', $player->{'nick'}, { player => $player, bestsongs => $bestsongs, allsongs => \@allsongs, - columns => $columns + columns => $columns, + countries => $countries, + clubs => $clubs }); $dbh->disconnect;