]> git.sesse.net Git - ccbs/blobdiff - html/shorttitles.pl
Add a simple web interface for adding/updating short titles. (No backend yet.)
[ccbs] / html / shorttitles.pl
diff --git a/html/shorttitles.pl b/html/shorttitles.pl
new file mode 100755 (executable)
index 0000000..c6b93c8
--- /dev/null
@@ -0,0 +1,19 @@
+#! /usr/bin/perl
+
+use ccbs;
+use strict;
+use warnings;
+
+my $cgi = new CGI;
+my $id = $cgi->param('id');
+
+my $dbh = ccbs::db_connect();
+
+# FIXME: This will fail with multiple short titles.
+my $songs = ccbs::db_fetch_all($dbh, 'SELECT song,title,shorttitle FROM songs NATURAL LEFT JOIN songshorttitles ORDER BY LOWER(title)');
+
+ccbs::print_header();
+ccbs::process_template('shorttitles.tmpl', 'Korte titler', {
+       songs => $songs,
+});
+$dbh->disconnect;