I'm having a problem with my full year calendar displaying the day just on the day of the month. If there's an event on say the 5th of April, it'll highlight the 5th day in every month. It doesn't do this on my other calendar on the right side of the site though, I just can't figure it out. Here's my code:
<?php
include 'calendarparent.php';
include 'config.php';
$today = date('j',$time);
$month = date('n');
$year = date('Y');
$events = mysql_query("SELECT *, DATE_FORMAT(date, '%M %e, %Y %h:%m:%s') as
date, DATE_FORMAT(date, '%c') as month, DATE_FORMAT(date, '%e') as day FROM parentcal order by date desc") or die(mysql_error());
if($events)
{
$days = array();
while($row = mysql_fetch_array($events))
{
if($row['month'] == $month)
{
$day = $row['day'];
$days[$day] = array('events.php?action=view&id='.$row['id'], 'linked-day');
}
}
}
echo "<table style=\"margin: auto\"width=450>";
echo "<tr>";
for($month=1; $month<=12; $month++)
{
echo "<td style=\"vertical-align: top\">";
echo parent_calendar($year, $month, $days,2);
echo "<br /></td>";
if($month%3 == 0 and $month<12){
echo "</tr><tr>";
}
}
echo "</tr>";
echo "</table>";
?>
calendarparent.php is just the actual calendar. 'linked day' represents a day that is highlighted because there's an event on it. Here's the site so you can see my dilemma:
http://aspekt.blogdns.com/ahs/parentconnect.php