diff --git a/application/controllers/ScheduleController.php b/application/controllers/ScheduleController.php index 70cc869c3..c325ac093 100644 --- a/application/controllers/ScheduleController.php +++ b/application/controllers/ScheduleController.php @@ -298,28 +298,3 @@ class ScheduleController extends Zend_Controller_Action } - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/application/models/Schedule.php b/application/models/Schedule.php index 5f0d5fca4..2ed61f8b9 100644 --- a/application/models/Schedule.php +++ b/application/models/Schedule.php @@ -479,10 +479,10 @@ class Schedule { private static function GetPreviousItems($timeNow, $prevCount = 1){ global $CC_CONFIG, $CC_DBC; - $sql = "SELECT * FROM $CC_CONFIG[scheduleTable], $CC_CONFIG[filesTable]" - ." WHERE ($CC_CONFIG[scheduleTable].ends < TIMESTAMP '$timeNow')" - ." AND ($CC_CONFIG[scheduleTable].file_id = $CC_CONFIG[filesTable].id)" - ." ORDER BY $CC_CONFIG[scheduleTable].starts DESC" + $sql = "SELECT * FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft" + ." WHERE (st.ends < TIMESTAMP '$timeNow')" + ." AND (st.file_id = ft.id)" + ." ORDER BY st.starts DESC" ." LIMIT $prevCount"; $rows = $CC_DBC->GetAll($sql); return $rows; @@ -491,20 +491,21 @@ class Schedule { private static function GetCurrentlyPlaying($timeNow){ global $CC_CONFIG, $CC_DBC; - $sql = "SELECT * FROM $CC_CONFIG[scheduleTable], $CC_CONFIG[filesTable]" - ." WHERE ($CC_CONFIG[scheduleTable].starts < TIMESTAMP '$timeNow')" - ." AND ($CC_CONFIG[scheduleTable].ends > TIMESTAMP '$timeNow')" - ." AND ($CC_CONFIG[scheduleTable].file_id = $CC_CONFIG[filesTable].id)"; + $sql = "SELECT *, pt.name as playlistName FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft, $CC_CONFIG[playListTable] pt" + ." WHERE (st.starts < TIMESTAMP '$timeNow')" + ." AND (st.ends > TIMESTAMP '$timeNow')" + ." AND (st.playlist_id = pt.id)" + ." AND (st.file_id = ft.id)"; $rows = $CC_DBC->GetAll($sql); return $rows; } private static function GetNextItems($timeNow, $nextCount = 1) { global $CC_CONFIG, $CC_DBC; - $sql = "SELECT * FROM $CC_CONFIG[scheduleTable], $CC_CONFIG[filesTable]" - ." WHERE ($CC_CONFIG[scheduleTable].starts > TIMESTAMP '$timeNow')" - ." AND ($CC_CONFIG[scheduleTable].file_id = $CC_CONFIG[filesTable].id)" - ." ORDER BY $CC_CONFIG[scheduleTable].starts" + $sql = "SELECT * FROM $CC_CONFIG[scheduleTable] st, $CC_CONFIG[filesTable] ft" + ." WHERE (st.starts > TIMESTAMP '$timeNow')" + ." AND (st.file_id = ft.id)" + ." ORDER BY st.starts" ." LIMIT $nextCount"; $rows = $CC_DBC->GetAll($sql); return $rows; diff --git a/application/views/scripts/schedule/view-playlist.phtml b/application/views/scripts/schedule/view-playlist.phtml index 804b2acdd..a940ce285 100644 --- a/application/views/scripts/schedule/view-playlist.phtml +++ b/application/views/scripts/schedule/view-playlist.phtml @@ -3,7 +3,7 @@
Volume
-
+
Show:
Playlist:
Host:
@@ -15,7 +15,8 @@
Upcoming:
-
-
Start: End:
-
+
+
Start:
+
End:
+
|
diff --git a/install/uninstall.php b/install/propel-uninstall.php similarity index 93% rename from install/uninstall.php rename to install/propel-uninstall.php index 89da9bfed..7f7af6784 100644 --- a/install/uninstall.php +++ b/install/propel-uninstall.php @@ -27,24 +27,11 @@ echo "***************************\n"; require_once(dirname(__FILE__).'/../application/configs/conf.php'); require_once(dirname(__FILE__).'/installInit.php'); -//require_once(dirname(__FILE__).'/../backend/cron/Cron.php'); function airtime_uninstall_delete_files($p_path) { - if (!empty($p_path) && (strlen($p_path) > 4)) { - if (file_exists($p_path)) { - $dir = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($p_path), RecursiveIteratorIterator::CHILD_FIRST); - - for ($dir->rewind(); $dir->valid(); $dir->next()) { - if ($dir->isDir()) { - rmdir($dir->getPathname()); - } else { - unlink($dir->getPathname()); - } - } - rmdir($p_path); - } - } + $command = "rm -rf $p_path"; + exec($command); } //------------------------------------------------------------------------ @@ -212,10 +199,6 @@ foreach ($cron->ct->getByType(CRON_CMD) as $id => $line) { $cron->closeCrontab(); echo "done.\n"; */ -//------------------------------------------------------------------------ -// Delete files -//------------------------------------------------------------------------ -airtime_uninstall_delete_files($CC_CONFIG['storageDir']); //------------------------------------------------------------------------ @@ -236,6 +219,13 @@ if ($results == 0) { echo " * Nothing to delete..\n"; } + +//------------------------------------------------------------------------ +// Delete files +//------------------------------------------------------------------------ +airtime_uninstall_delete_files($CC_CONFIG['storageDir']); + + echo "************************************\n"; echo "* StorageServer Uninstall Complete *\n"; echo "************************************\n"; diff --git a/public/js/playlist/playlist.js b/public/js/playlist/playlist.js index d00849391..52e66cef3 100644 --- a/public/js/playlist/playlist.js +++ b/public/js/playlist/playlist.js @@ -8,9 +8,9 @@ var nextSongs; var currentElem; function init(elemID) { - var currentElem = $("#" + elemID).attr("style", "z-index: 1; width: 100%; left: 0px; right: 0px; bottom: 0px; color: white; min-height: 100px; background-color: #cc3300;"); + var currentElem = $("#" + elemID).attr("style", "z-index: 1; width: 100%; left: 0px; right: 0px; bottom: 0px; color: black; min-height: 100px; background-color: #FEF1B5;"); - $('#progressbar').progressBar(0); + $('#progressbar').progressBar(0, {showText : false}); getScheduleFromServer(); updateProgressBarValue(); @@ -67,6 +67,30 @@ function getTrackInfo(song){ return song.track_title + " - " + song.artist_name + " - " + song.album_title; } +function convertToHHMMSS(timeInMS){ + var time = parseInt(timeInMS); + + var hours = parseInt(time / 3600000); + time -= 3600000*hours; + + var minutes = parseInt(time / 60000); + time -= 60000*minutes; + + var seconds = parseInt(time / 1000); + + hours = "" + hours; + minutes = "" + minutes; + seconds = "" + seconds; + + if (hours.length == 1) + hours = "0" + hours; + if (minutes.length == 1) + minutes = "0" + minutes; + if (seconds.length == 1) + seconds = "0" + seconds; + return "" + hours + ":" + minutes + ":" + seconds; +} + function updatePlaylist(){ /* Column 0 update */ $('#listen'); @@ -78,8 +102,8 @@ function updatePlaylist(){ $('#host').empty(); for (var i=0; i