diff --git a/admin/reports.php b/admin/reports.php index 44aa615..867dd1e 100644 --- a/admin/reports.php +++ b/admin/reports.php @@ -54,9 +54,14 @@ echo ""; echo "Team View (PDF)   "; echo "
"; - echo i18n("Judging Project Assignments").": "; + echo i18n("Judging Teams Project Assignments").": "; echo "CSV   "; echo "PDF   "; + echo "
"; + echo i18n("Projects Judging Team Assignments").": "; + echo "CSV   "; + echo "PDF   "; + send_footer(); ?> diff --git a/admin/reports_judges_teams_projects.php b/admin/reports_judges_teams_projects.php index 2796ce0..930cd18 100644 --- a/admin/reports_judges_teams_projects.php +++ b/admin/reports_judges_teams_projects.php @@ -43,7 +43,7 @@ } else if($type=="csv") { - $rep=new lcsv(i18n("Judging Team Projecet Assignments")); + $rep=new lcsv(i18n("Judging Team Project Assignments")); } $teams=getJudgingTeams(); diff --git a/admin/reports_projects_judges_teams.php b/admin/reports_projects_judges_teams.php new file mode 100644 index 0000000..834388d --- /dev/null +++ b/admin/reports_projects_judges_teams.php @@ -0,0 +1,151 @@ + + 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. +*/ +?> +newPage(); + $rep->setFontSize(11); + } + else if($type=="csv") + { + $rep=new lcsv(i18n("Project Judging Team Assignments")); + } + + $teams=getJudgingTeams(); + + $q=mysql_query("SELECT DISTINCT(date) AS d FROM judges_timeslots WHERE year='".$config['FAIRYEAR']."'"); + if(mysql_num_rows($q)>1) + $show_date=true; + else + $show_date=false; + + + $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, + 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 registrations.status='complete' + ORDER BY + projects.projectnumber + "); + echo mysql_error(); + + while($proj=mysql_fetch_object($projq)) + { + $rep->heading("(".$proj->projectnumber.") ".$proj->title); + + $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++; + } + $rep->addText($students); + $rep->nextLine(); + + $table=array(); + $table['header']=array(i18n("Timeslot"),i18n("Judging Team")); + if($show_date) + $table['widths']=array( 2.0, 3.25); + else + $table['widths']=array( 1.5, 3.75); + + $table['dataalign']=array("center","left"); + +//FIXME: this is where i left off, this query is not modified yet to pull the timeslots for the PROJECT + + //get the timeslots that this project has assigned to been judged. + $q=mysql_query("SELECT + judges_timeslots.date, + judges_timeslots.starttime, + judges_timeslots.endtime, + judges_teams.name + FROM + judges_teams_timeslots_projects_link + LEFT JOIN judges_timeslots ON judges_teams_timeslots_projects_link.judges_timeslots_id=judges_timeslots.id + LEFT JOIN judges_teams ON judges_teams_timeslots_projects_link.judges_teams_id=judges_teams.id + WHERE + judges_teams_timeslots_projects_link.projects_id='$proj->id' + AND judges_teams_timeslots_projects_link.year='".$config['FAIRYEAR']."' + ORDER BY + date,starttime + "); + $numslots=mysql_num_rows($q); + + while($r=mysql_fetch_object($q)) + { + if($show_date) + $timeslot=$r->date." "; + else + $timeslot=""; + $timeslot.=substr($r->starttime,0,-3)." - ".substr($r->endtime,0,-3); + + $table['data'][]=array($timeslot, $r->name); + } + $rep->addTable($table); + $rep->newPage(); + unset($table); + } + + $rep->output(); +?>