- Remove the old judge registration pages

This commit is contained in:
dave 2009-01-21 09:08:00 +00:00
parent 7610908a17
commit 3ad971cb60
8 changed files with 17 additions and 983 deletions

View File

@ -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

View File

@ -149,4 +149,5 @@ $report_volunteers_fields = array(
return $q;
}
?>

View File

@ -1,147 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
echo "register_judges.inc.php included, use judge.inc.php instead.";
exit;
$preferencechoices=array(
-2=>"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);
?>

View File

@ -1,214 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("common.inc.php");
include "register_judges.inc.php";
//send the header
send_header("Judges Registration - Divisional Judging Preferences");
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
echo "<br />";
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 "<br />";
send_footer();
exit;
}
echo "<form name=\"expertiseform\" method=\"post\" action=\"register_judges_expertise.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\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 "<h3>".i18n("Age Category Preferences")."</h3><br>";
echo "<table>";
while($r=mysql_fetch_object($q))
{
echo "<tr><td>&nbsp;&nbsp;&nbsp;&nbsp;";
echo i18n("%1 (Grades %2-%3)",array(i18n($r->category),$r->mingrade,$r->maxgrade));
echo "</td>";
echo "<td>";
echo "<select name=\"catpref[$r->id]\">";
echo "<option value=\"\">".i18n("Choose")."</option>\n";
foreach($preferencechoices AS $val=>$str)
{
if($catprefs[$r->id]==$val && $catprefs[$r->id]!="") $sel="selected=\"selected\""; else $sel="";
echo "<option $sel value=\"$val\">".i18n($str)."</option>\n";
}
echo "</select>".REQUIREDFIELD;
echo "</td>";
echo "</tr>";
}
echo "</table>";
echo "<br />";
echo "<br />";
echo "<h3>".i18n("Division Expertise")."</h3><br>";
echo "<table>";
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 "<br />";
echo "<br />";
echo i18n("Once you save, any division that you specified as 3 or more might offer sub-divisions for you to choose from.");
echo "<br />";
echo "<br />";
$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 "<table>\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 "<tr><td></td><td colspan=\"2\">".i18n("Novice")."</td><td colspan=\"3\" align=\"right\">".i18n("Expert")."</td></tr>";
echo "<tr><th></th>";
for($x=1;$x<=5;$x++)
echo "<th>$x</th>";
echo "<th></th>";
echo "</tr>";
echo "<tr><td><b>".i18n($r->division)."</b></td>";
for($x=1;$x<=5;$x++)
{
if($expertise[$r->id]==$x) $sel="checked=\"checked\""; else $sel="";
echo "<td width=\"30\"><input onclick=\"fieldChanged()\" $sel type=\"radio\" name=\"division[$r->id]\" value=\"$x\" /></td>";
}
echo "<td width=\"100\"></td>";
echo "</tr>";
//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 "<tr>";
echo "<td>&nbsp;</td>";
if($subexpertise[$subr->id]) $ch="checked=\"checked\""; else $ch="";
echo "<td><input onclick=\"fieldChanged()\" $ch type=\"checkbox\" name=\"subdivision[$subr->id]\" value=\"1\" /></td>";
echo "<td colspan=\"5\">";
echo "$subr->subdivision";
echo "</td>";
echo "</tr>";
}
}
echo "<tr><td colspan=\"7\">&nbsp;</td></tr>";
}
echo "</table>";
echo "<br />";
echo "<h3>".i18n("Other Areas of Expertise not listed above")."</h3>";
$q=mysql_query("SELECT expertise_other FROM judges WHERE id='".$_SESSION['judges_id']."'");
$judgeinfo=mysql_fetch_object($q);
echo "<textarea name=\"expertise_other\" rows=\"4\" cols=\"60\">".htmlspecialchars($judgeinfo->expertise_other)."</textarea>";
echo "<br />";
echo "<br />";
echo "<input type=\"submit\" value=\"".i18n("Save Judging Preferences")."\" />\n";
echo "</form>";
echo "<br />";
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
send_footer();
?>

View File

@ -1,189 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("common.inc.php");
include "register_judges.inc.php";
send_header("Judges Registration");
if($_GET['action']=="activate")
{
mysql_query("INSERT INTO judges_years (judges_id,year) VALUES ('".$_SESSION['judges_id']."','".$config['FAIRYEAR']."')");
echo happy(i18n("Judge profile for %1 successfully activated",array($config['FAIRYEAR'])));
}
if($_GET['action']=="deactivate")
{
mysql_query("DELETE FROM judges_years WHERE judges_id='".$_SESSION['judges_id']."' AND year='".$config['FAIRYEAR']."'");
echo happy(i18n("Judge profile for %1 successfully deactivated",array($config['FAIRYEAR'])));
}
if($_GET['action']=="delete")
{
//okay here we go, lets get rid of them completely, since this is what theyve asked for
echo happy(i18n("Judge account successfully deleted. Goodbye!",array($config['FAIRYEAR'])));
mysql_query("UPDATE judges SET deleted='yes', deleteddatetime=NOW() WHERE id='".$_SESSION['judges_id']."'");
unset($_SESSION['judges_id']);
unset($_SESSION['email']);
send_footer();
exit;
}
//only display the named greeting if we have their name
if($judgeinfo->firstname)
{
echo i18n("Hello <b>%1</b>",array($judgeinfo->firstname));
echo "<br />";
}
echo "<br />";
//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 '<b>Activate %3 Judge Profile</b>' button below to activate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname'],$config['FAIRYEAR']));
echo "<br />";
echo "<br />";
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 "<br />";
echo "<br />";
echo i18n("If you would like to be completely removed from our judges mailing list, please click the '<b>Delete Judge Account</b>' button below");
echo "<br />";
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"activate\">\n";
echo "<input style=\"width: 300px;\" type=\"submit\" value=\"".i18n("Activate %1 Judge Profile",array($config['FAIRYEAR']))."\">";
echo "</form>";
}
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 <b>Status</b> field will change to <b>Complete</b>");
echo "<br />";
echo "<br />";
echo "<table class=\"summarytable\">";
echo "<tr><th>".i18n("Registration Item")."</th><th>".i18n("Status")."</th></tr>";
//judges personal information
echo "<tr><td>";
echo "<a href=\"register_judges_personal.php\">";
echo i18n("Personal Information");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statuspersonal=personalStatus();
echo outputStatus($statuspersonal);
if($statuspersonal!="complete") $overallstatus="incomplete";
echo "</td></tr>";
/*
//organization information
echo "<tr><td>";
echo "<a href=\"register_judges_organization.php\">";
echo i18n("Organization Information");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusorganization=organizationStatus();
echo outputStatus($statusorganization);
echo "</td></tr>";
*/
//area of expertise
echo "<tr><td>";
echo "<a href=\"register_judges_expertise.php\">";
echo i18n("Areas of Expertise");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusexpertise=expertiseStatus();
echo outputStatus($statusexpertise);
if($statusexpertise!="complete") $overallstatus="incomplete";
echo "</td></tr>";
// special awards
if($config['judges_specialaward_enable'] == 'yes' || $judgeinfo->typepref == 'speconly') {
echo "<tr><td>";
echo "<a href=\"register_judges_specialawards.php\">";
echo i18n("Special Award Preferences");
echo "</a>";
echo "</td><td>";
//check to see if its complete
$statusspecialawards=specialawardStatus();
echo outputStatus($statusspecialawards);
if($statusspecialawards!="complete") $overallstatus="incomplete";
echo "</td></tr>";
}
echo "<tr><td colspan=\"2\"><hr></td></tr>";
echo "<tr><td>".i18n("Overall Status")."</td><td>";
echo outputStatus($overallstatus);
echo "</td></tr>";
echo "</table>";
echo "<br />";
echo "<br />";
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 "<br />";
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 "<br />";
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"deactivate\">\n";
echo "<input style=\"width: 300px;\" onclick=\"return confirmClick('".i18n("Are you sure you want to deactivate your judges profile for %1?",array($config['FAIRYEAR']))."')\" type=\"submit\" value=\"".i18n("Deactivate %1 Judge Profile",array($config['FAIRYEAR']))."\">";
echo "</form>";
}
echo "<br />";
echo "<form method=\"get\" action=\"".$_SERVER['PHP_SELF']."\">";
echo "<input type=\"hidden\" name=\"action\" value=\"delete\">\n";
echo "<input style=\"width: 300px;\" onclick=\"return confirmClick('".i18n("Are you sure you want to completely delete your judges account? \\n Doing so will remove you from our mailing list for future years and you will never hear from us again")."')\" type=\"submit\" value=\"".i18n("Delete Judge Account")."\">";
echo "</form>";
echo "<br />";
echo "<a href=\"register_judges_password.php\">".i18n("Change Password")."</a>";
echo "<br />";
echo "<a href=\"register_judges.php?action=logout\">".i18n("Logout")."</a>";
send_footer();
?>

View File

@ -1,111 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("common.inc.php");
include "register_judges.inc.php";
//send the header
send_header("Judges Registration - Change Password");
if(!$_SESSION['judges_password_expired'])
{
echo "<a href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
echo "<br />";
}
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 "<a href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
echo "<br />";
send_footer();
exit;
}
}
}
else
{
if($_SESSION['judges_password_expired'])
echo error(i18n("Your password has expired. You must choose a new password now"));
}
echo "<form name=\"changepassform\" method=\"post\" action=\"register_judges_password.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\" />\n";
echo "<br />";
echo "<table>";
echo "<tr><td>";
echo i18n("Enter New Password:");
echo "</td><td>";
echo "<input type=\"password\" size=\"10\" name=\"pass1\">";
echo "</td></tr>";
echo "<tr><td>";
echo i18n("Confirm New Password:");
echo "</td><td>";
echo "<input type=\"password\" size=\"10\" name=\"pass2\">";
echo "</td></tr>";
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Change Password")."\" />\n";
echo "</form>";
if(!$_SESSION['judges_password_expired'])
{
echo "<br />";
echo "<a href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
}
send_footer();
?>

View File

@ -1,181 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("common.inc.php");
require("questions.inc.php");
include "register_judges.inc.php";
//send the header
send_header("Judges Registration - Personal Information");
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
echo "<br />";
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 "<form name=\"personalform\" method=\"post\" action=\"register_judges_personal.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\" />\n";
echo "<table>\n";
echo "<tr>\n";
echo " <td>".i18n("First Name")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"firstname\" value=\"$judgeinfo->firstname\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Last Name")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"lastname\" value=\"$judgeinfo->lastname\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Email Address")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"email\" value=\"$judgeinfo->email\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("City")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"city\" value=\"$judgeinfo->city\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Address 1")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"address\" value=\"$judgeinfo->address\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n($config['provincestate'])."</td><td>";
emit_province_selector("province",$judgeinfo->province,"onchange=\"fieldChanged()\"");
echo REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n("Address 2")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"address2\" value=\"$judgeinfo->address2\" /></td>\n";
echo " <td>".i18n("Phone (Home)")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"phonehome\" value=\"$judgeinfo->phonehome\" />".REQUIREDFIELD."</td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td>".i18n($config['postalzip'])."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"postalcode\" value=\"$judgeinfo->postalcode\" />".REQUIREDFIELD."</td>\n";
echo " <td>".i18n("Phone (Work)")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"phonework\" value=\"$judgeinfo->phonework\" />&nbsp;ext<input size=\"5\" onchange=\"fieldChanged()\" type=\"text\" name=\"phoneworkext\" value=\"$judgeinfo->phoneworkext\" /></td>\n";
echo "</tr>";
echo "<tr>\n";
echo " <td>".i18n("Organization")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"organization\" value=\"$judgeinfo->organization\" /></td>\n";
echo " <td>".i18n("Phone (Cell)")."</td><td><input onchange=\"fieldChanged()\" type=\"text\" name=\"phonecell\" value=\"$judgeinfo->phonecell\" /></td>\n";
echo "</tr>";
if($config['judges_specialaward_only_enable'] == 'yes') {
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
echo "<tr>\n";
echo " <td colspan=\"2\">".i18n("I am a judge for a specific special award")."<br /><font size=-1>(".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.").")</font></td>";
if($judgeinfo->typepref == "speconly") $ch = "checked=checked";
else $ch="";
echo " <td colspan=\"2\"><input $ch type=\"checkbox\" name=\"typepref\" value=\"speconly\" />";
echo " </td>";
echo "</tr>\n";
}
echo "<tr><td colspan=\"4\"><hr /></td></tr>";
echo "<tr>\n";
echo " <td colspan=\"2\">".i18n("Highest post-secondary degree")."</td>";
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"highest_psd\" size=\"35\" value=\"$judgeinfo->highest_psd\" /></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td colspan=\"2\">".i18n("Other professional qualifications")."</td>";
echo " <td colspan=\"2\"><input onchange=\"fieldChanged()\" type=\"text\" name=\"professional_quals\" size=\"35\" value=\"$judgeinfo->professional_quals\" /></td>\n";
echo "</tr>\n";
echo "<tr>\n";
echo " <td colspan=\"2\">".i18n("I can judge in the following languages")." ".REQUIREDFIELD."</td>";
echo " <td colspan=\"2\">";
//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 "<input onclick=\"fieldChanged()\" $ch type=\"checkbox\" name=\"languages[]\" value=\"$r->lang\" /> $r->langname <br />";
}
echo " </td>\n";
echo "</tr>\n";
questions_print_answer_editor('judgereg',
$_SESSION['judges_id'], $config['FAIRYEAR'], 'questions');
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Save Personal Information")."\" />\n";
echo "</form>";
echo "<br />";
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
send_footer();
?>

View File

@ -1,125 +0,0 @@
<?
/*
This file is part of the 'Science Fair In A Box' project
SFIAB Website: http://www.sfiab.ca
Copyright (C) 2005 Sci-Tech Ontario Inc <info@scitechontario.org>
Copyright (C) 2005 James Grant <james@lightbox.org>
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.
*/
?>
<?
require("common.inc.php");
include "register_judges.inc.php";
//send the header
send_header("Judges Registration - Special Awards");
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
echo "<br />";
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 "<form name=\"specialawardform\" method=\"post\" action=\"register_judges_specialawards.php\">\n";
echo "<input type=\"hidden\" name=\"action\" value=\"save\">\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 "&nbsp;&nbsp;";
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 "<br />";
echo "<br />";
$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 "<table>\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 "<tr><td rowspan=\"2\">";
$ch = (in_array($r->id,$spawards)) ? "checked=\"checked\"" : "";
echo "<input onclick=\"checkboxclicked(this)\" $ch type=\"checkbox\" name=\"spaward[]\" value=\"{$r->id}\" />";
echo "</td><td>";
echo "<b>{$r->name}</b> ($r->organization)";
echo "</td></tr>";
echo "<tr><td>";
echo "{$r->criteria}";
echo "<br /><br />";
echo "</td></tr>";
}
echo "</table>";
echo "<input type=\"submit\" value=\"".i18n("Save Special Award Preferences")."\" />\n";
echo "</form>";
echo "<br />";
echo "<a onclick=\"return confirmChanges();\" href=\"register_judges_main.php\">&lt;&lt; ".i18n("Back to Judges Registration Summary")."</a><br />";
send_footer();
?>