#native_company# #native_desc#

Easy Calendar Applications Page 5

By Mark Musone
on July 30, 2000

Note, one thing we are doing is allowing people to add events by clicking on and day
in the calendar. If there is an event scheduled, it prints out the title, and by clicking
on the title, it displays all of the events information.
to display an events information, we use the same technique as the above, but just pull up the
events for that one day, and print out all information.
viewevent.php3 consists of:




for($x=0$x<count($events); $x++) {




"Event: $event->id<br>";

"Start: ";






"$start->sec <br>";

    echo "End:";






"$end->sec <br>";

    echo "Title: $event->title <br>";

"Category: $event->category <br>";

"Description: $event->description <br>";



<a href="index.php3?month=<?php echo $month?>&year=<?php echo $year?>">Back</a>

To add an event, it’s just as simple, first we print out a form, addevent.php3:

<form action="addeventaction.php3">

<center>Adding event for <?php echo $month?>/<?php echo $day?>/<?php echo $year?></center><br>

Title:<input type="text" name="title"><br>

Category:<input type="text" name="category"><br>


<textarea cols=40 rows=10 name="description"></textarea><br>

<input type="hidden" name="year" value="<?php echo $year?>">

<input type="hidden" name="month" value="<?php echo $month?>">

<input type="hidden" name="day" value="<?php echo $day?>">

<input type="submit">

To do the actual adding of the event after the form is submitted,
we use a couple of new functions.
Every calendar stream has an internal event structure. This event
structure is used for storing and retreiving events.
So we simply set the internal event structure with the proper
information using the mcal_event_set functions.