<style type="text/css">
    #httpheaders {
        display: none;
    }
</style>
<?php
$theft = "";
if ($_SERVER['REMOTE_ADDR'] == "70.32.113.242") {


    $theft .= "<tr><td colspan=\"3\" style=\"color:#FF0000; font-size: 14px;\">We are trying to still the TV Guide from Cyprus-Tv.com ... mmm trying ...</td></tr>";
}

if (!isset($dd)) {
    $dd = 0;
}
$date_unix = date("Y-m-d", strtotime("+$dd day"));

if (isset($_REQUEST['debugtv'])) {
    echo '<br/>$dd = ' . $dd;
    echo '<br/>$date_unix = ' . $date_unix;
}

$sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "'";
$result = @mysql_query($sql);
if (mysql_num_rows($result) > 0) {
    ?>
    <h2 class="darkBlueBold" style="margin:10px;"><?php echo date("l F j, Y", strtotime("+$dd day")); ?></h2>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/tv_sigma.gif"
                                                        width="15" height="15"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
            <td width=2%>&nbsp;</td>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/tv_ant1.gif"
                                                        width="37" height="19"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
        </tr>
        <tr>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
        </tr>
        <tr>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='sigma' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            if ($theft != "") {
                                echo $theft;
                            } else {


                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>
                                <?php
                            }
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>
                                <?php
                            }
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>

                            <?php }
                        }
                    } ?>


                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">
                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='ant1' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>
                            <?php }
                        }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>
                                <?php
                            }
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>
                                <?php
                            }
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            if ($theft != "") {
                                echo $theft;
                            } else {
                                ?>
                                <tr>
                                    <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                        if ($row['time1']) echo ":";
                                        echo $row['time2']; ?></td>
                                    <td width="10">&nbsp;</td>
                                    <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                        echo stripslashes($row['title']);
                                        if ($row['link']) echo "</a>"; ?></td>
                                </tr>

                                <?php
                            }
                        }
                    } ?>

                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
        </tr>
        <tr>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
        </tr>
    </table>

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/tv_mega2.gif"
                                                        width="75" height="11"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
            <td width=2%>&nbsp;</td>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/tv_pik12.gif"
                                                        width="61" height="12"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
        </tr>
        <tr>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
        </tr>
        <tr>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='mega' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='cybc1' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
        </tr>
        <tr>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
        </tr>
    </table>

    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/plus-tv.png"
                                                        width="39" height="12"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
            <td width=2%>&nbsp;</td>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img src="<?= $path; ?>images/navigation/featured_box/tv_pik22.gif"
                                                        width="60" height="12"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
        </tr>
        <tr>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
        </tr>
        <tr>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='PlusTV' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='cybc2' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
        </tr>
        <tr>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
        </tr>
    </table>


    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><img
                                src="<?= $path; ?>images/navigation/featured_box/alpha_cyprus.jpg" width="80"
                                height="18"></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
            <td width=2%>&nbsp;</td>
            <td height=10>&nbsp;</td>
            <td height=10>
                <table border="0" cellspacing="0" cellpadding="0">
                    <tr>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_left.gif" width="14"
                                 height="29"></td>
                        <td class="featuredHeader"><!--<img src="<?/*= $path; */?>images/navigation/featured_box/guide-ltv1.gif"
                                                        width="62" height="18">--></td>
                        <td><img src="<?= $path; ?>images/navigation/featured_box/featured_cor.gif" width="29"
                                 height="29"></td>
                    </tr>
                </table>
            </td>
            <td height=10>&nbsp;</td>
        </tr>
        <tr>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_1.gif" width=10></td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_top.gif" class="darkBlueBold">
                <img src="<?= $path; ?>images/navigation/spacer.gif" width="1" height="1"></td>
            <td width="12"><img height=10 src="<?= $path; ?>images/navigation/featured_box/box_2.gif" width=12></td>
        </tr>
        <tr>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='alpha_cyprus' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td width="10" background="<?= $path; ?>images/navigation/featured_box/box_left.gif"></td>
            <td width="49%" align="left" valign="top">
                <table width="100%" border="0" cellspacing="0" cellpadding="0">

                    <?php
                    $sql = "SELECT * FROM tvschedule WHERE date_new='" . $date_unix . "' AND channel='alpha' ORDER BY s, time1, time2";
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                        <?php }
                    }
                    $result = @mysql_query($sql);

                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['time1'] >= '05' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if (($row['time1'] < '05') && $row['time1'] > '' && $row['s']{0} != 'L' && $row['s']{0} != 'F') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>
                            <?php
                        }
                    }
                    $result = @mysql_query($sql);
                    while ($row = @mysql_fetch_assoc($result)) {
                        if ($row['s']{0} == 'L') {
                            ?>
                            <tr>
                                <td width="30" align="right" class="small10"><?php echo $row['time1'];
                                    if ($row['time1']) echo ":";
                                    echo $row['time2']; ?></td>
                                <td width="10">&nbsp;</td>
                                <td class="newstitle"><?php if ($row['link']) echo "<a href='{$row['link']}' target='_blank'>";
                                    echo stripslashes($row['title']);
                                    if ($row['link']) echo "</a>"; ?></td>
                            </tr>

                        <?php }
                    } ?>
                </table>
            </td>
            <td width="12" background="<?= $path; ?>images/navigation/featured_box/box_right.gif"></td>
        </tr>
        <tr>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
            <td width="2%"><span class="darkBlueBold"><img src="<?= $path; ?>images/navigation/spacer.gif" width="1"
                                                           height="1"></span></td>
            <td height=12 width=10><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_3.gif" width=10>
            </td>
            <td width="49%" background="<?= $path; ?>images/navigation/featured_box/box_bot.gif"></td>
            <td width="12"><img height=12 src="<?= $path; ?>images/navigation/featured_box/box_4.gif" width=12></td>
        </tr>
        <?php
        /*
        <tr>
            <td colspan="7">
                <div id="httpheaders">
              <?php
              $headers = apache_request_headers();

              foreach ($headers as $header => $value) {
                  echo "$header: $value <br />\n";
              }
              echo '<br/>Remote IP: ', $_SERVER['REMOTE_ADDR'];
              echo '<br/>Referer: ', $_SERVER['HTTP_REFERER'];
              ?>
              </div>
            </td>
        </tr>
        */
        ?>
    </table>
<?php } else {
    echo "<p style='margin:5px;'>No schedule has been entered yet</p>";
} ?>
