cc-2229-refactor-now-playing-code

-bug fixes
This commit is contained in:
mkonecny 2011-05-05 14:55:45 -04:00
parent 7010f2156e
commit 038f2e1c69
3 changed files with 19 additions and 11 deletions

View file

@ -11,10 +11,19 @@ class Application_Model_Nowplaying
$dataTablesRows = array();
$date = new DateHelper;
$timeNow = $date->getTimestamp();
foreach ($p_dbRows as $dbRow){
$dataTablesRows[] = array('a', $dbRow['show_starts'], $dbRow['show_starts'], $dbRow['show_ends'],
$status = ($dbRow['show_ends'] < $dbRow['item_ends']) ? "x" : "";
$type = "a";
$type .= ($dbRow['item_ends'] > $timeNow && $dbRow['item_starts'] <= $timeNow) ? "c" : "";
$dataTablesRows[] = array($type, $dbRow['show_starts'], $dbRow['item_starts'], $dbRow['item_ends'],
$dbRow['clip_length'], $dbRow['track_title'], $dbRow['artist_name'], $dbRow['album_title'],
$dbRow['playlist_name'], $dbRow['playlist_name'], $dbRow['show_name']);
$dbRow['playlist_name'], $dbRow['show_name'], $status);
}
return $dataTablesRows;