From abbaff9060fe3d0436dbaa2e3b272da30f8767ff Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Mon, 14 Feb 2005 00:10:35 +0000 Subject: [PATCH] Organize tournaments by season. --- html/templates/tournaments.tmpl | 22 +++++++++++++++++----- html/tournaments.pl | 2 +- 2 files changed, 18 insertions(+), 6 deletions(-) diff --git a/html/templates/tournaments.tmpl b/html/templates/tournaments.tmpl index 492434e..f0a5906 100644 --- a/html/templates/tournaments.tmpl +++ b/html/templates/tournaments.tmpl @@ -1,8 +1,20 @@ [%# vim:set filetype=html: %] -
- +
[% END %] - - +[% SET last_season = t.season %] + +

[% t.seasonname %]

+ +
+ +
diff --git a/html/tournaments.pl b/html/tournaments.pl index 1f00a95..169d84d 100755 --- a/html/tournaments.pl +++ b/html/tournaments.pl @@ -5,7 +5,7 @@ use strict; use warnings; my $dbh = ccbs::db_connect(); -my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments'); +my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments NATURAL JOIN seasons ORDER BY season, date'); ccbs::print_header(); ccbs::process_template('tournaments.tmpl', 'Turneringer', { tournaments => $tournaments }); -- 2.39.2