X-Git-Url: https://git.sesse.net/?p=ccbs;a=blobdiff_plain;f=html%2Fplayer.pl;h=93d93282d5a57a77b73f5fd33793854b38cb221d;hp=ce0e7137312fdc3027bdaf89f84b93eab892e4f4;hb=d4f2692e015be09f0018f645e32f867f62446d22;hpb=34050d5b545b678e2af2980657d0f90a9d9de521 diff --git a/html/player.pl b/html/player.pl index ce0e713..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 = (); @@ -34,10 +40,12 @@ for my $score (@$scores) { } ccbs::print_header(); -ccbs::process_template('player.tmpl', $player->{'title'}, { +ccbs::process_template('player.tmpl', $player->{'nick'}, { player => $player, bestsongs => $bestsongs, allsongs => \@allsongs, - columns => $columns + columns => $columns, + countries => $countries, + clubs => $clubs }); $dbh->disconnect;