How to use the script
- Download the complete calendar package.
- Unzip the file.
- Upload all the files a directory in your server (e.g. "calendar").
- Open your browser to the calendar directory and run the ac-install.php file.
- Note - the ac-config.inc.file will need write permissions (chmod 777) - alternatively you can modify it manually on your server.
- Follow the install instructions. This file preforms the following actions:
- Check database connection - if it fails, it checks write permission on ac-config.inc.php file then shows a form for indicating your database connection data.
- Once ac-config.inc.php has been configured, it writes the database tables and default data to the database.
- Shows basic calendar configuration parameters (url, title, num months etc) - these can later be changed from the administration panel.
- Once the install process is complete, remove the ac-install.php file from the ftp and change the write permissions on the ac-config.inc.php so that it is unwritable.
- Login to admin ( eg. http://www.your_url.com/calendar/ac-admin/)
Note - change these default values as soon as possible!
- Define your calendar items.
- Include the calendar in your web or application (see readme.txt for more information).
- That's all. If you are happy and you like it, feel free to make a donation :)
- NEW - lang folder and files need write permissions (chmod 777) to be able to be administrated via admin
- PHP 4 or greater
- MYSQL database
- Use the Forum for help etc.
- For custom integration, commercial license etc. please Contact me directly.
Implementation - iframe
The simplest method of including the calendar within your web is to use an "iframe".
This involves nothing more than simply placing the url of the calendar in the "src" attribute of the iframe tag like this:
<iframe width="700px" height="400px" src="/calendar/index.php"></iframe>Unless you want to get your hands dirty with php code (see below), I suggest that you use this iframe method to include the calendar in your website.
A few years ago this would be a possibly the most common method for showing this sort of information.
However, in recent years most browsers block popup windows so it is unlikely that your users will actually ever see the window.
There are many examples of popup window scripts on the internet but I have included an example in case you want to use this method.
Implementation - PHP integration
Ideally this is the method your should choose as it completely embeds the calendar in yo.ur page, however it does require a certain amount of php and html knowledge.
To implement the calendar this way you need to do the following things:
Include the calendar php file. eg.:
require_once(ac-includes/cal.inc.php);This file will include all the various calendar configuration files which, amongst many other things will define the php constant variables that are then used in the following code snippets.
var url_ajax_cal = '<?php echo AC_DIR_AJAX; ?>calendar.ajax.php'; var img_loading_day = '<?php echo AC_DIR_IMAGES; ?>ajax-loader-day.gif'; var img_loading_month = '<?php echo AC_DIR_IMAGES; ?>ajax-loader-month.gif'; var id_item = '<?php echo ID_ITEM; ?>'; var lang = '<?php echo LANG; ?>'; var months_to_show = <?php echo AC_NUM_MONTHS; ?>; var clickable_past = '<?php echo AC_ACTIVE_PAST_DATES; ?>';
- Show the calendar where you need it in your html code:
<div id="the_months"> <?php echo $calendar_months; ?> </div>
- Calendar Navigation
<div id="cal_prev" title="'.$lang["prev_X_months"].'"> <img src="'.AC_DIR_IMAGES.'icon_prev.gif" class="cal_button"> </div> <div id="cal_next" title="'.$lang["next_X_months"].'"> <img src="'.AC_DIR_IMAGES.'icon_next.gif" class="cal_button"> </div>
- Calendar Key and last update date:
<div id="key_wrapper"> '.$calendar_states.' <div id="footer_data"> '.$lang["last_update"].': '.get_cal_update_date(ID_ITEM).' </div> </div>
Finally, for more help, try posting your questions on the Ajax Availability Calenda Forum
Important - PHP 8
There is an issue with the script in PHP 8 which is causing the calendar to not display properly.
Here is a quick fix for existing versions (no need to update):
In ac-includes > common.inc.php and change line 16 (latest version) from this:
//error_reporting(E_ALL ^ E_NOTICE);to this:
This code turns off PHP error reporting just for the calendar script.
I am currently working a completely new version to adapt the code to more modern development techniques.
Follow the project on Github
- Converted into Web Component.
- No images - use modern CSS to show availabililty states.
- Simple CSS.
- Automatically calculates the number of months to show.
- The month days adapt to fill the available space.
- Sinple integration into front-end bookings form.
- Renovated admin panel with:
- Possibility to add basic booking details.
- Interactive customise styling "no code".
- Language translations stored in the database.
- Unlimited users and items.
- Password reminder via email.
Help with installation?The calendar script is very simple to set up on your server. However, if you prefer, I can install the calendar on your server for you.
- Server running PHP
- One Mysql Database. If you don't have one, your hosting provider should be able to create one for you.
If you are interested in this option, don't hesitate to contact me via my contact form. I will get back to you as soon as possible.
* Not included in base price:
- Functionality customization.
- Skin modifications (css & layout).
- Database creation.