FUDforum
Fast Uncompromising Discussions. FUDforum will get your users talking.

Home » Imported messages » comp.lang.php » show events in calendar
Show: Today's Messages :: Polls :: Message Navigator
Return to the default flat view Create a new topic Submit Reply
show events in calendar [message #174749] Sun, 03 July 2011 15:13 Go to previous message
Co is currently offline  Co
Messages: 75
Registered: May 2011
Karma:
Member
Hi All,

I got me some code to show a month calendar and I have a database with
events.
Now I want to show the events on the calendar. When there is an event
on day X I want
the number to be bold and on a mouse over display the details of the
event.

Can anyone help me with this?
here is my code:
<< I didn't put all the code which builds the calendar >>

// Build the heading portion of the calendar table
echo "<table class=\"maintable\">\n".
"<tr class='headline'>\n".
"<td colspan=\"7\">\n".
"<table align=\"center\">\n".
"<tr class='headline'>\n".
"<td colspan=\"2\" width=\"75\" align=\"left\">$previous_link</td>
\n".
"<td colspan=\"3\" width=\"150\" align=\"center\">$month_name
$year</td>\n".
"<td colspan=\"2\" width=\"75\" align=\"right\">$next_link</td>
\n".
"</tr>\n".
"</table>\n".
"</td>\n".
"<tr class='mainrow'>\n".
"<td>S</td><td>M</td><td>T</td><td>W</td><td>T</td><td>F</
td><td>S</td>\n".
"</tr>\n";

// Now we break each key of the array
// into a week and create a new table row for each
// week with the days of that week in the table data

$i = 0;
while (list(, $week) = each($weeks))
{

echo "<tr class='mainrow'>\n";
while (list(, $d) = each($week)){

if($i < $offset_count){
//$day_link = "<a href=\"".$_SERVER['PHP_SELF']."?
date=".mktime(0, 0, 0, $month -1, $d, $year)."\">$d</a>";
echo "<td class=\"nonmonthdays\">$day_link</td>\n";
}
if(($i >= $offset_count) && ($i < ($num_weeks * 7) - $outset))
{
$datecount=mktime(0, 0, 0, $month -1, $d, $year);
$day_link = "<A href=\"javascript:popWin('editcalendar.php?
ID=$datecount', 350, 400)\">$d</a>";
if($date == mktime(0, 0, 0, $month, $d, $year)){
echo "<td><A href=\"javascript:popWin('editcalendar.php?
ID=$datecount', 350, 400)\"><font color='red'><b>$d</b></font></a></
td>\n";
} else {
echo "<td class=\"days\">$day_link</td>\n";
}
} elseif(($outset > 0)) {
if(($i >= ($num_weeks * 7) - $outset)){
$day_link = "";
echo "<td class=\"nonmonthdays\">$day_link</td>\n";
}
}
$i++;
}
echo "</tr>\n";
}

// Close out your table and that's it!
echo "<tr class='headline'><td colspan='7' class='days'>&nbsp;</td></
tr>";
echo '</table>';


Regards
Marco
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Get day and month part from date
Next Topic: Stats comp.lang.php (last 7 days)
Goto Forum:
  

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ]

Current Time: Wed Nov 27 10:21:56 GMT 2024

Total time taken to generate the page: 0.03231 seconds