can add multiple playlists to a show, doesn't check length or update playlists based on time left. GUI is bad.

This commit is contained in:
naomiaro 2011-01-12 15:47:44 -05:00
parent 9c23b86c53
commit 1f8ac9719f
5 changed files with 125 additions and 32 deletions

View file

@ -164,32 +164,26 @@ class ScheduleGroup {
public function addAfter($p_groupId, $p_audioFileId) {
global $CC_CONFIG, $CC_DBC;
// Get the end time for the given entry
$sql = "SELECT ends FROM ".$CC_CONFIG["scheduleTable"]
$sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id=$p_groupId";
$startTime = $CC_DBC->GetOne($sql);
return $this->add($startTime, $p_audioFileId);
}
public function addPlaylistAfter($p_groupId, $p_playlistId) {
global $CC_CONFIG, $CC_DBC;
// Get the end time for the given entry
$sql = "SELECT MAX(ends) FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id=$p_groupId";
$startTime = $CC_DBC->GetOne($sql);
return $this->add($startTime, null, $p_playlistId);
}
public function update() {
}
public function removeAtTime($p_datetime) {
global $CC_CONFIG, $CC_DBC;
$id = $this->dateToId($p_datetime);
$sql = "SELECT group_id FROM ".$CC_CONFIG["scheduleTable"]." WHERE id = ".$id;
$groupId = $CC_DBC->GetOne($sql);
if($groupId === NULL)
return;
$sql = "DELETE FROM ".$CC_CONFIG["scheduleTable"]
." WHERE group_id = ".$groupId;
$CC_DBC->query($sql);
}
/**
* Remove the group from the schedule.
* Note: does not check if it is in the past, you can remove anything.