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 = ();
}
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;