From: Steinar H. Gunderson Date: Mon, 4 Apr 2005 14:09:32 +0000 (+0000) Subject: Sync with --pgweb. X-Git-Url: https://git.sesse.net/?p=ccbs;a=commitdiff_plain;h=576539ce9dfb2a74bc786d86e0f5c9131f2a452f;hp=d2bf21e6f3f51a40b8901d570ac02e8a2061dc5f Sync with --pgweb. Patches applied: * sgunderson@bigfoot.com--2005-private/ccbs--pgweb--1.0--patch-20 Add a script for showing all players. --- diff --git a/html/players.pl b/html/players.pl new file mode 100755 index 0000000..8158d4d --- /dev/null +++ b/html/players.pl @@ -0,0 +1,18 @@ +#! /usr/bin/perl + +use ccbs; +use strict; +use warnings; + +my $cgi = new CGI; +my $id = $cgi->param('id'); + +my $dbh = ccbs::db_connect(); + +my $players = ccbs::db_fetch_all($dbh, 'SELECT player,nick,countryname,clubname,count(*) AS num_songs,COUNT(DISTINCT song) AS num_unique_songs,COUNT(DISTINCT tournament) AS num_tournaments,AVG(score)::integer AS avg_score,MAX(score) AS high_score FROM scores NATURAL JOIN players NATURAL JOIN countries NATURAL LEFT JOIN clubs GROUP BY player,nick,countryname,clubname ORDER BY LOWER(nick)'); + +ccbs::print_header(); +ccbs::process_template('players.tmpl', 'Players', { + players => $players, +}); +$dbh->disconnect; diff --git a/html/templates/index.tmpl b/html/templates/index.tmpl index 28ec269..466c76e 100644 --- a/html/templates/index.tmpl +++ b/html/templates/index.tmpl @@ -9,6 +9,7 @@