site/schedule/index.php

49 lines
1.8 KiB
PHP
Raw Normal View History

2020-06-18 06:21:52 +00:00
<?php
2020-07-03 06:51:01 +00:00
$additional_head='<link rel="alternate" type="text/calendar" href="https://tilderadio.org/schedule/ics.php">';
2020-06-18 06:21:52 +00:00
include '../header.php';
2020-07-03 01:53:12 +00:00
include 'schedule.php';
2020-06-18 06:21:52 +00:00
?>
<h1><a href="https://tilderadio.org"><img style="width:72px;margin-top:-30px;margin-right:5px;" src="../logos/tilderadio.png">tilderadio.org</a></h1>
2020-06-18 06:21:52 +00:00
<h4>upcoming broadcasts</h4>
<p>all times in UTC. current time is <span id="utcdate"><?=formatdate("now")?></span>.</p>
2020-07-03 06:51:01 +00:00
<p>this schedule is also available in <a href="https://icalendar.org/validator.html?url=https://tilderadio.org/schedule/ics.php">iCalendar format</a>. point your calendar client at <code>https://tilderadio.org/schedule/ics.php</code>.</p>
2020-06-18 06:21:52 +00:00
<?php
include 'calendar.php';
?>
<table class="table table-striped">
<thead>
<tr>
<th>dj</th>
<th>start</th>
<th>end</th>
</tr>
</thead>
<tbody>
<?php foreach ($schedule as $item): ?>
<tr>
2020-06-23 05:25:49 +00:00
<td><?=$item["title"]?></td>
<td><?=formatdate($item["start"])?></td>
<td><?=formatdate($item["end"])?></td>
</tr>
<?php endforeach; ?>
</tbody>
</table>
2020-06-18 04:07:03 +00:00
<script>
// Update the timer as time passes.
// Because PHP gives the time on page load, people who disable Javascript won't be missing out on much.
let months = ["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];
let daysOfWeek = ["Sun","Mon","Tue","Wed","Thu","Fri","Sat"];
function update_date() {
var d = new Date();
document.getElementById("utcdate").innerText = daysOfWeek[d.getUTCDay()]+" "+months[d.getUTCMonth()]+" "+d.getUTCDate().toString()+" "+d.getUTCHours().toString().padStart(2,'0')+":"+d.getUTCMinutes().toString().padStart(2,'0');
setTimeout(update_date,15000);
}
setTimeout(update_date,15000);
</script>
2020-06-18 04:07:03 +00:00
<?php include '../footer.php'; ?>