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. */ ?> 10) { $num=rand(0,100); if($num<80) $willing_chair="yes"; } else if($years_national+$years_regional+$years_regional>6) { //if more than 6 years combined experience, than there's a 40% chance they'll be a willing chair $num=rand(0,100); if($num<40) $willing_chair="yes"; } echo "Creating $firstname $lastname ($email) s=$years_school r=$years_regional n=$years_national wc=$willing_chair
\n"; //there's a 1 in 20 chance that this judge is not yet completed their info $compnum=rand(0,20); if($compnum==1) $complete="no"; else $complete="yes"; $q=mysql_query("INSERT INTO judges (firstname,lastname,email,years_school,years_regional,years_national,willing_chair,complete) VALUES ('$firstname','$lastname','$email','$years_school','$years_regional','$years_national','$willing_chair','$complete')"); $id=mysql_insert_id(); //for both these, the annealer expects -2 to 2 , but since expertise was done waaaaaay before as 1-5 we'll add it as 1-5 and the annealer will subtract 3 //to compensate //preference is ranked -2 to 2 for($a=1;$a<=3;$a++) { $catrank=rand(-2,2); mysql_query("INSERT INTO judges_catpref (judges_id,projectcategories_id,rank,year) VALUES ('$id','$a','$catrank','2007')"); } //expertise is ranked 1-5 for($a=1;$a<=6;$a++) { $divrank=rand(1,5); mysql_query("INSERT INTO judges_expertise (judges_id,projectdivisions_id,val,year) VALUES ('$id','$a','$divrank','2007')"); } //and add the record to the judges_years table so they will be 'active' for this year mysql_query("INSERT INTO judges_years (judges_id,year) VALUES ('$id','2007')"); //60% chance they only speak english //20% chance they only speak french //20% chance they are bilingual $num=rand(0,100); if($num<60) mysql_query("INSERT INTO judges_languages (judges_id,languages_lang) VALUES ('$id','en')"); else if($num<80) mysql_query("INSERT INTO judges_languages (judges_id,languages_lang) VALUES ('$id','fr')"); else { mysql_query("INSERT INTO judges_languages (judges_id,languages_lang) VALUES ('$id','en')"); mysql_query("INSERT INTO judges_languages (judges_id,languages_lang) VALUES ('$id','fr')"); } } ?>