my $dbh = ccbs::db_connect();
-my $songs_raw = ccbs::db_fetch_all($dbh, 'SELECT song,title,playmode,difficulty,feetrating FROM songratings NATURAL JOIN songs WHERE machine=? ORDER BY machine,song', $machine);
+my $songs_raw = ccbs::db_fetch_all($dbh, 'SELECT song,title,artist,playmode,difficulty,feetrating FROM songratings NATURAL JOIN songs WHERE machine=? ORDER BY LOWER(title)', $machine);
my @songs = ();
my $show_challenge = 0;
for my $song (@$songs_raw) {
if ($song->{'song'} != $last_song) {
- push @songs, { song => $song->{'song'}, title => $song->{'title'} };
+ push @songs, { song => $song->{'song'}, title => $song->{'title'}, artist => $song->{'artist'} };
}
my $key = $song->{'playmode'} . '_' . $song->{'difficulty'};
ccbs::print_header();
ccbs::process_template('songratings.tmpl', 'Sanger', {
songs => \@songs,
+ show_challenge => $show_challenge
});
$dbh->disconnect;