Load Events From Other Sources

Smart PHP Calendar can load events from other sources (other databases like Oracle, SQL Server, etc. or webservices).
To load your events from other sources you need to define SPC.loadEvents() method and assign your events to SPC.userEvents member in this method.
Smart PHP Calendar calls SPC.loadEvents() method for every refreshing and paging operations with the following parameters:


SPC.userEvents Array

SPC.userEvents array holds array of event objects. When you define SPC.userEvents array in SPC.loadEvents() method Smart PHP Calendar shows your events after each application refresh and paging.
SPC.userEvents array should look like below:

<script>
    SPC.userEvents = [{
        "start_date": "2013-03-14",
        "end_date": "2013-03-14",
        "cal_id": yourCalendarId,  //optional (if you don't provide a calendar id it will be displayed under the first calendar)
        "title": "my-event 1",  //optional
        "start_time": "13:30",  //optional
        "end_time": "13:50",  //optional
        "description": "your-event-description",  //optional
        "location": "your-event-location"  //optional
    }, {
        "title": "my-event 2",
        "start_date": "2013-03-14",
        "start_time": "12:30",
        "end_date": "2013-03-16",
        "end_time": "14:50"
    }, {
        "title": "all-day event",
        "start_date": "2013-03-14",
        "end_date": "2013-03-14",
    }, {
        "title": "multi-day event",
        "start_date": "2013-03-14",
        "end_date": "2013-03-16",
    }];
</script>