Location: PHPKode > projects > ACollab > events/index.php
<?php
/****************************************************************************************/
/* ACollab                                                                              */
/****************************************************************************************/
/* Copyright (c) 2002-2004  Adaptive Technology Resource Centre / University of Toronto */
/*                                                                                      */
/* http://atutor.ca/acollab                                                             */
/*                                                                                      */
/* This program is free software. You may redistribute it and/or                        */
/* modify it under the terms of the GNU General Public License                          */
/* as published by the Free Software Foundation; either version 2 of the License,       */
/* or (at your option) any later version.                                               */
/*                                                                                      */
/* This program is distributed in the hope that it will be useful, but                  */
/* WITHOUT ANY WARRANTY; without even the implied warranty of                           */
/* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.                                 */
/* See the GNU General Public License for more details.                                 */
/*                                                                                      */
/* You may access the GNU General Public License at:                                    */
/* http://www.opensource.org/licenses/gpl-license.php                                   */
/*                                                                                      */
/* You may contact the Adaptive Technology Resource Centre at                           */
/* Robarts Library, University of Toronto                                               */
/* 130 St. George Street, Toronto, Ontario, Canada M5S 1A5                              */
/* Further contact information is available at http://www.utoronto.ca/atrc/             */
/****************************************************************************************/
/* Programmer:                                                                          */
/* Joel Kronenberg - ATRC                                                               */
/****************************************************************************************/
// $Id: index.php 224 2004-06-07 17:45:16Z boonhau $

define('AC_INCLUDE_PATH', '../include/');

require(AC_INCLUDE_PATH.'vitals.inc.php');
require(AC_INCLUDE_PATH.'lib/calendar.class.php');
authenticate(USER_CLIENT, USER_GROUP_ADMIN, USER_ADMIN);

$_SECTION[0][0] = _AC('home');
$_SECTION[0][1] = 'home.php';
$_SECTION[1][0] = _AC('events_calendar');
$_SECTION[1][1] = 'events/';

require(AC_INCLUDE_PATH.'header.inc.php');

if (isset($_GET['m'])) {
	$month	= intval($_GET['m']);
} else {
	$month = date('m');
}

if (isset($_GET['y'])) {
	$year = intval($_GET['y']);
} else {
	$year = date('Y');
}

// next and previous months
$nextmonth = $month+1;
$nextyear = $year;
if ($nextmonth == 13) {
	$nextmonth = 1;
	$nextyear = $year + 1;
}

$lastmonth = $month-1;
$lastyear = $year;
if ($lastmonth == 0) {
	$lastmonth = 12;
	$lastyear = $year-1;
}

if (isset($_GET['f'])) {
	print_feedback($_GET['f']);
}
	echo '<table border="0" cellpadding="0" cellspacing="0" width="600" align="center">';
	echo '<tr>';
	echo '<td align="center" valign="top" width="25%"><a href="events/?y='.$lastyear.SEP.'m='.$lastmonth.'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'.AT_date('%F', $lastmonth, AT_DATE_INDEX_VALUE).'</a></td>';
	
	echo '<td align="center"><h3>' . AT_date('%F', $month, AT_DATE_INDEX_VALUE). ' '. $year.'</h3>';
	echo '<a href="events/add_event.php" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">ยป '._AC('add_event').'</a>';
	echo '<br /><br /></td>';
	
	echo '<td align="center" valign="top"  width="25%"><a href="events/?y='.$nextyear.SEP.'m='.$nextmonth.'" onfocus="this.className=\'highlight\'" onblur="this.className=\'\'">'.AT_date('%F', $nextmonth, AT_DATE_INDEX_VALUE).'</a></td>';
	echo '</tr></table>';


$cal = new EventCalendar($year, $month);
$cal->SetDB($db);
$cal->PrintCalendar();

	require(AC_INCLUDE_PATH.'footer.inc.php');
?>
Return current item: ACollab