forked from science-ation/science-ation
- Delete reports that the new report generator now duplicates
This commit is contained in:
parent
b3978c7dae
commit
331bedc7e7
@ -1,126 +0,0 @@
|
|||||||
<?
|
|
||||||
/*
|
|
||||||
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");
|
|
||||||
auth_required('admin');
|
|
||||||
require("../lpdf.php");
|
|
||||||
require("../lcsv.php");
|
|
||||||
|
|
||||||
$type=$_GET['type'];
|
|
||||||
|
|
||||||
$catq=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' AND id='".$_GET['cat']."'");
|
|
||||||
if($catr=mysql_fetch_object($catq))
|
|
||||||
{
|
|
||||||
if($type=="pdf")
|
|
||||||
{
|
|
||||||
|
|
||||||
$rep=new lpdf( i18n($config['fairname']),
|
|
||||||
i18n("Checkin List")." - ".i18n($catr->category),
|
|
||||||
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
|
|
||||||
);
|
|
||||||
|
|
||||||
$rep->newPage();
|
|
||||||
$rep->setFontSize(11);
|
|
||||||
}
|
|
||||||
else if($type=="csv")
|
|
||||||
{
|
|
||||||
$rep=new lcsv(i18n("Checkin List")." - ".i18n($catr->category));
|
|
||||||
}
|
|
||||||
$q=mysql_query("SELECT registrations.id AS reg_id,
|
|
||||||
registrations.num AS reg_num,
|
|
||||||
registrations.status,
|
|
||||||
projects.title,
|
|
||||||
projects.projectnumber,
|
|
||||||
projects.projectdivisions_id
|
|
||||||
FROM
|
|
||||||
registrations
|
|
||||||
left outer join projects on projects.registrations_id=registrations.id
|
|
||||||
WHERE
|
|
||||||
registrations.year='".$config['FAIRYEAR']."'
|
|
||||||
AND ( registrations.status='complete' OR registrations.status='paymentpending' )
|
|
||||||
AND projects.projectcategories_id='$catr->id'
|
|
||||||
ORDER BY
|
|
||||||
projects.title
|
|
||||||
");
|
|
||||||
echo mysql_error();
|
|
||||||
|
|
||||||
$table=array();
|
|
||||||
|
|
||||||
//only show the 'paid' column if the regfee > 0. if registration is fee, then we dont care about the 'paid' column!
|
|
||||||
if($config['regfee']>0)
|
|
||||||
{
|
|
||||||
$table['header']=array(i18n("Paid?"),i18n("Proj #"),i18n("Project Title"),i18n("Student(s)"),i18n("Div"));
|
|
||||||
$table['widths']=array(0.5, 0.6, 3.5, 2.4, 0.5);
|
|
||||||
$table['dataalign']=array("center","left","left","left","center");
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
$table['header']=array(i18n("Proj #"),i18n("Project Title"),i18n("Student(s)"),i18n("Div"));
|
|
||||||
$table['widths']=array( 0.6, 3.7, 2.7, 0.5);
|
|
||||||
$table['dataalign']=array("left","left","left","center");
|
|
||||||
|
|
||||||
}
|
|
||||||
while($r=mysql_fetch_object($q))
|
|
||||||
{
|
|
||||||
$divq=mysql_query("SELECT division,division_shortform FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' AND id='".$r->projectdivisions_id."'");
|
|
||||||
$divr=mysql_fetch_object($divq);
|
|
||||||
|
|
||||||
$sq=mysql_query("SELECT students.firstname,
|
|
||||||
students.lastname
|
|
||||||
FROM
|
|
||||||
students
|
|
||||||
WHERE
|
|
||||||
students.registrations_id='$r->reg_id'
|
|
||||||
");
|
|
||||||
|
|
||||||
$students="";
|
|
||||||
$studnum=0;
|
|
||||||
while($studentinfo=mysql_fetch_object($sq))
|
|
||||||
{
|
|
||||||
if($studnum>0) $students.=", ";
|
|
||||||
$students.="$studentinfo->firstname $studentinfo->lastname";
|
|
||||||
$studnum++;
|
|
||||||
}
|
|
||||||
|
|
||||||
//only show the paid column if regfee >0
|
|
||||||
if($config['regfee']>0)
|
|
||||||
{
|
|
||||||
switch($r->status)
|
|
||||||
{
|
|
||||||
case "paymentpending": $status_text="No"; break;
|
|
||||||
case "complete": $status_text=""; break;
|
|
||||||
}
|
|
||||||
$status_text=i18n($status_text);
|
|
||||||
|
|
||||||
$table['data'][]=array($status_text,$r->projectnumber,$r->title,$students,i18n($divr->division_shortform));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
$table['data'][]=array($r->projectnumber,$r->title,$students,i18n($divr->division_shortform));
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$rep->addTable($table);
|
|
||||||
$rep->output();
|
|
||||||
}
|
|
||||||
?>
|
|
@ -1,115 +0,0 @@
|
|||||||
<?
|
|
||||||
/*
|
|
||||||
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");
|
|
||||||
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();
|
|
||||||
|
|
||||||
//if its a PDF we'll put each additional phone number on a new line, for CSV, we'll have a column for each
|
|
||||||
if($type=="pdf")
|
|
||||||
{
|
|
||||||
$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");
|
|
||||||
}
|
|
||||||
else if($type=="csv")
|
|
||||||
{
|
|
||||||
$table['header']=array(i18n("First Name"),i18n("Last Name"),i18n("Emerg First"),i18n("Emerg Last"), i18n("Relation"), i18n("Emerg Phone 1"),i18n("Emerg Phone 2"),i18n("Emerg Phone 3"),i18n("Emerg Phone 4"));
|
|
||||||
//.widths mean nothing for csv
|
|
||||||
$table['widths']=array( 1.25, 1.25, 1.25, 1.25, 1, 1.25,1.25,1.25,1.25);
|
|
||||||
$table['dataalign']=array("left","left","left","left","left","left","left","left","left");
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
while($r=mysql_fetch_object($q))
|
|
||||||
{
|
|
||||||
//put each phone number on a new line, if it exists
|
|
||||||
if($type=="pdf")
|
|
||||||
{
|
|
||||||
$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);
|
|
||||||
}
|
|
||||||
//put all phone numbers on the same line, in their own columns
|
|
||||||
else if($type=="csv")
|
|
||||||
{
|
|
||||||
$table['data'][]=array($r->firstname,$r->lastname,$r->emerg_firstname,$r->emerg_lastname,$r->relation,$r->phone1,$r->phone2,$r->phone3,$r->phone4);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$rep->addTable($table);
|
|
||||||
$rep->output();
|
|
||||||
?>
|
|
@ -1,95 +0,0 @@
|
|||||||
<?
|
|
||||||
/*
|
|
||||||
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");
|
|
||||||
auth_required('admin');
|
|
||||||
require("../lpdf.php");
|
|
||||||
require("../lcsv.php");
|
|
||||||
|
|
||||||
$type=$_GET['type'];
|
|
||||||
|
|
||||||
if($type=="pdf")
|
|
||||||
{
|
|
||||||
|
|
||||||
$rep=new lpdf( i18n($config['fairname']),
|
|
||||||
i18n("Project Logistical Requirements"),
|
|
||||||
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
|
|
||||||
);
|
|
||||||
|
|
||||||
$rep->newPage();
|
|
||||||
$rep->setFontSize(11);
|
|
||||||
}
|
|
||||||
else if($type=="csv")
|
|
||||||
{
|
|
||||||
$rep=new lcsv(i18n("Project Logistical Requirements"));
|
|
||||||
}
|
|
||||||
|
|
||||||
$projq=mysql_query("SELECT
|
|
||||||
registrations.id AS reg_id,
|
|
||||||
registrations.num AS reg_num,
|
|
||||||
projects.id,
|
|
||||||
projects.title,
|
|
||||||
projects.projectnumber,
|
|
||||||
projects.projectdivisions_id,
|
|
||||||
projects.projectcategories_id,
|
|
||||||
projects.summary,
|
|
||||||
projects.req_electricity,
|
|
||||||
projects.req_table,
|
|
||||||
projects.req_special,
|
|
||||||
projects.language,
|
|
||||||
projectdivisions.division,
|
|
||||||
projectcategories.category
|
|
||||||
FROM
|
|
||||||
registrations
|
|
||||||
LEFT JOIN projectdivisions ON projectdivisions.id=projects.projectdivisions_id
|
|
||||||
LEFT JOIN projectcategories ON projectcategories.id=projects.projectcategories_id
|
|
||||||
LEFT JOIN projects on projects.registrations_id=registrations.id
|
|
||||||
|
|
||||||
WHERE
|
|
||||||
projects.year='".$config['FAIRYEAR']."'
|
|
||||||
AND projectdivisions.year='".$config['FAIRYEAR']."'
|
|
||||||
AND projectcategories.year='".$config['FAIRYEAR']."'
|
|
||||||
AND ( registrations.status='complete'
|
|
||||||
OR registrations.status='paymentpending' )
|
|
||||||
ORDER BY
|
|
||||||
projects.projectnumber
|
|
||||||
");
|
|
||||||
echo mysql_error();
|
|
||||||
|
|
||||||
$totalprojects=mysql_num_rows($projq);
|
|
||||||
$projectcount=0;
|
|
||||||
|
|
||||||
$table=array();
|
|
||||||
$table['header']=array(i18n("Proj #"),i18n("Project Title"),i18n("Elec"),i18n("Table"),i18n("Special"));
|
|
||||||
$table['widths']=array( 0.70, 3, 0.5, .5, 1.75);
|
|
||||||
while($proj=mysql_fetch_object($projq))
|
|
||||||
{
|
|
||||||
$table['dataalign']=array("center","left","center","center","left");
|
|
||||||
$table['data'][]=array($proj->projectnumber,$proj->title,$proj->req_electricity,$proj->req_table,$proj->req_special);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rep->addTable($table);
|
|
||||||
unset($table);
|
|
||||||
$rep->output();
|
|
||||||
?>
|
|
@ -1,124 +0,0 @@
|
|||||||
<?
|
|
||||||
/*
|
|
||||||
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");
|
|
||||||
auth_required('admin');
|
|
||||||
require("../lpdf.php");
|
|
||||||
require("../lcsv.php");
|
|
||||||
|
|
||||||
$type=$_GET['type'];
|
|
||||||
|
|
||||||
if($type=="pdf")
|
|
||||||
{
|
|
||||||
|
|
||||||
$rep=new lpdf( i18n($config['fairname']),
|
|
||||||
i18n("School Projects"),
|
|
||||||
$_SERVER['DOCUMENT_ROOT'].$config['SFIABDIRECTORY']."/data/logo-200.gif"
|
|
||||||
);
|
|
||||||
|
|
||||||
$rep->newPage();
|
|
||||||
$rep->setFontSize(11);
|
|
||||||
}
|
|
||||||
else if($type=="csv")
|
|
||||||
{
|
|
||||||
$rep=new lcsv(i18n("School Projects"));
|
|
||||||
}
|
|
||||||
|
|
||||||
$projq=mysql_query("SELECT
|
|
||||||
schools.school,
|
|
||||||
projects.title,
|
|
||||||
projects.projectnumber,
|
|
||||||
registrations.id AS reg_id
|
|
||||||
FROM
|
|
||||||
schools,
|
|
||||||
projects,
|
|
||||||
registrations,
|
|
||||||
students
|
|
||||||
WHERE
|
|
||||||
projects.registrations_id=registrations.id
|
|
||||||
AND students.registrations_id=registrations.id
|
|
||||||
AND students.schools_id=schools.id
|
|
||||||
AND registrations.year='".$config['FAIRYEAR']."'
|
|
||||||
AND ( registrations.status='complete'
|
|
||||||
OR registrations.status='paymentpending' )
|
|
||||||
ORDER BY school,projectnumber
|
|
||||||
");
|
|
||||||
|
|
||||||
echo mysql_Error();
|
|
||||||
$oldschool="nothing";
|
|
||||||
$first=true;
|
|
||||||
$havealready=array();
|
|
||||||
while($proj=mysql_fetch_object($projq))
|
|
||||||
{
|
|
||||||
if(in_array($proj->reg_id,$havealready))
|
|
||||||
continue;
|
|
||||||
else
|
|
||||||
$havealready[]=$proj->reg_id;
|
|
||||||
|
|
||||||
$sq=mysql_query("SELECT students.firstname,
|
|
||||||
students.lastname
|
|
||||||
FROM
|
|
||||||
students
|
|
||||||
WHERE
|
|
||||||
students.registrations_id='$proj->reg_id'
|
|
||||||
");
|
|
||||||
|
|
||||||
$students="";
|
|
||||||
$studnum=0;
|
|
||||||
while($studentinfo=mysql_fetch_object($sq))
|
|
||||||
{
|
|
||||||
if($studnum>0) $students.=", ";
|
|
||||||
$students.="$studentinfo->firstname $studentinfo->lastname";
|
|
||||||
$studnum++;
|
|
||||||
}
|
|
||||||
if($oldschool!=$proj->school)
|
|
||||||
{
|
|
||||||
if(!$first)
|
|
||||||
{
|
|
||||||
$rep->addTable($table);
|
|
||||||
unset($table);
|
|
||||||
$rep->newPage();
|
|
||||||
}
|
|
||||||
|
|
||||||
$rep->heading($proj->school);
|
|
||||||
$rep->nextline();
|
|
||||||
$oldschool=$proj->school;
|
|
||||||
$table=array();
|
|
||||||
$table['header']=array(i18n("Proj Num"),i18n("Project Title"),i18n("Students"));
|
|
||||||
$table['widths']=array( 0.8, 3.75, 2.75);
|
|
||||||
$table['dataalign']=array("left","left","left");
|
|
||||||
$first=false;
|
|
||||||
}
|
|
||||||
|
|
||||||
$table['data'][]=array($proj->projectnumber,$proj->title,$students);
|
|
||||||
}
|
|
||||||
//we only add the table if there something to add, otherwise, the report must still be blank
|
|
||||||
if(is_array($table))
|
|
||||||
{
|
|
||||||
$rep->addTable($table);
|
|
||||||
unset($table);
|
|
||||||
}
|
|
||||||
|
|
||||||
$rep->output();
|
|
||||||
?>
|
|
Loading…
x
Reference in New Issue
Block a user