Location: PHPKode > projects > PortalXP - Teacher Edition > PortalXP/PortalXP/calendar/display.php
<link REL="stylesheet" TYPE="text/css" HREF="../../portalxp.css">


<?php
	include ('../admin/config.php');
	include('../admin/outputlib.php');
	include('../admin/connect.php');

	$monthname = date('F', mktime(0,0,0,$month,1,$year));

	echo "<font face=Arial size=5><b><center>$day $monthname $year</b><p>";

	$database = mysql_connect($hostname, $user, $password);
	#mysql_select_db(portalxp, $database);

	$lastseconds = mktime(0,0,0,$month,$day,$year)-(24*60*60);
        $lastday = date('j', $lastseconds);
        $lastmonth = date('m', $lastseconds);
        $lastyear = date('Y', $lastseconds);

        $nextseconds = mktime(0,0,0,$month,$day,$year)+(24*60*60);
        $nextday = date('j', $nextseconds);
        $nextmonth = date('m', $nextseconds);
        $nextyear = date('Y', $nextseconds);

	$query = mysql_query("SELECT * FROM calendar WHERE stamp >= \"$year-$month-$day 00:00:00\" AND stamp <= \"$year-$month-$day 23:59:59\" and teacher_id = $teacher_id ORDER BY stamp", $database);

	while ($row = mysql_fetch_array($query))
	{
		echo "	<table cellpadding=5 cellspacing=5 border=1>
			<tr><td><b>Poster</td><td><b>Time</td><td><b>Subject</td></tr>
			<tr><td>$row[teacher_id]</a></td>
			<td>$row[stamp] $row[timeofday]</td>
			<td>";

			echo print_output ($row['subject'])."</td></tr><tr><td colspan=3>";
			echo print_output ($row['description'])."</td></tr></table>";
	}

?>
Return current item: PortalXP - Teacher Edition