<?php

require 'header.php';

$query = "SELECT songid FROM " . QUEUECONTENTSTABLE . " AS q LEFT JOIN " . SONGSTABLE . " AS s ON q.songid=s.id WHERE qid=:qid ORDER BY s.album, s.title";
$fields = array();
$fields[':qid'] = $_SESSION['queuetarget'];
$sth = $globaldbh->prepare($query);
$sth->execute($fields);

$data = array();
$firstsong = true;
while ( $row = $sth->fetch() ) {
   $songid = $row['songid'];
   $song = new Song($songid);
   echo "<div id='customq_{$songid}' class='songlist_song_container' onClick='dropCustomQSong({$songid});'>\n";
   echo "  <div class='songlist_img_container'><img class='songlist_img' src='{$song->getArtFile(ARTURL)}'></div>\n";
   echo "  <div class='songlist_details_container'>\n";
   echo "    <p class='nomargin'><span class='playing_label'>Song:</span> {$song->getTitle(HTMLSAFE)}</p>\n";
   echo "    <p class='nomargin'><span class='playing_label'>Artist:</span> {$song->getArtist(HTMLSAFE)}</p>\n";
   echo "    <p class='nomargin'><span class='playing_label'>Album:</span> {$song->getAlbum(HTMLSAFE)}</p>\n";
   echo "  </div>\n";
   echo "</div>\n";
   echo "<hr class='songlist'>\n";
}
exit();


?>
