Add list over tournaments.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 00:06:27 +0000 (00:06 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 00:06:27 +0000 (00:06 +0000)
html/templates/tournaments.tmpl [new file with mode: 0644]
html/tournaments.pl [new file with mode: 0755]

diff --git a/html/templates/tournaments.tmpl b/html/templates/tournaments.tmpl
new file mode 100644 (file)
index 0000000..492434e
--- /dev/null
@@ -0,0 +1,8 @@
+[%# vim:set filetype=html: %]
+<div>
+  <ul>
+[% FOR t = tournaments %]
+    <li><a href="show-tournament.pl?id=[% t.tournament %]">[% t.tournamentname %]</a></li>
+[% END %]
+  </ul>
+</div>
diff --git a/html/tournaments.pl b/html/tournaments.pl
new file mode 100755 (executable)
index 0000000..1f00a95
--- /dev/null
@@ -0,0 +1,11 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+my $tournaments = ccbs::db_fetch_all($dbh, 'SELECT * FROM tournaments');
+
+ccbs::print_header();
+ccbs::process_template('tournaments.tmpl', 'Turneringer', { tournaments => $tournaments });