From 3ad971cb60bb40ba073431390980548a07785b98 Mon Sep 17 00:00:00 2001 From: dave Date: Wed, 21 Jan 2009 09:08:00 +0000 Subject: [PATCH] - Remove the old judge registration pages --- admin/reports_judges.inc.php | 32 ++--- admin/reports_volunteers.inc.php | 1 + register_judges.inc.php | 147 -------------------- register_judges_expertise.php | 214 ------------------------------ register_judges_main.php | 189 -------------------------- register_judges_password.php | 111 ---------------- register_judges_personal.php | 181 ------------------------- register_judges_specialawards.php | 125 ----------------- 8 files changed, 17 insertions(+), 983 deletions(-) delete mode 100644 register_judges.inc.php delete mode 100644 register_judges_expertise.php delete mode 100644 register_judges_main.php delete mode 100644 register_judges_password.php delete mode 100644 register_judges_personal.php delete mode 100644 register_judges_specialawards.php diff --git a/admin/reports_judges.inc.php b/admin/reports_judges.inc.php index 5657e5f..4173a54 100644 --- a/admin/reports_judges.inc.php +++ b/admin/reports_judges.inc.php @@ -28,75 +28,75 @@ $report_judges_fields = array( 'name' => 'Judge -- Last Name', 'header' => 'Last Name', 'width' => 1.0, - 'table' => 'judges.lastname' ), + 'table' => 'users.lastname' ), 'first_name' => array( 'name' => 'Judge -- First Name', 'header' => 'First Name', 'width' => 1.0, - 'table' => 'judges.firstname' ), + 'table' => 'users.firstname' ), 'name' => array( 'name' => 'Judge -- Full Name (last, first)', 'header' => 'Name', 'width' => 1.75, - 'table' => "CONCAT(judges.lastname, ', ', judges.firstname)", - 'table_sort'=> 'judges.lastname' ), + 'table' => "CONCAT(users.lastname, ', ', users.firstname)", + 'table_sort'=> 'users.lastname' ), 'namefl' => array( 'name' => 'Judge -- Full Name (first last)', 'header' => 'Name', 'width' => 1.75, - 'table' => "CONCAT(judges.firstname, ' ', judges.lastname)", - 'table_sort'=> 'judges.lastname' ), + 'table' => "CONCAT(users.firstname, ' ', users.lastname)", + 'table_sort'=> 'users.lastname' ), 'email' => array( 'name' => 'Judge -- Email', 'header' => 'Email', 'width' => 2.0, - 'table' => 'judges.email'), + 'table' => 'users.email'), 'address' => array( 'name' => 'Judge -- Address Street', 'header' => 'Address', 'width' => 2.0, - 'table' => "CONCAT(judges.address, ' ', judges.address2)"), + 'table' => "CONCAT(users.address, ' ', users.address2)"), 'city' => array( 'name' => 'Judge -- Address City', 'header' => 'City', 'width' => 1.5, - 'table' => 'judges.city' ), + 'table' => 'users.city' ), 'province' => array( 'name' => 'Judge -- Address '.$config['provincestate'], 'header' => $config['provincestate'], 'width' => 0.75, - 'table' => 'judges.province' ), + 'table' => 'users.province' ), 'postal' => array( 'name' => 'Judge -- Address '.$config['postalzip'], 'header' => $config['postalzip'], 'width' => 0.75, - 'table' => 'judges.postalcode' ), + 'table' => 'users.postalcode' ), 'phone_home' => array( 'name' => 'Judge -- Phone (Home)', 'header' => 'Phone(Home)', 'width' => 1, - 'table' => 'judges.phonehome'), + 'table' => 'users.phonehome'), 'phone_work' => array( 'name' => 'Judge -- Phone (Work)', 'header' => 'Phone(Work)', 'width' => 1.25, - 'table' => "CONCAT(judges.phonework, ' ', judges.phoneworkext)"), + 'table' => "users.phonework"), 'organization' => array( 'name' => 'Judge -- Organization', 'header' => 'Organization', 'width' => 2, - 'table' => 'judges.organization'), + 'table' => 'users.organization'), 'languages' => array( 'name' => 'Judge -- Languages (REQUIRES MySQL 5.0)', @@ -117,7 +117,7 @@ $report_judges_fields = array( 'name' => 'Judge -- Year', 'header' => 'Year', 'width' => 0.5, - 'table' => 'judges_years.year'), + 'table' => 'users.year'), 'captain' => array( 'name' => 'Judge Team -- Captain?', @@ -264,7 +264,7 @@ $report_judges_fields = array( } } - $q = " FROM judges + $q = " FROM users LEFT JOIN judges_years ON judges_years.judges_id = judges.id $languages_from $teams_from diff --git a/admin/reports_volunteers.inc.php b/admin/reports_volunteers.inc.php index 3162d81..4789714 100644 --- a/admin/reports_volunteers.inc.php +++ b/admin/reports_volunteers.inc.php @@ -149,4 +149,5 @@ $report_volunteers_fields = array( return $q; } + ?> diff --git a/register_judges.inc.php b/register_judges.inc.php deleted file mode 100644 index 3607d72..0000000 --- a/register_judges.inc.php +++ /dev/null @@ -1,147 +0,0 @@ - - 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. -*/ -?> -"Very Low", - -1=>"Low", - 0=>"Indifferent", - 1=>"Medium", - 2=>"High" -); - - - -function personalStatus() -{ - global $config; - - //and they also have to select at least one language to judge in - $q=mysql_query("SELECT COUNT(judges_id) AS num FROM judges_languages WHERE judges_id='".$_SESSION['judges_id']."'"); - $r=mysql_fetch_object($q); - if($r->num==0) - return "incomplete"; - - - //if it made it through without returning incomplete, then we must be complete - return "complete"; -} - -function judge_status_expertise($u) -{ - global $config; - - /* If the judging special awards are active, and the judge has - * selected "I am a special awards judge", then disable - * expertise checking */ - if($config['judges_specialaward_only_enable'] == 'yes') { - if($u['special_award_only'] == 'yes') - return 'complete'; - } - - /* Check to see if they have ranked all project age categories, and all divisions */ - $q=mysql_query("SELECT COUNT(id) AS num FROM projectcategories WHERE year='".$config['FAIRYEAR']."'"); - $r=mysql_fetch_object($q); - $numcats=$r->num; - - if($numcats != count($u['catprefs'])) { - return "incomplete"; - } - - $q=mysql_query("SELECT COUNT(id) AS num FROM projectdivisions WHERE year='".$config['FAIRYEAR']."'"); - $r=mysql_fetch_object($q); - $numdivisions=$r->num; - - if($numdivisions != count($u['divprefs'])) { - return "incomplete"; - } - - return "complete"; -} - -function specialawardStatus() -{ - global $config; - - /* Complete if: - * - judge has selected (none) "no special award preferences" - * - judge has selected (pref) "i would like to specify awards", and has - * selected between min and max preferences - * - judge has selected "i am a special awards judge, and has - * selected an award */ - - $q = mysql_query("SELECT typepref FROM judges WHERE - id='{$_SESSION['judges_id']}'"); - if(mysql_num_rows($q) != 1) return "incomplete"; - $r = mysql_fetch_object($q); - - $qq = mysql_query("SELECT COUNT(id) AS num FROM judges_specialaward_sel - WHERE judges_id='{$_SESSION['judges_id']}' - AND year={$config['FAIRYEAR']}"); - $rr = mysql_fetch_object($qq); - $awards_selected = $rr->num; - - switch($r->typepref) { - case "speconly": /* Judge for special award */ - /* They may judge more than one award, so don't limit them - * to one */ - if($awards_selected >= 1) return "complete"; - break; - - case "pref": /* Special award preferences specified */ - default: - if( ($awards_selected >= $config['judges_specialaward_min']) - &&($awards_selected <= $config['judges_specialaward_max']) ){ - return "complete"; - } - break; - } - - return "incomplete"; -} - -//ji = judgeinfo record from database (select * from judges where id='whatever') -function updateJudgeCompleteStatus($ji) -{ - if( personalStatus()=="complete" && - expertiseStatus()=="complete" - ) - $complete="yes"; - else - $complete="no"; - - if($complete!=$ji->complete) - { - mysql_query("UPDATE judges SET complete='$complete' WHERE id='".$ji->id."'"); - } -} - -//finally, if everything else is good, update their 'overall status' if it needs to be -//updateJudgeCompleteStatus($judgeinfo); - -?> diff --git a/register_judges_expertise.php b/register_judges_expertise.php deleted file mode 100644 index d992421..0000000 --- a/register_judges_expertise.php +++ /dev/null @@ -1,214 +0,0 @@ - - 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']."'"); - } - - mysql_query("DELETE FROM judges_catpref WHERE judges_id='".$_SESSION['judges_id']."'"); - - if(is_array($_POST['catpref'])) - { - foreach($_POST['catpref'] AS $k=>$v) - { - if($v!="") - mysql_query("INSERT INTO judges_catpref (judges_id,projectcategories_id,rank,year) values ('".$_SESSION['judges_id']."','$k','$v','".$config['FAIRYEAR']."')"); - } - } - - echo notice(i18n("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=expertiseStatus(); -if($newstatus!="complete") -{ - echo error(i18n("Divisional Judging Information Incomplete")); -} -else -{ - echo happy(i18n("Divisional Judging Information Complete")); -} - - if($judgeinfo->typepref == "speconly") { - echo i18n("You have specified that you are a judge for a specific special award. Divisional Judging preferences have been disabled because they do not apply to you."); - echo "
"; - send_footer(); - exit; - } - - echo "
\n"; - echo "\n"; - - $q=mysql_query("SELECT * FROM judges_catpref WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); - $catprefs=array(); - while($r=mysql_fetch_object($q)) - $catprefs[$r->projectcategories_id]=$r->rank; - - $q=mysql_query("SELECT * FROM projectcategories WHERE year='".$config['FAIRYEAR']."' ORDER BY mingrade"); - echo "

".i18n("Age Category Preferences")."


"; - echo ""; - while($r=mysql_fetch_object($q)) - { - echo ""; - echo ""; - echo ""; - } - echo "
    "; - echo i18n("%1 (Grades %2-%3)",array(i18n($r->category),$r->mingrade,$r->maxgrade)); - echo ""; - echo "".REQUIREDFIELD; - - echo "
"; - echo "
"; - echo "
"; - echo "

".i18n("Division Expertise")."


"; - echo ""; - - - - 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 might 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(); -?> diff --git a/register_judges_main.php b/register_judges_main.php deleted file mode 100644 index c9562df..0000000 --- a/register_judges_main.php +++ /dev/null @@ -1,189 +0,0 @@ - - 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. -*/ -?> -firstname) - { - echo i18n("Hello %1",array($judgeinfo->firstname)); - echo "
"; - } - echo "
"; - - //first, we need to see if they havec the current FAIRYEAR activated, if not, we'll keep their acocunt 'dormant' and it wont - //be used for anything, but will still be available for them to login in the following years. - - $q=mysql_query("SELECT * FROM judges_years WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'"); - if(!mysql_num_rows($q)) - { - echo i18n("If you would like to participate as a judge for the %1 %2 please click the 'Activate %3 Judge Profile' button below to activate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname'],$config['FAIRYEAR'])); - echo "
"; - echo "
"; - echo i18n("If you can not judge this year, but would like to remain on our mailing list for future years, no action is necessary"); - echo "
"; - echo "
"; - echo i18n("If you would like to be completely removed from our judges mailing list, please click the 'Delete Judge Account' button below"); - echo "
"; - echo "
"; - echo "
"; - echo "\n"; - echo ""; - echo "
"; - - } - else - { - $overallstatus="complete"; - - echo i18n("Please use the checklist below to complete your registration. Click on an item in the table to edit that information. When you have entered all information, the Status field will change to Complete"); - echo "
"; - echo "
"; - - echo ""; - echo ""; - - //judges personal information - echo ""; - - /* - //organization information - echo ""; - */ - - //area of expertise - echo ""; - - // special awards - if($config['judges_specialaward_enable'] == 'yes' || $judgeinfo->typepref == 'speconly') { - echo ""; - } - - - echo ""; - echo ""; - - echo "
".i18n("Registration Item")."".i18n("Status")."
"; - echo ""; - echo i18n("Personal Information"); - echo ""; - echo ""; - //check to see if its complete - $statuspersonal=personalStatus(); - echo outputStatus($statuspersonal); - if($statuspersonal!="complete") $overallstatus="incomplete"; - echo "
"; - echo ""; - echo i18n("Organization Information"); - echo ""; - echo ""; - //check to see if its complete - $statusorganization=organizationStatus(); - echo outputStatus($statusorganization); - echo "
"; - echo ""; - echo i18n("Areas of Expertise"); - echo ""; - echo ""; - //check to see if its complete - $statusexpertise=expertiseStatus(); - echo outputStatus($statusexpertise); - if($statusexpertise!="complete") $overallstatus="incomplete"; - echo "
"; - echo ""; - echo i18n("Special Award Preferences"); - echo ""; - echo ""; - //check to see if its complete - $statusspecialawards=specialawardStatus(); - echo outputStatus($statusspecialawards); - if($statusspecialawards!="complete") $overallstatus="incomplete"; - echo "

".i18n("Overall Status").""; - echo outputStatus($overallstatus); - echo "
"; - echo "
"; - echo "
"; - - if($overallstatus!="complete") - { - echo error(i18n("You will not be marked as an active judge until your \"Overall Status\" is \"Complete\"")); - } - else - { - echo happy(i18n("Thank you for completing the judge registration process. We look forward to seeing you at the fair")); - } - echo "
"; - - - echo i18n("If you are unable to participate as a judge in the %1 %2 please click the deactivate button below to deactivate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname'])); - echo "
"; - echo "
"; - echo "
"; - echo "\n"; - echo ""; - echo "
"; - -} - -echo "
"; -echo "
"; -echo "\n"; -echo ""; -echo "
"; - - -echo "
"; -echo "".i18n("Change Password").""; -echo "
"; -echo "".i18n("Logout").""; - - - send_footer(); -?> diff --git a/register_judges_password.php b/register_judges_password.php deleted file mode 100644 index 8fef317..0000000 --- a/register_judges_password.php +++ /dev/null @@ -1,111 +0,0 @@ - - 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, lets see if they choosed the same password again (bad bad bad) - $q=mysql_query("SELECT password FROM judges WHERE id='".$_SESSION['judges_id']."' AND email='".$_SESSION['email']."' AND password='".$_POST['pass1']."'"); - if(mysql_num_rows($q)) - { - echo error(i18n("You cannot choose the same password again. Please choose a different password")); - } - //now make sure their password is good - else if(!$_POST['pass1']) - { - echo error(i18n("New Password is required")); - } - else if(!$_POST['pass2']) - { - echo error(i18n("Confirm New Password is required")); - } - else if($_POST['pass1'] != $_POST['pass2']) - { - echo error(i18n("Passwords do not match")); - } - else - { - if($config['judges_password_expiry_days']>0) - $ex="passwordexpiry=DATE_ADD(CURDATE(),INTERVAL ".$config['judges_password_expiry_days']." DAY)"; - else - $ex="passwordexpiry=NULL"; - - mysql_query("UPDATE judges SET password='".$_POST['pass1']."', $ex WHERE id='".$_SESSION['judges_id']."' AND email='".$_SESSION['email']."'"); - echo happy(i18n("Password successfully changed")); - if($_SESSION['judges_password_expired']) - { - unset($_SESSION['judges_password_expired']); - echo "<< ".i18n("Back to Judges Registration Summary")."
"; - echo "
"; - send_footer(); - exit; - } - } - } - else - { - if($_SESSION['judges_password_expired']) - echo error(i18n("Your password has expired. You must choose a new password now")); - - } - echo "
\n"; - echo "\n"; - - echo "
"; - echo ""; - echo ""; - echo ""; - echo "
"; - echo i18n("Enter New Password:"); - echo ""; - echo ""; - echo "
"; - echo i18n("Confirm New Password:"); - echo ""; - echo ""; - echo "
"; - - -echo "\n"; -echo "
"; - -if(!$_SESSION['judges_password_expired']) -{ - echo "
"; - echo "<< ".i18n("Back to Judges Registration Summary")."
"; -} - -send_footer(); -?> diff --git a/register_judges_personal.php b/register_judges_personal.php deleted file mode 100644 index e565ee6..0000000 --- a/register_judges_personal.php +++ /dev/null @@ -1,181 +0,0 @@ - - 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") - { - mysql_query("UPDATE judges SET ". - "firstname='".mysql_escape_string(stripslashes($_POST['firstname']))."', ". - "lastname='".mysql_escape_string(stripslashes($_POST['lastname']))."', ". - "email='".mysql_escape_string(stripslashes($_POST['email']))."', ". - "address='".mysql_escape_string(stripslashes($_POST['address']))."', ". - "address2='".mysql_escape_string(stripslashes($_POST['address2']))."', ". - "city='".mysql_escape_string(stripslashes($_POST['city']))."', ". - "province='".mysql_escape_string(stripslashes($_POST['province']))."', ". - "postalcode='".mysql_escape_string(stripslashes($_POST['postalcode']))."', ". - "phonehome='".mysql_escape_string(stripslashes($_POST['phonehome']))."', ". - "phonework='".mysql_escape_string(stripslashes($_POST['phonework']))."', ". - "phoneworkext='".mysql_escape_string(stripslashes($_POST['phoneworkext']))."', ". - "phonecell='".mysql_escape_string(stripslashes($_POST['phonecell']))."', ". - "organization='".mysql_escape_string(stripslashes($_POST['organization']))."', ". - "highest_psd='".mysql_escape_string(stripslashes($_POST['highest_psd']))."', ". - "professional_quals='".mysql_escape_string(stripslashes($_POST['professional_quals']))."', ". - "typepref='".mysql_escape_string(stripslashes($_POST['typepref']))."' ". - "WHERE id='".$_SESSION['judges_id']."'"); - echo mysql_error(); - - //first we clear out their old languages - mysql_query("DELETE FROM judges_languages WHERE judges_id='".$_SESSION['judges_id']."'"); - if(count($_POST['languages'])) - { - //and now we add back any selected languages - foreach($_POST['languages'] AS $l) - { - mysql_query("INSERT INTO judges_languages (judges_id,languages_lang) VALUES ('".$_SESSION['judges_id']."','$l')"); - } - - } - /* Parse the ansers to the questions, and save them */ - $ans = questions_parse_from_http_headers('questions'); - questions_save_answers('judgereg', $_SESSION['judges_id'], - $config['FAIRYEAR'], $ans); - - echo notice(i18n("%1 %2 successfully updated",array($_POST['firstname'],$_POST['lastname']))); - } - $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=personalStatus(); -if($newstatus!="complete") -{ - echo error(i18n("Personal Information Incomplete")); -} -else -{ - echo happy(i18n("Personal Information Complete")); -} - - echo "
\n"; - echo "\n"; - echo "\n"; - -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; -echo "\n"; -echo " \n"; -echo " \n"; -echo "\n"; - -echo "\n"; -echo " \n"; -echo " \n"; -echo ""; - -echo "\n"; -echo " \n"; -echo " \n"; -echo ""; - - -if($config['judges_specialaward_only_enable'] == 'yes') { - echo ""; - echo "\n"; - echo " "; - if($judgeinfo->typepref == "speconly") $ch = "checked=checked"; - else $ch=""; - echo " "; - echo "\n"; -} - -echo ""; - -echo "\n"; -echo " "; -echo " \n"; -echo "\n"; - -echo "\n"; -echo " "; -echo " \n"; -echo "\n"; - -echo "\n"; -echo " "; -echo " \n"; -echo "\n"; - -questions_print_answer_editor('judgereg', - $_SESSION['judges_id'], $config['FAIRYEAR'], 'questions'); - -echo "
".i18n("First Name")."firstname\" />".REQUIREDFIELD."".i18n("Last Name")."lastname\" />".REQUIREDFIELD."
".i18n("Email Address")."email\" />".REQUIREDFIELD."".i18n("City")."city\" />".REQUIREDFIELD."
".i18n("Address 1")."address\" />".REQUIREDFIELD."".i18n($config['provincestate']).""; -emit_province_selector("province",$judgeinfo->province,"onchange=\"fieldChanged()\""); -echo REQUIREDFIELD."
".i18n("Address 2")."address2\" />".i18n("Phone (Home)")."phonehome\" />".REQUIREDFIELD."
".i18n($config['postalzip'])."postalcode\" />".REQUIREDFIELD."".i18n("Phone (Work)")."phonework\" /> extphoneworkext\" />
".i18n("Organization")."organization\" />".i18n("Phone (Cell)")."phonecell\" />

".i18n("I am a judge for a specific special award")."
(".i18n("Check this box if you are supposed to judge a specific special award, and please select that award on the Special Award Preferences page.").")
"; - echo "

".i18n("Highest post-secondary degree")."highest_psd\" />
".i18n("Other professional qualifications")."professional_quals\" />
".i18n("I can judge in the following languages")." ".REQUIREDFIELD.""; - -//grab the current languages that are selected -$currentlanguages=array(); -$q=mysql_query("SELECT languages_lang FROM judges_languages WHERE judges_id='".$_SESSION['judges_id']."'"); -while($r=mysql_fetch_object($q)) -{ - $currentlanguages[]=$r->languages_lang; -} - -$q=mysql_query("SELECT * FROM languages WHERE active='Y' ORDER BY langname"); -while($r=mysql_fetch_object($q)) -{ - if(in_array($r->lang,$currentlanguages)) $ch="checked=\"checked\""; else $ch=""; - - echo "lang\" /> $r->langname
"; -} - -echo "
"; -echo "\n"; -echo "
"; - - echo "
"; - echo "<< ".i18n("Back to Judges Registration Summary")."
"; - -send_footer(); -?> diff --git a/register_judges_specialawards.php b/register_judges_specialawards.php deleted file mode 100644 index cac8846..0000000 --- a/register_judges_specialawards.php +++ /dev/null @@ -1,125 +0,0 @@ - - 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 "  "; - 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, - award_sponsors.organization - FROM - award_awards, - award_types, - award_sponsors - WHERE - award_types.id=award_awards.award_types_id - AND award_sponsors.id=award_awards.award_sponsors_id - AND (award_types.type='Special' OR award_types.type='Other') - 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} ($r->organization)"; - echo "
"; - echo "{$r->criteria}"; - echo "

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