Location: PHPKode > projects > O - OpenSource GroupWare > osgw/calendar/index.php
<?php
/**************************************************************************
   This program is free software; you can 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.

   @Authors Ryan Thompson(hide@address.com)
   @package calendar
***************************************************************************/
/*$Id: index.php,v 1.10 2004/05/25 07:58:50 rthomp Exp $*/
//Calendar

include("./data.php");
$service['add_header'] = TRUE;
include("../config.inc.php");
include($here. "/classes/class.calendar.php");
$cal = new calendar(NULL, $_GET['d'], $_GET['m'], $_GET['y']);

if(isset($_GET['list']))
{
	$O->redirect("/calendar/event_list.php");	
} elseif(isset($_GET['create']))
{
	$O->redirect("/calendar/create_event.php");
	
} elseif(isset($_GET['today']))
{
	$tmp = explode(':', $lang->msgs['views']);
	$v = strtolower($tmp[$_GET[v]]);
	$d = date('j');
	$m = date('n');
	$y = date('Y');
	$O->redirect("/calendar/$v.php?v={$_GET['v']}&d=$d&m=$m&y=$y");
} elseif(isset($_GET['v']))
{
	
	$tmp = explode(':', $lang->msgs['views']);
	$v = strtolower($tmp[$_GET[v]]);
	
	$O->redirect("/calendar/$v.php?v={$_GET['v']}&d={$_GET['d']}&m={$_GET['m']}&y={$_GET['y']}");
} else {
	$default_view = $cal->default_view();
	
	if(!file_exists($O->dir. "/calendar/$default_view.php"))
	{
		$O->redirect("/calendar/month.php");	
	} else {
	
		$O->redirect("/calendar/$default_view.php");
	}
}
Return current item: O - OpenSource GroupWare