<?php
// $Id: index.php,v 1.14 2004/05/29 23:21:26 chuckw Exp $
// $Author: chuckw $
include_once("lib/functions.php");
print_header_open();
print_title("");
print_header_close();
?>
<center>
<h1>Currently Scheduled Programs</h1>
</center>
<?php
$query = "SELECT * FROM program WHERE record='1'";
$result = $sql->query($query);
if ($sql->results($result)) {
$mainmenu_days = getconfig("mainmenu_days");
$query = "SELECT
program.pid, program.pname, program.subtitle,
program.description, program.category,
DATE_FORMAT(start,'%l:%i%p %c/%e'),
DATE_FORMAT(stop,'%l:%i%p %c/%e'), station.suburl,
station.sname
FROM
program, station
WHERE
record='1'
AND
stop > NOW()
AND
stop < DATE_ADD(NOW(), INTERVAL $mainmenu_days DAY)
AND
program.sid=station.sid
ORDER BY
start";
$result = $sql->query($query);
?>
<table border=1>
<tr bgcolor="#006666">
<td>
<center>
<font color="#FFFFFF">Recorded Programs</font>
</center>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td>
<table border=1 width=100%>
<tr>
<td>Station</td>
<td>Program Name</td>
<td>Episode</td>
<td>Description</td>
<td>Category</td>
<td>Start</td>
<td>Stop</td>
<td>Edit</td>
<td> </td>
</tr>
<?php
while($scheduled_progs = $sql->fetch_array($result)) {
// We need a name not a number ;-)
$station = getstation($scheduled_progs[1]);
// fix empty descriptions and episode titles
if (!$scheduled_progs[3]) {
$scheduled_progs[3]=' ';
}
if (!$scheduled_progs[2]) {
$scheduled_progs[2]=' ';
}
if (!$scheduled_progs[4]) {
$scheduled_progs[4]=' ';
}
$station_icons = getconfig("station_icons");
?>
<tr>
<td>
<?php
if ($scheduled_progs[7] != '' && $station_icons!='') {
print "<IMG SRC=\"$scheduled_progs[7]\">\n";
} else {
print "$scheduled_progs[8]\n";
}
?>
</td>
<td><?php print "$scheduled_progs[1]" ?></td>
<td><?php print "$scheduled_progs[2]" ?></td>
<td><?php print "$scheduled_progs[3]" ?></td>
<td><?php print "$scheduled_progs[4]" ?></td>
<td><?php print "$scheduled_progs[5]" ?></td>
<td><?php print "$scheduled_progs[6]" ?></td>
<?php
if ($scheduled_progs[6] == 0) {
// Set up the edit URL.
$addy = "force.php?EDIT=$scheduled_progs[0]";
$edit_url = "<a href=\"$addy\">";
// Set up the derecord URL.
$addy = "force.php?DERECORD=$scheduled_progs[0]";
$derec_url = "<a href=\"$addy\">";
$acronym = "<acronym title=\"UnRecord\">";
$img_dim = "border=0 border=0";
$img_alt = "alt=\"UnRecord\"";
$img_src = "src=\"images/unrec.gif\"";
$img_url = "<img $img_dim $img_alt $img_src>";
?>
<td>
<?php print "$edit_url" ?> edit</a>
</td>
<td>
<?php
print "$derec_url $acronym $img_url";
?>
</acronym></a>
</td>
<?php
}
?>
</tr>
<?php
}
?>
</table>
</td>
</tr>
</table>
<?php
} else {
?>
<p><center>No programs currently entered.</center><P>
<?php
}
print_page_close();
?>