diff --git a/register_judges_specialawards.php b/register_judges_specialawards.php new file mode 100644 index 0000000..dbf41cd --- /dev/null +++ b/register_judges_specialawards.php @@ -0,0 +1,122 @@ + + 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_specialaward_sel WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); + + if(array_key_exists('spaward', $_POST)) { + foreach($_POST['spaward'] AS $aid) + { + mysql_query("INSERT INTO judges_specialaward_sel (judges_id, award_awards_id, year) + VALUES ('".$_SESSION['judges_id']."','$aid','{$config['FAIRYEAR']}')"); + } + } + echo notice(i18n("Special Award preferences 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=specialawardStatus(); +if($newstatus!="complete") +{ + echo error(i18n("Special Award Preferences Incomplete")); +} +else +{ + echo happy(i18n("Special Award Preferences Complete")); +} + + echo "
\n"; + echo "\n"; + if($judgeinfo->typepref == 'speconly') { + echo i18n("Please select the special award you are supposed to judge."); + } else { + echo i18n("Please select any special awards you would prefer to judge."); + echo i18n(" We assign judges to divisional awards first. So please note that by selecting awards here it does not guarantee that you will be judging special awards. This selects your special award judging preferences IF you are not assigned to a divisional judging team."); + } + echo "
"; + echo "
"; + + $q=mysql_query("SELECT * FROM judges_specialaward_sel WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); + $spawards = array(); + while($r=mysql_fetch_object($q)) + { + $spawards[] = $r->award_awards_id; + } + echo "\n"; + + + //query all of the awards + $q=mysql_query("SELECT award_awards.id, + award_awards.name, + award_awards.criteria + FROM + award_awards, + award_types + WHERE + award_types.id=award_awards.award_types_id + AND award_types.type='Special' + AND award_awards.year='{$config['FAIRYEAR']}' + AND award_types.year='{$config['FAIRYEAR']}' + ORDER BY + name"); + echo mysql_error(); + while($r=mysql_fetch_object($q)) + { + echo ""; + echo ""; +} + + echo "
"; + $ch = (in_array($r->id,$spawards)) ? "checked=\"checked\"" : ""; + echo "id}\" />"; + echo ""; + echo "{$r->name}"; + echo "
"; + echo "{$r->criteria}"; + echo "

"; + echo "
"; + echo "
"; + + echo "\n"; + echo "
"; + echo "
"; + echo "<< ".i18n("Back to Judges Registration Summary")."
"; + + + send_footer(); +?>