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("Participant Tour Selections")); } $table=array(); $table['header']=array( i18n("Student ID")); $choicesh=array(); $max = $config['tours_choices_max']; for($x=0; $x<$max; $x++) { $choicesh[] = i18n("Choice ".($x+1).($x==0?"(most preferred)":"")); } $table['header']=array_merge($table['header'],$choicesh); $table['header'][] = "Name"; $table['header'][] = "Grade"; $table['header'][] = "Email"; $q=mysql_query("SELECT DISTINCT students_id FROM tours_choice WHERE year='".$config['FAIRYEAR']."'"); while($r=mysql_fetch_object($q)) { // print_r($judge_divs); // print_r($judge_subdivs); $qq = mysql_query("SELECT * FROM tours_choice WHERE ". " year='".$config['FAIRYEAR']."' AND ". " students_id='".$r->students_id."' ". " ORDER BY rank "); $c = array(); /* Define an array for tour choices */ for($x=0;$x<$max;$x++) { $c[$x] = ''; } /* Load up to $max tour choices */ $x = 0; while($rr = mysql_fetch_object($qq)) { $c[$x] = $rr->tour_id; $x++; if($x == $max) break; } $qq = mysql_query("SELECT * FROM students WHERE ". " year='".$config['FAIRYEAR']."' AND ". " id='".$r->students_id."' " ); $rr = mysql_fetch_object($qq); $name = $rr->firstname." ".$rr->lastname; $grade = $rr->grade; $email = $rr->email; $tmp=array( $r->students_id, ); $tmp = array_merge($tmp,$c); $tmp[] = $name; $tmp[] = $grade; $tmp[] = $email; // print_r($tmp); $table['data'][]=$tmp; } $rep->addTable($table); $rep->output(); ?>