PHP Event Calendar
The basic scriptcalendar software does not include any method of administering events online. The scriptcalendar is entirely javascript, and javascript has the built in limitation that the language cannot read or write files from the server or the client. Thus, a pure javascript calendar
cannot have an Event Administration page.
However, if your website host has server side scripting capabilities like PHP, you can have a page for managing events. The following describes the free PHP event management solution available for download. The PHP event management system is meant for use with the scriptcalendar javascript event calendar.
Download the zip file of source code. The zip file contains all PHP files necessary to manage events online.
This PHP code is not aupported, and is provided free of charge as an example of how to manage events online. It is complete PHP event management system for use with the Scriptcalendar. You are free to modify this code.
This code uses an xml file as the database. It is possible to use a MySql as the database, but it is difficult to incorporate into a zip file of example code. For that reason, an xml file is used at the database. That file is the "scevent.xml".
The first page is the "ManageEvents.php". This page will load events from the scevent.xml and display in a table format. The page allows you to add, edit and delete events from the scevent.xml. When you are done managing your events, click the "save Changes" button to save the new version of the scevent.xml on the server.
Please note: if multiple users access the ManageEvents.php at the same time, it is possible for them to overwrite each others changes in the scevent.xml. It is recommended that only one user access the ManageEvents.php at a time. If you plan on having multiple concurrent users access the page, you will most likely need to use a MySql database. You could alter the page to read from the database and commit changes with every action, so that each concurrent user constantly sees updates from other users.
The scevent.php is the second page of the interactive solution. It reads data from the scevent.xml and generates the necessary javascript code for the scriptcalendar. The javascript is generated on demand, and the scevent.xml is read only, so there is no concurrency issue.
It is possible for the scriptcalendar to use the xml directly from the scevent.xml, but it is a simple matter to convert to javascript and complete cross browser support is achieved by using javascript.
Download the PHP source code zip file.
folder | file | description |
(root) | manageEvents.php | main page for managing events (start here) |
(root) | scevent.php | renders javascript included in scthemes/iexample/scrptcal.htm |
(root) | common.php | library of common PHP functions |
(root) | scevent.xml | xml file used as a data store/ data source |
(root) | main.css | cascading stylesheet for the manageEvents.php |
(root) | calendar.htm | html page that loads the scthemes/iexample/scrptcal.htm in an iframe |
images | (multiple) | graphics files for the manageEvents.php |
sccomponents | (multiple) | scriptcalendar javascript event calendar files |
scthemes | (multiple) | scriptcalendar iexample theme files |
iexample | scrptcal.htm | renders the calendar using scevent.php as a javascript include |