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! Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.