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. */ ?> << ".i18n("Back to Judges Registration Summary")."
"; echo "
"; if($_POST['action']=="save") { //first delete all their old associations for this year.. mysql_query("DELETE FROM judges_expertise WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); if(!is_array($_POST['division'])) $_POST['division']=array(); if(!is_array($_POST['subdivision'])) $_POST['subdivision']=array(); foreach($_POST['division'] AS $key=>$val) { mysql_query("INSERT INTO judges_expertise (judges_id, projectdivisions_id, val, year) VALUES ('".$_SESSION['judges_id']."','$key','$val','".$config['FAIRYEAR']."')"); } foreach($_POST['subdivision'] AS $key=>$val) { mysql_query("INSERT INTO judges_expertise (judges_id, projectsubdivisions_id, val, year) VALUES ('".$_SESSION['judges_id']."','$key','$val','".$config['FAIRYEAR']."')"); } if($_POST['expertise_other']) { mysql_query("UPDATE judges SET expertise_other='".mysql_escape_string(stripslashes($_POST['expertise_other']))."' WHERE id='".$_SESSION['judges_id']."'"); } else { mysql_query("UPDATE judges SET expertise_other=NULL WHERE id='".$_SESSION['judges_id']."'"); } echo notice(i18n("Areas of Expertise successfully saved")); } $q=mysql_query("SELECT * FROM judges WHERE email='".$_SESSION['email']."' AND id='".$_SESSION['judges_id']."'"); $judgeinfo=mysql_fetch_object($q); updateJudgeCompleteStatus($judgeinfo); //output the current status $newstatus=expertiseStatus(); if($newstatus!="complete") { echo error(i18n("Areas of Expertise Information Incomplete")); } else { echo happy(i18n("Areas of Expertise Information Complete")); } echo "
\n"; echo "\n"; echo i18n("Please rank the following divisions according to the amount of knowledge you have of each subject. A '1' indicates very little knowledge, and a '5' indicates you are very knowledgeable of the subject"); echo "
"; echo "
"; echo i18n("Once you save, any division that you specified as 3 or more will offer sub-divisions for you to choose from."); echo "
"; echo "
"; $q=mysql_query("SELECT * FROM judges_expertise WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); while($r=mysql_fetch_object($q)) { if($r->projectdivisions_id) $expertise[$r->projectdivisions_id]=$r->val; else if($r->projectsubdivisions_id) $subexpertise[$r->projectsubdivisions_id]=$r->val; } echo "\n"; //query all of the categories $q=mysql_query("SELECT * FROM projectdivisions WHERE year='".$config['FAIRYEAR']."' ORDER BY division"); while($r=mysql_fetch_object($q)) { echo ""; echo ""; for($x=1;$x<=5;$x++) echo ""; echo ""; echo ""; echo ""; for($x=1;$x<=5;$x++) { if($expertise[$r->id]==$x) $sel="checked=\"checked\""; else $sel=""; echo ""; } echo ""; echo ""; //only show the sub-divisions if the 'main' division is scored >=3 if($expertise[$r->id]>=3) { $subq=mysql_query("SELECT * FROM projectsubdivisions WHERE projectdivisions_id='$r->id' AND year='".$config['FAIRYEAR']."' ORDER BY subdivision"); while($subr=mysql_fetch_object($subq)) { echo ""; echo ""; if($subexpertise[$subr->id]) $ch="checked=\"checked\""; else $ch=""; echo ""; echo ""; echo ""; } } echo ""; } echo "
".i18n("Novice")."".i18n("Expert")."
$x
".i18n($r->division)."id]\" value=\"$x\" />
 id]\" value=\"1\" />"; echo "$subr->subdivision"; echo "
 
"; echo "
"; echo "

".i18n("Other Areas of Expertise not listed above")."

"; $q=mysql_query("SELECT expertise_other FROM judges WHERE id='".$_SESSION['judges_id']."'"); $judgeinfo=mysql_fetch_object($q); echo ""; echo "
"; echo "
"; echo "\n"; echo "
"; echo "
"; echo "<< ".i18n("Back to Judges Registration Summary")."
"; send_footer(); ?>