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,6 +1,7 @@
<div id="schedule_playlist_dialog">
<h2 id="scheduled_playlist_name"><?php echo $this->showName; ?>, <span><?php echo $this->showLength; ?></span></h2>
<div>
<div class="clearfix">
<div class="wrapp-one">
<table id="schedule_playlists" cellpadding="0" cellspacing="0" class="datatable">
<thead>
<tr>
@ -15,8 +16,9 @@
<tbody></tbody>
</table>
</div>
<div>
<div>Items In This Show:</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>
@ -24,4 +26,5 @@
<span id="show_length" class="time"><?php echo $this->showLength; ?></span>
</div>
</div>
</div>
</div>

View file

@ -709,15 +709,16 @@ dt.block-display, dd.block-display {
/*---//////////////////// Schedule Show ////////////////////---*/
#schedule_playlist_dialog > div {
#schedule_playlist_dialog .wrapp-two {
float: left;
width: 50%;
padding: 0;
}
#schedule_playlist_dialog > div:first-child {
#schedule_playlist_dialog .wrapp-one {
margin-right:2%;
width: 48%;
float: left;
}
#schedule_playlist_dialog div:first-child .ui-widget-header:first-child {
@ -739,13 +740,18 @@ dt.block-display, dd.block-display {
}
.ui-dialog #schedule_playlist_dialog.ui-dialog-content {
padding:0;
}
#schedule_playlist_dialog > div {
background: none repeat scroll 0 0 transparent;
border: 1px solid #8f8f8f;
overflow: auto;
padding: 8px;
margin:8px;
margin:8px 8px 0 8px;
}
#schedule_playlist_dialog > div h4 {
padding: 13px 0 12px 0;
margin: 0;
@ -897,7 +903,7 @@ h2#scheduled_playlist_name {
font-size:21px;
font-weight:normal;
margin:0;
padding:16px 0 0px 12px;
padding:8px 0 0px 12px;
color:#1c1c1c;
}