jenodonovan Posted March 17, 2008 Share Posted March 17, 2008 Hi, I have implemented a calender and it is back-ended with a database, i want meetings etc that are held within the database to show up on the correct date on the calender. I am completely stuck...but this is what i have got so far (impart from the creating the table bit), has anyone got any ideas on how to crack it? $timestamp = mktime(0,0,0,$cMonth,1,$cYear); $maxday = date("t",$timestamp); $thismonth = getdate ($timestamp); $startday = $thismonth['wday']; for($i=0; $i<($maxday+$startday); $i++) { if(($i % 7) == 0) echo "<tr>\n"; if($i < $startday) echo "<td></td>\n"; else echo "<td align='center' valign='middle' height='20px'>". ($i - $startday + 1) . "</td>\n"; if(($i % 7) == 6 ) echo "</tr>\n"; Thank you! Link to comment https://forums.phpfreaks.com/topic/96512-diarycalendar/ Share on other sites More sharing options...
revraz Posted March 17, 2008 Share Posted March 17, 2008 What I did was load the entire month's entries into an array, then when I built the calendar with the days of the week, I checked to see if any entries were also for that day and then added them at the same time. Link to comment https://forums.phpfreaks.com/topic/96512-diarycalendar/#findComment-494007 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.