show content returning info in a useful way

This commit is contained in:
naomiaro 2011-01-12 17:52:57 -05:00
parent d7c540db49
commit 4d8f28f3fd
1 changed files with 34 additions and 2 deletions

View File

@ -285,9 +285,41 @@ class Show {
LEFT JOIN cc_files AS f ON f.id = s.file_id
LEFT JOIN cc_playlist AS p ON p.id = s.playlist_id )
WHERE ss.show_day = '{$timeinfo[0]}' AND ss.show_id = '{$this->_showId}'";
WHERE ss.show_day = '{$timeinfo[0]}' AND ss.show_id = '{$this->_showId}' ORDER BY starts";
return $CC_DBC->GetAll($sql);
$res = $CC_DBC->GetAll($sql);
if(count($res) <= 0) {
return $res;
}
$items = array();
$currGroupId = -1;
$pl_counter = -1;
$f_counter = -1;
foreach ($res as $row) {
if($currGroupId != $row["group_id"]){
$currGroupId = $row["group_id"];
$pl_counter = $pl_counter + 1;
$f_counter = -1;
$items[$pl_counter]["pl_name"] = $row["name"];
$items[$pl_counter]["pl_creator"] = $row["creator"];
$items[$pl_counter]["pl_description"] = $row["description"];
$sql = "SELECT SUM(clip_length) FROM cc_schedule WHERE group_id = '{$currGroupId}'";
$length = $CC_DBC->GetOne($sql);
$items[$pl_counter]["pl_length"] = $length;
}
$f_counter = $f_counter + 1;
$items[$pl_counter][$f_counter]["f_name"] = $row["track_title"];
$items[$pl_counter][$f_counter]["f_artist"] = $row["artist_name"];
$items[$pl_counter][$f_counter]["f_length"] = $row["length"];
}
return $items;
}
public function clearShow($day) {