Jump to content

Diary/Calendar


jenodonovan

Recommended Posts

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.