示例#1
0
 /**
  * Returns data related to the scheduled items.
  *
  * @param int $prev
  * @param int $next
  * @return date
  */
 public static function GetPlayOrderRange($prev = 1, $next = 1)
 {
     if (!is_int($prev) || !is_int($next)) {
         //must enter integers to specify ranges
         return array();
     }
     global $CC_CONFIG;
     $date = new DateHelper();
     $timeNow = $date->getTimestamp();
     return array("env" => APPLICATION_ENV, "schedulerTime" => gmdate("Y-m-d H:i:s"), "previous" => Application_Model_Dashboard::GetPreviousItem($timeNow), "current" => Application_Model_Dashboard::GetCurrentItem($timeNow), "next" => Application_Model_Dashboard::GetNextItem($timeNow), "currentShow" => Show_DAL::GetCurrentShow($timeNow), "nextShow" => Show_DAL::GetNextShows($timeNow, 1), "timezone" => date("T"), "timezoneOffset" => date("Z"));
 }
示例#2
0
 public function liveInfoAction()
 {
     if (Application_Model_Preference::GetAllow3rdPartyApi()) {
         // disable the view and the layout
         $this->view->layout()->disableLayout();
         $this->_helper->viewRenderer->setNoRender(true);
         $date = new DateHelper();
         $timeNow = $date->getTimestamp();
         $result = array("env" => APPLICATION_ENV, "schedulerTime" => gmdate("Y-m-d H:i:s"), "currentShow" => Show_DAL::GetCurrentShow($timeNow), "nextShow" => Show_DAL::GetNextShows($timeNow, 5), "timezone" => date("T"), "timezoneOffset" => date("Z"));
         //echo json_encode($result);
         header("Content-type: text/javascript");
         echo $_GET['callback'] . '(' . json_encode($result) . ')';
     } else {
         header('HTTP/1.0 401 Unauthorized');
         print 'You are not allowed to access this resource. ';
         exit;
     }
 }