-begin adding datagrids

This commit is contained in:
mkonecny 2011-01-21 18:14:59 -05:00
parent 8d5aea0d14
commit 6553663051
249 changed files with 31982 additions and 11 deletions

View file

@ -0,0 +1,43 @@
<?php
class Application_Model_Nowplaying
{
public static function GetDataGridData(){
$timeNow = Schedule::GetSchedulerTime();
$previous = Schedule::GetPreviousItems($timeNow, 1);
$current = Schedule::GetCurrentlyPlaying($timeNow);
$next = Schedule::GetNextItems($timeNow, 10);
$columnHeaders = array(array("sTitle"=>"Date"),
array("sTitle"=>"Start"),
array("sTitle"=>"End"),
array("sTitle"=>"Duration"),
array("sTitle"=>"Song"),
array("sTitle"=>"Artist"),
array("sTitle"=>"Album"),
array("sTitle"=>"Creator"),
array("sTitle"=>"Playlist"));
$rows = array();
foreach ($previous as $item){
array_push($rows, array(substr($item["starts"], 0, strpos($item["starts"], " ")), $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], "x" , "y"));
}
foreach ($current as $item){
array_push($rows, array($item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], "x" , "y"));
}
foreach ($next as $item){
array_push($rows, array($item["starts"], $item["starts"], $item["ends"], $item["clip_length"], $item["track_title"], $item["artist_name"],
$item["album_title"], "x" , "y"));
}
return array("columnHeaders"=>$columnHeaders, "rows"=>$rows);
}
}