diff --git a/airtime_mvc/application/models/Block.php b/airtime_mvc/application/models/Block.php index a91e0fb66..93ada2b34 100644 --- a/airtime_mvc/application/models/Block.php +++ b/airtime_mvc/application/models/Block.php @@ -210,7 +210,7 @@ FROM cc_blockcontents AS pc LEFT JOIN cc_files AS f ON pc.file_id=f.id LEFT JOIN cc_block AS bl ON pc.block_id = bl.id WHERE pc.block_id = :block_id -ORDER BY pc.position; +ORDER BY pc.position SQL; $rows = Application_Common_Database::prepareAndExecute($sql, array(':block_id'=>$this->id)); diff --git a/airtime_mvc/application/models/Schedule.php b/airtime_mvc/application/models/Schedule.php index 000736b8e..99d44edd9 100644 --- a/airtime_mvc/application/models/Schedule.php +++ b/airtime_mvc/application/models/Schedule.php @@ -522,7 +522,6 @@ SQL; */ public static function getItems($p_startTime, $p_endTime) { - global $CC_CONFIG; $baseQuery = <<$p_startTime, ':endTime'=>$p_endTime, ':startTime2'=>$p_startTime)); + $rows = Application_Common_Database::prepareAndExecute($sql, array( + ':startTime1' => $p_startTime, + ':endTime' => $p_endTime, + ':startTime2' => $p_startTime)); if (count($rows) < 3) { $dt = new DateTime("@".time()); @@ -572,7 +573,7 @@ WHERE st.ends > :startTime1 ORDER BY st.starts LIMIT 3 SQL; - $sql = " ".$baseQuery." ".$predicates." "; + $sql = $baseQuery." ".$predicates." "; $rows = Application_Common_Database::prepareAndExecute($sql, array( ':startTime1' => $p_startTime,