<?
/* 
   This file is part of the 'Science Fair In A Box' project
   SFIAB Website: http://www.sfiab.ca

   Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
   Copyright (C) 2005 James Grant <james@lightbox.org>
   Copyright (C) 2006 Justin Reardon <webmaster@rcrsf.ca>

   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, version 2.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
   Boston, MA 02111-1307, USA.
*/
?>
<?
 //this file is meant to be used as a popup from the registration list page to view student info
 //it needs the student ID passed into it.
 //thus, we do not need the normal header and footer
 require("../common.inc.php");
 require_once("../user.inc.php");
 user_auth_required('committee', 'admin');

 if($_GET['id'])
 {
 	$q=mysql_query("SELECT
				students.*,
				schools.school
			FROM 
				students
				LEFT OUTER JOIN schools ON schools.id=students.schools_id
			WHERE 
				students.id='".$_GET['id']."'");
	echo mysql_error();
	$studentinfo=mysql_fetch_object($q);

 	send_popup_header(i18n("Student Information - %1 %2",array($studentinfo->firstname,$studentinfo->lastname)));

	echo "<table class=\"tableview\">\n";

	echo "<tr>\n";
	echo " <th>".i18n("First Name")."</th><td>$studentinfo->firstname</td>\n";
	echo " <th>".i18n("Last Name")."</th><td>$studentinfo->lastname</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n("Grade")."</th><td>$studentinfo->grade</td>\n";
	echo " <th>".i18n("Gender")."</th><td>$studentinfo->sex</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n("Email Address")."</th><td>$studentinfo->email</td>\n";
	echo " <th>".i18n("Phone")."</th><td>$studentinfo->phone</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n("Address")."</th><td>$studentinfo->address</td>\n";
	echo " <th>".i18n("City")."</th><td>$studentinfo->city</td>\n";
	echo "</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n($config['provincestate'])."</th><td>$studentinfo->province";
	echo " <th>".i18n($config['postalzip'])."</th><td>$studentinfo->postalcode</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n("Medical Information")."</th><td>$studentinfo->medicalalert";
	echo " <th>".i18n("School")."</th><td>$studentinfo->school</td>\n";
	echo "</tr>\n";
	echo "<tr>\n";
	echo " <th>".i18n("Teacher Name")."</th><td>$studentinfo->teachername";
	echo " <th>".i18n("Teacher Email")."</th><td>$studentinfo->teacheremail</td>\n";
	echo "</tr>\n";
echo "</table>";
 }
 else
 {
 	send_popup_header("Student Information");
	echo error(i18n("No Student ID passed to Student Info"));
 }

 send_popup_footer();

?>
