Add a simple web interface for adding/updating short titles. (No backend yet.)
[ccbs] / html / shorttitles.pl
1 #! /usr/bin/perl
2
3 use ccbs;
4 use strict;
5 use warnings;
6
7 my $cgi = new CGI;
8 my $id = $cgi->param('id');
9
10 my $dbh = ccbs::db_connect();
11
12 # FIXME: This will fail with multiple short titles.
13 my $songs = ccbs::db_fetch_all($dbh, 'SELECT song,title,shorttitle FROM songs NATURAL LEFT JOIN songshorttitles ORDER BY LOWER(title)');
14
15 ccbs::print_header();
16 ccbs::process_template('shorttitles.tmpl', 'Korte titler', {
17         songs => $songs,
18 });
19 $dbh->disconnect;