PHP Classes

File: calendar_generation_part.php

Recommend this page to a friend!
  Classes of Arturs Sosins  >  AJAX Calendar  >  calendar_generation_part.php  >  Download  
File: calendar_generation_part.php
Role: Example script
Content type: text/plain
Description: Example with all possible customization where calendar generation and ajax request procesing are in different files. This is Calendar generation part
Class: AJAX Calendar
Display month calendars browseable using AJAX
Author: By
Last change: credits changed
Date: 5 years ago
Size: 2,345 bytes


Class file image Download
 * This script is developed by Arturs Sosins aka ar2rsawseen,
 * Fee free to distribute and modify code, but keep reference to its creator
 * This can be used to display month calendars browsable using AJAX.
 * It can generate HTML and JavaScript to display a month calendar with
 * links to browse the months using AJAX to avoid page reloading.
 * For more information, examples and online documentation visit:
//This is an example with all possible calendar customizations like in custom_example.php only here calendar generation and ajax request are in different files
//This is a calendar generation file

//you should always sepecify timezone when dealing with date function like used in calendar

//declaring class instance
$calendar = new calendar();

//defining path to jquery and style css included in package
echo '<script type="text/javascript" src="./jquery.js"></script>';
'<style type="text/css" media="all">@import "./style.css";</style>';
//array with custom month names
$months = array("Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec");
//applying custom month names

//array with custom days of week names
$weekdays = array("M", "T", "W", "Th", "F", "S", "Sun");
//applying custom days of week names

//define with which day to start week 0 - Monday, ..., 6 - Sunday
//here in example it is Tuesday

//Now this is new, we are setting request url, to other file
//you may want to edit it to match your directory path

//getting errors
$errors = $calendar->get_errors();
$errors as $error)

//generating calendar, you can specify date like in example
//if no date is specified, than todays date will be used