working on schedule dialog, reqorked get remaining time function in a show to be better.

This commit is contained in:
Naomi 2011-02-02 13:39:33 -05:00
parent 3adbbf4163
commit 0bcf69985e
4 changed files with 44 additions and 50 deletions

View file

@ -255,11 +255,12 @@ class ScheduleController extends Zend_Controller_Action
{
$show_id = $this->sched_sess->showId;
$start_timestamp = $this->sched_sess->showStart;
$end_timestamp = $this->sched_sess->showEnd;
$post = $this->getRequest()->getPost();
$userInfo = Zend_Auth::getInstance()->getStorage()->read();
$show = new Show(new User($userInfo->id, $userInfo->type), $show_id);
$playlists = $show->searchPlaylistsForShow($start_timestamp, $post);
$playlists = $show->searchPlaylistsForShow($start_timestamp, $end_timestamp, $post);
//for datatables
die(json_encode($playlists));

View file

@ -313,10 +313,7 @@ class Show {
return $time;
}
public function getTimeUnScheduled($start_date, $end_date, $start_time, $end_time) {
$start_timestamp = $start_date ." ".$start_time;
$end_timestamp = $end_date ." ".$end_time;
public function getTimeUnScheduled($start_timestamp, $end_timestamp) {
$time = Schedule::getTimeUnScheduledInRange($start_timestamp, $end_timestamp);
@ -653,22 +650,9 @@ class Show {
return $length;
}
public function searchPlaylistsForShow($start_timestamp, $datatables){
global $CC_DBC;
public function searchPlaylistsForShow($start_timestamp, $end_timestamp, $datatables){
$sql = "SELECT EXTRACT(DOW FROM TIMESTAMP '{$start_timestamp}')";
$day = $CC_DBC->GetOne($sql);
$sql = "SELECT * FROM cc_show_days WHERE show_id = '{$this->_showId}' AND day = '{$day}'";
$row = $CC_DBC->GetAll($sql);
$row = $row[0];
$start_date = $row["first_show"];
$end_date = $row["last_show"];
$start_time = $row["start_time"];
$end_time = $row["end_time"];
$length = $this->getTimeUnScheduled($start_date, $end_date, $start_time, $end_time);
$length = $this->getTimeUnScheduled($start_timestamp, $end_timestamp);
return StoredFile::searchPlaylistsForSchedule($length, $datatables);
}

View file

@ -1,27 +1,30 @@
<div id="schedule_playlist_dialog">
<h2 id="scheduled_playlist_name"><?php echo $this->showName; ?>, <span><?php echo $this->showLength; ?></span></h2>
<div>
<table id="schedule_playlists" cellpadding="0" cellspacing="0" class="datatable">
<thead>
<tr>
<th>Id</th>
<th>Description</th>
<th>Title</th>
<th>Creator</th>
<th>Length</th>
<th>Editing</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div>
<div>Items In This Show:</div>
<ul id="schedule_playlist_chosen"></ul>
<div id="show_time_info">
<span id="show_time_filled" class="time"><?php echo $this->timeFilled; ?></span>
<div id="show_progressbar"></div>
<span id="show_length" class="time"><?php echo $this->showLength; ?></span>
</div>
</div>
<div class="clearfix">
<div class="wrapp-one">
<table id="schedule_playlists" cellpadding="0" cellspacing="0" class="datatable">
<thead>
<tr>
<th>Id</th>
<th>Description</th>
<th>Title</th>
<th>Creator</th>
<th>Length</th>
<th>Editing</th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<div class="wrapp-two">
<div><h4>Items In This Show:</h4></div>
<ul id="schedule_playlist_chosen"></ul>
<div id="show_time_info">
<span id="show_time_filled" class="time"><?php echo $this->timeFilled; ?></span>
<div id="show_progressbar"></div>
<span id="show_length" class="time"><?php echo $this->showLength; ?></span>
</div>
</div>
</div>
</div>