예제 #1
0
 /**
  * Generate all the repeating shows in the given range.
  *
  * @param string $p_startTimestamp
  *         In the format "YYYY-MM-DD HH:mm:ss"
  * @param string $p_endTimestamp
  *         In the format "YYYY-MM-DD HH:mm:ss"
  */
 public static function populateAllShowsInRange($p_startTimestamp, $p_endTimestamp)
 {
     global $CC_DBC;
     if ($p_startTimestamp != "") {
         $sql = "SELECT * FROM cc_show_days\n                    WHERE last_show IS NULL\n                    OR first_show < '{$p_endTimestamp}' AND last_show > '{$p_startTimestamp}'";
     } else {
         $today_timestamp = date("Y-m-d");
         $sql = "SELECT * FROM cc_show_days\n                    WHERE last_show IS NULL\n                    OR first_show < '{$p_endTimestamp}' AND last_show > '{$today_timestamp}'";
     }
     $res = $CC_DBC->GetAll($sql);
     foreach ($res as $row) {
         Show::populateShow($row["repeat_type"], $row["show_id"], $row["next_pop_date"], $row["first_show"], $row["last_show"], $row["start_time"], $row["duration"], $row["day"], $row["record"], $p_endTimestamp);
     }
 }