Hey everyone, I'm having a little trouble with creating a 'dynamic' calendar with events called from a MySQL database.
So basically I would like to have the Month automatically change when the month changes, and highlight the days which have events scheduled, and make those days links to my thickbox js window which will pass the selected day to the thickbox and show the scheduled events for that day broken down by time.
<?php
$cur_month = date(F);
$cur_day = date(d);
$args = "height=400&width=800&id=";
$cur_date = date(F d, Y);
include_once('connect.php');
$query = "SELECT id, year, month, day, event_title, event_start FROM event_calendar WHERE month=" . $cur_month;
$result = mysqli_query($dbc,$query)
or die ('Error querying Database.');
list($id,$year,$month,$day,$event_title,$event_start)= mysqli_fetch_row($result));
{
if $day = $cur_day {
echo "<div class='events'><a href='daysevents.php?\"" . $args . "\"" . $id . "\"' class='thickbox'>" .
"<b>$event_title</b></a><br />$month $day, $year - $event_start</div>";
}
else {
echo "There are no events for today.";
}
}
mysqli_close($dbc);
?>
Ok heres what I got so far. It's suppose to list the events scheduled for the current day below the calendar. I'm not sure how to create the calendar so the layout changes based on the the current month, and highlight the days that have events scheduled.
Let me know if you need me to add more code.