forked from science-ation/science-ation

Judge manager - delete now deletes the judge completely Judge list only shows judges active for current fairyear Clarify a few issues on the judge registration page
182 lines
8.4 KiB
PHP
182 lines
8.4 KiB
PHP
<?
|
|
/*
|
|
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\"><< ".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("Province")."</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("Postal Code")."</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\" /> 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\"><< ".i18n("Back to Judges Registration Summary")."</a><br />";
|
|
|
|
send_footer();
|
|
?>
|