public/lib/playlist.php
/*
    * @abstract Given a list of albums, build and return an html table of the information
    * @param array $albums A list of albums with their information
    * @param string $color The color associated with the table
    * @return string The html code for the albums table
    */
@abstract Given a list of albums, build and return an html table of the information
@param array $albums A list of albums with their information
@param string $color The color associated with the table
@return string The html code for the albums table
@abstract Given a list of albums build and return an html table of the information @param array $albums A list of albums with their information @param string $color The color associated with the table @return string The html code for the albums table
public function createPDFTable($albums, $color) {
	$html = "<table cellspacing='0' cellpadding='2' class='{$color}-table'><tr><th>#</th><th>Artist</th><th>Album</th><th>Subgenres</th><th>Hometowns</th><th>Date Added</th></tr>";
        foreach ($albums as $album) {
            $html .= "<tr><td class='centered'>"  . str_pad(strval($album['SmallCode']), 4, '0', STR_PAD_LEFT) . "</td>" .
                     "<td>" . $album['library']['artist'] . "</td>" .
            	     "<td>" . $album['library']['album'];
	    if ($album['library']['rating'] >= 4)
		$html .= "   <img class='star' style='width: 12px; vertical-align:baseline;' src='../../../images/recommended.png' />";
	    $html .= "</td>";
            $html .= "<td>";
            foreach ($album['library']['subgenres'] as $subgenre)
                $html .= "-" . $subgenre . "<br/>";
            $html .= "</td>";
            $html .= "<td>";
            foreach ($album['library']['hometowns'] as $hometown)
                $html .= "-" . $hometown . "<br/>";
            $html .= "</td>";
            $html .= "<td class='centered'>" . substr($album['Activate'], 0, 10) . "</td></tr>";
        }
        $html .= "</table>";
	return $html;
    }
public function createPDFTable ( $ albums , $ color ) { $ html = " <table cellspacing='0' cellpadding='2' class=' { $ color } -table'><tr><th>#</th><th>Artist</th><th>Album</th><th>Subgenres</th><th>Hometowns</th><th>Date Added</th></tr> " ; foreach ( $ albums as $ album ) { $ html .= " <tr><td class='centered'> " . str_pad ( strval ( $ album [ 'SmallCode' ] ) , 4 , '0' , STR_PAD_LEFT ) . " </td> " . " <td> " . $ album [ 'library' ] [ 'artist' ] . " </td> " . " <td> " . $ album [ 'library' ] [ 'album' ] ; if ( $ album [ 'library' ] [ 'rating' ] >= 4 ) $ html .= "    <img class='star' style='width: 12px; vertical-align:baseline;' src='../../../images/recommended.png' /> " ; $ html .= " </td> " ; $ html .= " <td> " ; foreach ( $ album [ 'library' ] [ 'subgenres' ] as $ subgenre ) $ html .= " - " . $ subgenre . " <br/> " ; $ html .= " </td> " ; $ html .= " <td> " ; foreach ( $ album [ 'library' ] [ 'hometowns' ] as $ hometown ) $ html .= " - " . $ hometown . " <br/> " ; $ html .= " </td> " ; $ html .= " <td class='centered'> " . substr ( $ album [ 'Activate' ] , 0 , 10 ) . " </td></tr> " ; } $ html .= " </table> " ; return $ html ; }
@abstract Given a list of albums, build and return an html table of the information
 @param array $albums A list of albums with their information
 @param string $color The color associated with the table
 @return string The html code for the albums table
@abstract Given a list of albums build and return an html table of the information @param array $albums A list of albums with their information @param string $color The color associated with the table @return string The html code for the albums table