Location: PHPKode > projects > SASHA > SASHA/index.php
<?php

/**
 * SASHA :: index.php
 *
 * Home page, where the current tasks are shown.
 *
 * @package SASHA
 * @copyright (C) 2006-2010 Gordon P. Hemsley
 * @license docs/LICENSE BSD License
 * @version $Id: index.php 88 2010-03-28 18:53:20Z gphemsley $
 */

/**
 * Define the path to the root directory, relative to this file.
 */
define( 'ROOT', './' );
define( 'THIS_FILE', 'index.php' );

/**
 * Specify the title of the page and the tab currently highlighted.
 */
$page_title = array( 'Home' );
$tab = 'home';

require( ROOT . 'inc/inc.main.php' );

/**
 * Include the style header, required for proper page output.
 */
include( ROOT . 'style/default/header.php' );

require( ROOT . 'inc/lib/lib.home.php' );

$SASHA = new Home();

$today = mktime( 0, 0, 0 ); 						// Day 0
$tomorrow = $today + DAT_DAY; 						// Day 1
$day_after_tomorrow = $tomorrow + DAT_DAY; 			// Day 2
$this_week = $day_after_tomorrow + ( DAT_DAY * 5 ); // Day 7
$this_month = $this_week + ( DAT_DAY * 23 ); 		// Day 30
$next_month = $this_month + DAT_MONTH;				// Day 60

$now = time();
$upcoming = $now + ( DAT_WEEK * 2 );

?>

<p style="text-align: center; margin: 0em auto;">Welcome<?php print ( ( !empty( $User->user_info['preferred_name'] ) ) ? ', <strong>' . $User->user_info['preferred_name'] . '</strong>' : ' to SASHA' ); ?>!</p>

<div id="left-column">
<?php

print "\t" . '<h2>Assignments Due</h2>' . "\n";

$SASHA->display_assignments_list( 'Overdue', 0, $today, FALSE, AT_DONE );
$SASHA->display_assignments_list( 'Due Today', $today, $tomorrow );
$SASHA->display_assignments_list( 'Due Tomorrow', $tomorrow, $day_after_tomorrow );
$SASHA->display_assignments_list( 'Due This Week', $day_after_tomorrow, $this_week );
$SASHA->display_assignments_list( 'Due This Month', $this_week, $this_month );

?>
</div>

<div id="center-column">
<?php

print "\t" . '<h2>Tasks To Do</h2>' . "\n";

$SASHA->display_assignments_list( 'Overdue', 0, $tomorrow, TRUE, AT_DONE );
$SASHA->display_assignments_list( 'To Do Today', $tomorrow, $day_after_tomorrow, TRUE, AT_DONE );
$SASHA->display_assignments_list( 'To Do Tomorrow', $day_after_tomorrow, $this_week, TRUE, AT_DONE );
$SASHA->display_assignments_list( 'To Do This Week', $this_week, $this_month, TRUE, AT_DONE );
$SASHA->display_assignments_list( 'To Do This Month', $this_month, $next_month, TRUE, AT_DONE );

?>
</div>

<div id="right-column">
<?php

/**
 * Output this month's calendar by default.
 */
require( ROOT . 'inc/lib/lib.calendar.php' );

$Calendar = new Calendar_Monthly( date( 'Y' ), date( 'n' ), date( 'j' ) );

?>
	<div class="calendar" style="padding-bottom: 1em; border-bottom: 1px solid #7F007F;">
<?php

$Calendar->output_calendar( FALSE, FALSE, TRUE );

?>
	</div>

<?php

print "\t" . '<h2>Upcoming Tests</h2>' . "\n";

$SASHA->display_tests_list( 'Finals', $now, $upcoming, TT_FINAL );
$SASHA->display_tests_list( 'Midterms', $now, $upcoming, TT_MIDTERM );
$SASHA->display_tests_list( 'Exams', $now, $upcoming, TT_EXAM );
$SASHA->display_tests_list( 'Quizzes', $now, $upcoming, TT_QUIZ );

?>
</div>
<?php

/**
 * Include the style footer, required for proper page output.
 */
include( ROOT . 'style/default/footer.php' );

?>
Return current item: SASHA