<?php

require 'header.php';

if ( isset($_REQUEST['searchfor']) ) {
   $searchfor = $_REQUEST['searchfor'];
} else {
   exit();
}

$songs = Song::getSearchList($searchfor);

foreach ( $songs as $song ) {
   echo "<div id='search_{$song->getID()}' class='songlist_song_container' onClick='addSongToQueue({$song->getID()});'>\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();


?>
