PHP calendar with recurring events

In the project I'm working on currently, we've had a similar challenge. We also wanted to show events that aren't per se calendar items, but items that came out of action plans.

We've used Full Calender, combined with PHP programming that supplies the JSON feed. Full Calendar also supplies many event hooks, which in our case triggers a Ajax post to PHP Programming which edits the database.

A little more detailed:

We call Full Calendar with:

$('#calendar').fullCalendar({
  events: '/pl_feed.php'
});

Full Calendar then visits, for instance:

/pl_feed.php?start=1262332800&end=1265011200&_=1263178646

(the extra parameter is used to prevent caching)

pl_feed.php generates the events that are displayed in the Calendar.

By the way: I found that the David Powers Date Class (read his book: it's good) is a joy to work with. You can download it at the site of the publisher: http://www.apress.com/9781430210115

When it's done generating the requested events, pl_feed.php puts them in a multi-dimensional array and echoes the array with json_encode:

    foreach ($array_events as $array_event) {

        $array_feed_item['id'] = $array_event['id'];
        $array_feed_item['title'] = //Whatever you like to be the title;
        $array_feed_item['start'] = $array_event['start']; //Y-m-d H:i:s format
        $array_feed_item['end'] = $array_event['end']; //Y-m-d H:i:s format
        $array_feed_item['allDay'] = 0;
        $array_feed_item['color'] = 'blue'; //Whatever you like, of course
        $array_feed_item['borderColor'] = 'blue';
        //You can also a CSS class: 
        $array_feed_item['className'] = 'pl_act_rood';

        //Add this event to the full list of events:
        $array_feed_items[] = $array_feed_item;
    }

    echo json_encode($array_feed_items);

Full Calendar will then show you the events generated by /pl_feed.php.


How about:

http://www.softcomplex.com/products/php_event_calendar/

or

http://www.easyphpcalendar.com/