Exemplo n.º 1
0
    $user_id = $_REQUEST['user_id'];
} else {
    $user_id = $loggedin_user->id;
}
// Create a new day
$day = new Day($_GET['y'], $_GET['m'], $_GET['d']);
// Get the task data
$task = new SI_Task();
$tasks = $task->getCalendarTasks($user_id, $day->getTimestamp(), $day->getTimestamp() + 24 * 60 * 60, 'hour');
if ($tasks === FALSE) {
    $error_msg .= "Could not retrieve Tasks!\n";
    debug_message($task->getLastError());
}
// Get the activity data
$ta = new SI_TaskActivity();
$activities = $ta->getCalendarActivities($user_id, $day->getTimestamp(), $day->getTimestamp() + 24 * 60 * 60, 'hour');
if ($activities === FALSE) {
    $error_msg .= "Could not retrieve activities!\n";
    debug_message($ta->getLastError());
}
// Make sure the current date is selected
$sHours = array(new Hour(date('Y'), date('m'), date('d'), date('H')));
// Build the hour list for that day
$day->build($sHours);
$title = "Calendar - Month View";
require 'header.php';
?>
<table class="dg_table" width="450">
	<TR>
		<TD COLSPAN="2" CLASS="dg_header_cell"><?php 
echo date('l F jS', $day->thisDay(true));
Exemplo n.º 2
0
// Instantiate the Month class
$month = new Month($_GET['y'], $_GET['m'], "Sunday");
// Get the details of the months as timestamps
$last = $month->lastMonth(true);
$next = $month->nextMonth(true);
$thisMonth = $month->thisMonth(true);
// Get the task data
$task = new SI_Task();
$tasks = $task->getCalendarTasks($user_id, $thisMonth, $next, 'day');
if ($tasks === FALSE) {
    $error_msg .= "Could not retrieve Tasks!\n";
    debug_message($task->getLastError());
}
// Get the activity data
$ta = new SI_TaskActivity();
$activities = $ta->getCalendarActivities($user_id, $thisMonth, $next, 'day');
if ($activities === FALSE) {
    $error_msg .= "Could not retrieve activities!\n";
    debug_message($ta->getLastError());
}
// Make sure the current date is selected
$sDays = array(new Day(date('Y'), date('m'), date('d')));
// Build the days of the month
$month->buildWeekDays($sDays);
// Define the days of the week for column headings
$daysOfWeek = array('Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday');
$title = "Calendar - Month View";
require 'header.php';
?>
<?
if($loggedin_user->hasRight('admin')){?>