Location: PHPKode > projects > O - OpenSource GroupWare > osgw/calendar/home.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)
***************************************************************************/
include("calendar/classes/class.calendar.php");
//include("calendar/classes/class.events.php");
$cal = new calendar(NULL, $_GET['d'], $_GET['m'], $_GET['y']);
$events = new events();
?>
<table width="100%" cellspacing="0">
<tr>
<td>
<h2 class="home_header">
	<?php echo $O->create_link("/calendar", $lang->get_msg('service_name','cl'), 'home_header')?>
</h2>
</td>
</tr>
<tr>
<td style="text-align:right">
<table width="100%">
<?php

$start_time = mktime(0,0,0, date('n'), date('j'), date('Y'));
$finish_time = mktime(24,0,0, date('n'), date('j') + 10, date('Y'));


$event_list = $events->search_events($start_time, $finish_time);
if(is_array($event_list))
{
	$event_list = array_merge($event_list, $share->run_share_query('cl', $user->user_id,'o_calendar', 'event_id', ''));
} else {
	$event_list = $share->run_share_query('cl', $user->user_id,'o_calendar', 'event_id', '');
}

foreach($event_list AS $id => $value)
{
	
	$class = $html->list_class($class);
	echo "<tr>";
	echo "<td class=\"$class\" style=\"text-align:left\">";
	if(isset($value['username']))
	{
		$username = " ({$value['username']})";
	}
	echo $O->create_link("/calendar/view_event.php?id=". $value['event_id'], $value['subject'], 
		$class, "title=\"Start: ". date($date->long_date. " - ". $date->time, $value['evt_start']) ."\"");
	echo $username;
	echo "</td>";
	echo "</tr>";	
	
}
/*
$results = $share->run_share_query('cl', $user->user_id,'o_calendar', 'event_id', '');

foreach($results AS $key => $value)
{
	$class = $html->list_class($class);
	echo "<tr>";
	echo "<td class=\"$class\" style=\"text-align:left\">";
	echo $O->create_link("/calendar/view_event.php?id=". $value['event_id'], $value['subject'], 
		$class, "title=\"Start: ". date($date->long_date. " - ". $date->time, $value['evt_start']) ."\"");
	echo "({$value['username']})";
	echo "</td>";
	echo "</tr>";	
	
}
*/
/*
	$sql = "SELECT * FROM o_calendar WHERE user_id='". $user->user_id ."'";
	
	$k = 0;
		
	$db->query($sql);
	while($db->fetch_results())
	{
		$events[$k] = $db->record;
		$k++;
		
	}
	$j = 0;
	while($j < count($events))
	{
		//Get HTML Class to handle this
		if($class == "list_light")
		{
			$class = "list_dark";
		} else {
			$class = "list_light";
		}
		$k = 0;
		/*
		Need to figure out how to display upcoming recurring events + regular events
		Right now it display ALL events.
		while($k < 10)
		{
			$month = date('n');
			$day = date('j') + $k;
			$year = date('Y');
		
			//$temp = $rec->get_recurrence($day, $month, $year, $events[$j]['event_id'], $start);
			
			$k++;
		}
		
		
		echo "<tr>";
		echo "<td class=\"$class\" style=\"text-align:left\">";
		echo $O->create_link("/calendar/view_event.php?id=". $events[$j]['event_id'], $events[$j]['subject'], 
			$class, "title=\"Start: ". date($date->long_date. " - ". $date->time, $events[$j]['evt_start']) ."\"");
		echo "</td>";
		echo "</tr>";	
		$j++;
	}*/


?>


</table>
<?php echo $O->create_link("/calendar/create_event.php", $lang->get_msg('add_event','cl'), 'menu_link');?>
</td>
</tr>
</table>
Return current item: O - OpenSource GroupWare