forked from science-ation/science-ation
101 lines
2.4 KiB
PHP
101 lines
2.4 KiB
PHP
<?
|
|
/*
|
|
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>
|
|
|
|
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");
|
|
require_once("../user.inc.php");
|
|
user_auth_required('committee', 'admin');
|
|
require("../lpdf.php");
|
|
require("../lcsv.php");
|
|
|
|
if(!$_GET['type']) $type="csv";
|
|
else $type=$_GET['type'];
|
|
|
|
if($type=="pdf")
|
|
{
|
|
$rep=new lpdf( i18n($config['fairname']),
|
|
i18n("Available Tours"),
|
|
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
|
|
);
|
|
|
|
$rep->newPage();
|
|
$rep->setFontSize(11);
|
|
}
|
|
else if($type=="csv")
|
|
{
|
|
$rep=new lcsv(i18n("Available Tours"));
|
|
}
|
|
|
|
$table=array();
|
|
$table['header']=array( i18n("ID"),
|
|
i18n("Name"),
|
|
i18n("Description"),
|
|
i18n("Capacity"),
|
|
i18n("Minimum Grade"),
|
|
i18n("Maximum Grade"),
|
|
i18n("Contact"),
|
|
i18n("Location"));
|
|
|
|
|
|
$q=mysql_query("SELECT *
|
|
FROM
|
|
tours
|
|
WHERE
|
|
year='".$config['FAIRYEAR']."'
|
|
ORDER BY
|
|
id");
|
|
while($r=mysql_fetch_object($q))
|
|
{
|
|
|
|
// print_r($judge_divs);
|
|
// print_r($judge_subdivs);
|
|
|
|
$n = str_replace("\r","", $r->name);
|
|
$n = str_replace("\n"," ", $n);
|
|
$d = str_replace("\r","", $r->description);
|
|
$d = str_replace("\n"," ", $d);
|
|
$c = str_replace("\r","", $r->contact);
|
|
$c = str_replace("\n"," ", $c);
|
|
$l = str_replace("\r","", $r->location);
|
|
$l = str_replace("\n"," ", $l);
|
|
|
|
$tmp=array(
|
|
$r->id,
|
|
mysql_escape_string($n),
|
|
mysql_escape_string($d),
|
|
$r->capacity,
|
|
$r->grade_min,
|
|
$r->grade_max,
|
|
mysql_escape_string($c),
|
|
mysql_escape_string($l)
|
|
|
|
);
|
|
// print_r($tmp);
|
|
$table['data'][]=$tmp;
|
|
}
|
|
|
|
$rep->addTable($table);
|
|
$rep->output();
|
|
|
|
?>
|