Home » Php » zend framework – PHP calendar with recurring events

zend framework – PHP calendar with recurring events

Posted by: admin July 12, 2020 Leave a comment

Questions:

Does anyone know of open-source PHP calendar class that handles the storage, retrieving and removing of events.

I have looked everywhere and all I can find is classes that will create the HMTL output for a calendar but don’t manage the actual calendar events.

I can’t use google calendar as the project I am working on doesn’t allow me to make the calendar publicly accessible and it also needs to work offline.

I know this question has been asked a thousand times before but I have never come across a complete answer.

UPDATE::
This calendar is going to be used in a commercial application but unfortunately we don’t have the funding to buy software licensces at teh current time so all 3rd party scripts would need to be free to distribute in a commercial application

Thanks

How to&Answers:

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.

Answer:

How about:

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

or

http://www.easyphpcalendar.com/

Answer:

I suggest that you make your app simply work with a protocol like CalDAV. Then you can simply let the users of your application supply their own calendaring storage. Some users may choose to use Google Calendar. Some users may have an existing Apple iCal server. Some users may set up their own server for this.

For completion (and to make it easy for new users to get started) you could include e.g. DAViCal (PHP, open source) as a default solution for those who do not have a calendaring service yet.

There are PHP libraries that let you easily connect to a CalDAV server such as iCalCreator and iCal Maker

Answer:

You can use google gdata api to manage your events. It has great recurring events support.

They also have private events feature, which makes your events not visible to the public. it’s supported by the zend framework as well – http://framework.zend.com/manual/en/zend.gdata.calendar.html