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. */ ?> id'"); echo mysql_error(); while($cr=mysql_fetch_object($cq)) { if(!$userslist[$cr->users_id]) $userslist[$cr->users_id]=user_load($cr->users_id); } } } } else if($_POST['donortype']=="individual") { if(!$_POST['individual_type']) $individual_type=array("judge","teacher","sciencehead","principal","parent","mentor","committee","volunteer","students"); else $individual_type=$_POST['individual_type']; foreach($individual_type AS $t) { switch($t) { case "judge": case "volunteer": case "committee": $query="SELECT *,MAX(year) FROM users WHERE types LIKE '%$t%' GROUP BY uid HAVING deleted='no' ORDER BY lastname,firstname"; $q=mysql_query($query); echo mysql_error(); while($r=mysql_fetch_object($q)) { if(!$userslist[$r->uid]) $userslist[$r->uid]=user_load_by_uid($r->uid); } break; case "teacher": $q=mysql_query("SELECT DISTINCT(teacheremail) AS email, teachername AS name FROM students ORDER BY teachername"); while($r=mysql_fetch_assoc($q)) { $otherlist[]=$r; } break; case "sciencehead": $q=mysql_query("SELECT DISTINCT(scienceheademail) AS email, sciencehead AS name, scienceheadphone AS phone FROM schools WHERE year='{$config['FAIRYEAR']}' ORDER BY name"); while($r=mysql_fetch_assoc($q)) { $otherlist[]=$r; } break; case "principal": $q=mysql_query("SELECT DISTINCT(schoolemail) AS email, principal AS name FROM schools WHERE year='{$config['FAIRYEAR']}' ORDER BY name"); while($r=mysql_fetch_assoc($q)) { $otherlist[]=$r; } break; case "parent": //unfortunately, this doesnt exist anywhere in sfiab break; case "mentor": $q=mysql_query("SELECT DISTINCT(email) AS email, CONCAT(firstname, ' ', lastname) AS name, phone FROM mentors ORDER BY email"); echo mysql_error(); while($r=mysql_fetch_assoc($q)) { $otherlist[]=$r; } break; case "students": $q=mysql_query("SELECT DISTINCT(email) AS email, CONCAT(firstname, ' ', lastname) AS name, address, city, province, postalcode, phone FROM students ORDER BY email"); echo mysql_error(); while($r=mysql_fetch_assoc($q)) { $otherlist[]=$r; } break; } } } $usersnum=count($userslist); $othernum=count($otherlist); echo "$usersnum users results
"; echo "$othernum other results
"; //print_r($userslist); //print_r($otherlist); echo "

"; echo nl2br(print_r($_POST,true)); ?>