Ejemplo n.º 1
0
 public function scheduleShowDialogAction()
 {
     $showInstanceId = $this->_getParam('id');
     $this->sched_sess->showInstanceId = $showInstanceId;
     $show = new ShowInstance($showInstanceId);
     $start_timestamp = $show->getShowStart();
     $end_timestamp = $show->getShowEnd();
     //check to make sure show doesn't overlap.
     if (Show::getShows($start_timestamp, $end_timestamp, array($showInstanceId))) {
         $this->view->error = "cannot schedule an overlapping show.";
         return;
     }
     $start = explode(" ", $start_timestamp);
     $end = explode(" ", $end_timestamp);
     $startTime = explode(":", $start[1]);
     $endTime = explode(":", $end[1]);
     $dateInfo_s = getDate(strtotime($start_timestamp));
     $dateInfo_e = getDate(strtotime($end_timestamp));
     $this->view->showContent = $show->getShowContent();
     $this->view->timeFilled = $show->getTimeScheduled();
     $this->view->showName = $show->getName();
     $this->view->showLength = $show->getShowLength();
     $this->view->percentFilled = $show->getPercentScheduled();
     $this->view->s_wday = $dateInfo_s['weekday'];
     $this->view->s_month = $dateInfo_s['month'];
     $this->view->s_day = $dateInfo_s['mday'];
     $this->view->e_wday = $dateInfo_e['weekday'];
     $this->view->e_month = $dateInfo_e['month'];
     $this->view->e_day = $dateInfo_e['mday'];
     $this->view->startTime = sprintf("%d:%02d", $startTime[0], $startTime[1]);
     $this->view->endTime = sprintf("%d:%02d", $endTime[0], $endTime[1]);
     $this->view->chosen = $this->view->render('schedule/scheduled-content.phtml');
     $this->view->dialog = $this->view->render('schedule/schedule-show-dialog.phtml');
     unset($this->view->showContent);
 }