Exemplo n.º 1
0
$currentQueue = Sustainer::get_queue();
$i = 0;
echo "<h3>Current queue:</h3>";
if (!is_null($currentQueue)) {
    if (array_key_exists('id', $currentQueue)) {
        $currentQueueTemp = array(0 => $currentQueue);
        $currentQueue = $currentQueueTemp;
    }
    echo "<table class=\"table table-striped table-bordered\">\r\n\t\t<thead>\r\n\t\t<tr>\r\n\t\t<th></th>\r\n\t\t<th>Title</th>\r\n\t\t<th>Artist</th>\r\n\t\t<th>Album</th>\r\n\t\t</tr>\r\n\t\t</thead>\r\n\t\t<tbody>";
    foreach ($currentQueue as $row) {
        $i++;
        echo "<tr>\r\n\t\t\t<td>" . $i . "</td>\r\n\t\t<td>" . $row['title'] . "</td>\r\n\t\t<td>" . $row['artist'] . "</td>\r\n\t\t<td>" . $row['album'] . "</td>\r\n\t\t</tr>";
    }
    echo "</tbody>\r\n\t\t</table>";
} else {
    Bootstrap::alert("warning", "<b>Warning: </b>The current queue is empty", "", false);
}
echo "<h3>Schedule audio:</h3>";
echo "<p>You can use this tool to schedule the next audio track to be played on Sue by using its audio id.</p>";
echo "<form action=\"\" method=\"post\">";
echo "Track ID: <input type=\"text\" name=\"trackid\" /><input type=\"submit\" name=\"submit\" value=\"Schedule\" />";
echo "</form>";
$currentLog = Sustainer::get_log();
$i = 0;
echo "<h3>Scheduler log:</h3>";
echo "<table class=\"table table-striped table-bordered\">\r\n\t<thead>\r\n\t<tr>\r\n\t<th>Date</th>\r\n\t<th>Title</th>\r\n\t<th>Artist</th>\r\n\t<th>Scheduled By</th>\r\n\t</tr>\r\n\t</thead>\r\n\t<tbody>";
foreach ($currentLog as $row) {
    $i++;
    echo "<tr>\r\n\t\t<td>" . date('d/m/y H:i', $row['timestamp']) . "</td>\r\n\t<td>" . $row['title'] . "</td>\r\n\t<td>" . $row['artist'] . "</td>\r\n\t<td>" . $row['username'] . "</td>\r\n\t</tr>";
}
echo "</tbody>\r\n\t</table>";