8 my $machine = $cgi->param('machine');
10 my $dbh = ccbs::db_connect();
12 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);
17 my $show_challenge = 0;
18 for my $song (@$songs_raw) {
19 if ($song->{'song'} != $last_song) {
20 push @songs, { song => $song->{'song'}, title => $song->{'title'}, artist => $song->{'artist'} };
23 my $key = $song->{'playmode'} . '_' . $song->{'difficulty'};
24 $songs[$#songs]->{$key} = $song->{'feetrating'};
25 $last_song = $song->{'song'};
27 $show_challenge = 1 if ($song->{'difficulty'} eq 'challenge');
31 ccbs::process_template('songratings.tmpl', 'Sanger', {
33 show_challenge => $show_challenge