diff --git a/admin/reports.php b/admin/reports.php
index 2bb13287..bc462f08 100644
--- a/admin/reports.php
+++ b/admin/reports.php
@@ -43,6 +43,10 @@ while($catr=mysql_fetch_object($catq))
echo "";
echo "";
+ echo "
";
+ echo i18n("Student Emergency Contact Names/Numbers").": ";
+ echo "PDF ";
+ echo "CSV ";
echo "
";
echo i18n("Project Table Labels").": ";
diff --git a/admin/reports_emergencycontact.php b/admin/reports_emergencycontact.php
new file mode 100644
index 00000000..5aac0d82
--- /dev/null
+++ b/admin/reports_emergencycontact.php
@@ -0,0 +1,94 @@
+
+/*
+ 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
+ Copyright (C) 2005 James Grant
+
+ 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.
+*/
+?>
+
+ require("../common.inc.php");
+ auth_required('admin');
+ require("../lpdf.php");
+ require("../lcsv.php");
+
+ $type=$_GET['type'];
+
+ if($type=="pdf")
+ {
+
+ $rep=new lpdf( i18n($config['fairname']),
+ i18n("Emergency Contact List"),
+ $_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
+ );
+
+ $rep->newPage();
+ $rep->setFontSize(10);
+ }
+ else if($type=="csv")
+ {
+ $rep=new lcsv(i18n("Emergency Contact")." - ".i18n($catr->category));
+ }
+ $q=mysql_query("SELECT students.firstname,
+ students.lastname,
+ emergencycontact.firstname AS emerg_firstname,
+ emergencycontact.lastname AS emerg_lastname,
+ emergencycontact.relation,
+ emergencycontact.phone1,
+ emergencycontact.phone2,
+ emergencycontact.phone3,
+ emergencycontact.phone4,
+ emergencycontact.email,
+ registrations.status,
+ projects.title,
+ projects.projectnumber
+ FROM
+ students
+ left outer join emergencycontact ON students.id=emergencycontact.students_id
+ left outer join registrations ON students.registrations_id=registrations.id
+ left outer join projects ON projects.registrations_id=registrations.id
+ WHERE
+ registrations.year='".$config['FAIRYEAR']."'
+ AND ( registrations.status='complete' OR registrations.status='paymentpending' )
+ ORDER BY
+ students.lastname,
+ students.firstname
+ ");
+ echo mysql_error();
+
+ $table=array();
+
+ $table['header']=array(i18n("First Name"),i18n("Last Name"),i18n("Emerg First"),i18n("Emerg Last"), i18n("Relation"), i18n("Emerg Phone"));
+ $table['widths']=array( 1.25, 1.25, 1.25, 1.25, 1, 1.25);
+ $table['dataalign']=array("left","left","left","left","left","left");
+
+ while($r=mysql_fetch_object($q))
+ {
+ $table['data'][]=array($r->firstname,$r->lastname,$r->emerg_firstname,$r->emerg_lastname,$r->relation,$r->phone1);
+ if($r->phone2)
+ $table['data'][]=array('','','','','',$r->phone2);
+ if($r->phone3)
+ $table['data'][]=array('','','','','',$r->phone3);
+ if($r->phone4)
+ $table['data'][]=array('','','','','',$r->phone4);
+
+ }
+
+ $rep->addTable($table);
+ $rep->output();
+?>