diff --git a/airtime_mvc/application/models/Show.php b/airtime_mvc/application/models/Show.php index a5b17ffc1..31bd75d44 100644 --- a/airtime_mvc/application/models/Show.php +++ b/airtime_mvc/application/models/Show.php @@ -298,9 +298,11 @@ class Application_Model_Show { $showId = $this->getId(); $sql = "SELECT starts FROM cc_show_instances " - ."WHERE show_id = $showId AND rebroadcast = 1 " + ."WHERE instance_id = (SELECT id FROM cc_show_instances WHERE show_id = $showId ORDER BY starts LIMIT 1) AND rebroadcast = 1 " ."ORDER BY starts"; + Logging::log($sql); + $rebroadcasts = $CC_DBC->GetAll($sql); $rebroadcastsLocal = array(); @@ -415,8 +417,7 @@ class Application_Model_Show { public function deleteAllInstances(){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances" @@ -433,8 +434,7 @@ class Application_Model_Show { public function deleteAllRebroadcasts(){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances" @@ -457,8 +457,7 @@ class Application_Model_Show { public function removeAllInstancesFromDate($p_date=null){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); if(is_null($p_date)) { $date = new Application_Model_DateHelper; @@ -490,8 +489,7 @@ class Application_Model_Show { public function removeAllInstancesBeforeDate($p_date){ global $CC_DBC; - $date = new Application_Model_DateHelper; - $timestamp = $date->getTimestamp(); + $timestamp = gmdate("Y-m-d H:i:s"); $showId = $this->getId(); $sql = "DELETE FROM cc_show_instances " diff --git a/airtime_mvc/public/js/airtime/schedule/add-show.js b/airtime_mvc/public/js/airtime/schedule/add-show.js index 7ff725335..ae908e7a1 100644 --- a/airtime_mvc/public/js/airtime/schedule/add-show.js +++ b/airtime_mvc/public/js/airtime/schedule/add-show.js @@ -180,7 +180,7 @@ function setAddShowEvents() { form.find("#add_show_start_time").timepicker({ amPmText: ['', ''], - defaultTime: '00:00', + defaultTime: '00:00' }); form.find("#add_show_end_time").timepicker({ amPmText: ['', '']