]> git.sesse.net Git - ccbs/commitdiff
Added a form (no logic yet) for adding tournaments.
authorSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 01:56:35 +0000 (01:56 +0000)
committerSteinar H. Gunderson <sesse@samfundet.no>
Mon, 14 Feb 2005 01:56:35 +0000 (01:56 +0000)
html/add-tournament.pl [new file with mode: 0755]
html/templates/add-tournament.tmpl [new file with mode: 0644]

diff --git a/html/add-tournament.pl b/html/add-tournament.pl
new file mode 100755 (executable)
index 0000000..44c0536
--- /dev/null
@@ -0,0 +1,23 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $dbh = ccbs::db_connect();
+
+# Fetch stuff we'll use in the form
+my $seasons = ccbs::db_fetch_all($dbh, 'SELECT * FROM seasons');
+my $countries = ccbs::db_fetch_all($dbh, 'SELECT * FROM countries');
+my $machines = ccbs::db_fetch_all($dbh, 'SELECT * FROM machines');
+my $scoringsystems = ccbs::db_fetch_all($dbh, 'SELECT * FROM scoringsystems');
+
+ccbs::print_header();
+ccbs::process_template('add-tournament.tmpl', 'Legg til turnering', {
+               seasons => $seasons,
+               countries => $countries,
+               machines => $machines,
+               scoringsystems => $scoringsystems,
+       });
+
+$dbh->disconnect;
diff --git a/html/templates/add-tournament.tmpl b/html/templates/add-tournament.tmpl
new file mode 100644 (file)
index 0000000..832167c
--- /dev/null
@@ -0,0 +1,62 @@
+[%# vim:set filetype=html: %]
+<div>
+<form action="do-add-tournament.pl" method="post">
+  <table>
+    <tr>
+      <th>Sesong:</th>
+      <td>
+        <select name="season">
+[% FOR season = seasons %]
+           <option value="[% season.season %]">[% season.seasonname %]</option>
+[% END %]         
+       </select>
+      </td>
+    </tr>
+    <tr>
+      <th>Navn:</th>
+      <td><input name="name" /></td>
+    </tr>
+    <tr>
+      <th>Land:</th>
+      <td>
+        <select name="country">
+[% FOR country = countries %]
+           <option value="[% country.country %]">[% country.countryname %]</option>
+[% END %]         
+       </select>
+      </td>
+    </tr>
+    <tr>
+      <th>Sted:</th>
+      <td><input name="place" /></td>
+    </tr>
+    <tr>
+      <th>Dato:</th>
+      <td><input name="date" /></td>
+    </tr>
+    <tr>
+      <th>Maskin:</th>
+      <td>
+        <select name="machine">
+[% FOR machine = machines %]
+           <option value="[% machine.machine %]">[% machine.machinename %]</option>
+[% END %]         
+       </select>
+      </td>
+    </tr>
+    <tr>
+      <th>Scoresystem:</th>
+      <td>
+        <select name="scoringsystem">
+[% FOR scoringsystem = scoringsystems %]
+           <option value="[% scoringsystem.scoringsystem %]">[% scoringsystem.scoringsystemname %]</option>
+[% END %]         
+       </select>
+      </td>
+    </tr>
+    <tr>
+      <td colspan="2"><input type="submit" value="Legg inn" /></td>
+    </tr>
+  </table>
+</form>
+</div>