2005-01-24 18:00:03 +00:00
< ?
/*
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 .
*/
?>
2004-12-19 23:16:46 +00:00
< ?
require ( " common.inc.php " );
2006-07-11 20:22:42 +00:00
require ( " questions.inc.php " );
2004-12-19 23:16:46 +00:00
include " register_judges.inc.php " ;
//send the header
send_header ( " Judges Registration - Personal Information " );
2005-02-21 23:07:10 +00:00
echo " <a onclick= \" return confirmChanges(); \" href= \" register_judges_main.php \" ><< " . i18n ( " Back to Judges Registration Summary " ) . " </a><br /> " ;
2004-12-19 23:16:46 +00:00
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' ])) . " ', " .
2005-02-11 15:28:34 +00:00
" address2=' " . mysql_escape_string ( stripslashes ( $_POST [ 'address2' ])) . " ', " .
2004-12-19 23:16:46 +00:00
" city=' " . mysql_escape_string ( stripslashes ( $_POST [ 'city' ])) . " ', " .
" province=' " . mysql_escape_string ( stripslashes ( $_POST [ 'province' ])) . " ', " .
" postalcode=' " . mysql_escape_string ( stripslashes ( $_POST [ 'postalcode' ])) . " ', " .
2004-12-20 19:46:08 +00:00
" phonehome=' " . mysql_escape_string ( stripslashes ( $_POST [ 'phonehome' ])) . " ', " .
" phonework=' " . mysql_escape_string ( stripslashes ( $_POST [ 'phonework' ])) . " ', " .
2005-02-11 15:28:34 +00:00
" phoneworkext=' " . mysql_escape_string ( stripslashes ( $_POST [ 'phoneworkext' ])) . " ', " .
2004-12-20 19:46:08 +00:00
" phonecell=' " . mysql_escape_string ( stripslashes ( $_POST [ 'phonecell' ])) . " ', " .
2004-12-19 23:16:46 +00:00
" organization=' " . mysql_escape_string ( stripslashes ( $_POST [ 'organization' ])) . " ', " .
2005-02-11 15:49:39 +00:00
" highest_psd=' " . mysql_escape_string ( stripslashes ( $_POST [ 'highest_psd' ])) . " ', " .
2007-01-30 06:12:11 +00:00
" professional_quals=' " . mysql_escape_string ( stripslashes ( $_POST [ 'professional_quals' ])) . " ', " .
" typepref=' " . mysql_escape_string ( stripslashes ( $_POST [ 'typepref' ])) . " ' " .
2004-12-19 23:16:46 +00:00
" WHERE id=' " . $_SESSION [ 'judges_id' ] . " ' " );
echo mysql_error ();
2005-02-11 16:08:16 +00:00
//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 ') " );
}
}
2006-07-11 20:22:42 +00:00
/* 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 );
2004-12-19 23:16:46 +00:00
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 );
2005-03-10 19:43:49 +00:00
updateJudgeCompleteStatus ( $judgeinfo );
2004-12-19 23:16:46 +00:00
//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 " ;
2004-12-20 19:49:15 +00:00
echo " <input type= \" hidden \" name= \" action \" value= \" save \" /> \n " ;
2004-12-19 23:16:46 +00:00
echo " <table> \n " ;
echo " <tr> \n " ;
2006-01-12 17:08:41 +00:00
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 " ;
2004-12-19 23:16:46 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2006-01-12 17:08:41 +00:00
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 " ;
2004-12-19 23:16:46 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2006-01-12 17:08:41 +00:00
echo " <td> " . i18n ( " Address 1 " ) . " </td><td><input onchange= \" fieldChanged() \" type= \" text \" name= \" address \" value= \" $judgeinfo->address\ " /> " .REQUIREDFIELD. " </ td > \n " ;
2008-07-16 17:23:53 +00:00
echo " <td> " . i18n ( $config [ 'provincestate' ]) . " </td><td> " ;
2005-02-21 23:07:10 +00:00
emit_province_selector ( " province " , $judgeinfo -> province , " onchange= \" fieldChanged() \" " );
2006-01-12 17:08:41 +00:00
echo REQUIREDFIELD . " </td> \n " ;
2004-12-19 23:16:46 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-02-21 23:07:10 +00:00
echo " <td> " . i18n ( " Address 2 " ) . " </td><td><input onchange= \" fieldChanged() \" type= \" text \" name= \" address2 \" value= \" $judgeinfo->address2\ " /></ td > \n " ;
2006-01-12 17:08:41 +00:00
echo " <td> " . i18n ( " Phone (Home) " ) . " </td><td><input onchange= \" fieldChanged() \" type= \" text \" name= \" phonehome \" value= \" $judgeinfo->phonehome\ " /> " .REQUIREDFIELD. " </ td > \n " ;
2004-12-19 23:16:46 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2008-07-16 17:23:53 +00:00
echo " <td> " . i18n ( $config [ 'postalzip' ]) . " </td><td><input onchange= \" fieldChanged() \" type= \" text \" name= \" postalcode \" value= \" $judgeinfo->postalcode\ " /> " .REQUIREDFIELD. " </ td > \n " ;
2005-02-21 23:07:10 +00:00
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 " ;
2004-12-20 19:46:08 +00:00
echo " </tr> " ;
echo " <tr> \n " ;
2005-02-21 23:07:10 +00:00
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 " ;
2004-12-19 23:16:46 +00:00
echo " </tr> " ;
2004-12-20 19:46:08 +00:00
2005-02-11 15:32:29 +00:00
2007-01-30 06:12:11 +00:00
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 " ;
2005-02-11 15:32:29 +00:00
}
2006-01-03 02:08:23 +00:00
echo " <tr><td colspan= \" 4 \" ><hr /></td></tr> " ;
2005-02-11 15:49:39 +00:00
2004-12-19 23:16:46 +00:00
echo " <tr> \n " ;
2005-02-11 15:49:39 +00:00
echo " <td colspan= \" 2 \" > " . i18n ( " Highest post-secondary degree " ) . " </td> " ;
2005-02-21 23:07:10 +00:00
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" highest_psd \" size= \" 35 \" value= \" $judgeinfo->highest_psd\ " /></ td > \n " ;
2004-12-19 23:16:46 +00:00
echo " </tr> \n " ;
2005-02-11 15:49:39 +00:00
2005-02-11 18:29:19 +00:00
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " Other professional qualifications " ) . " </td> " ;
2005-02-21 23:07:10 +00:00
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" professional_quals \" size= \" 35 \" value= \" $judgeinfo->professional_quals\ " /></ td > \n " ;
2005-02-11 18:29:19 +00:00
echo " </tr> \n " ;
2005-02-11 16:08:16 +00:00
echo " <tr> \n " ;
2007-10-25 18:20:55 +00:00
echo " <td colspan= \" 2 \" > " . i18n ( " I can judge in the following languages " ) . " " . REQUIREDFIELD . " </td> " ;
2005-02-11 16:08:16 +00:00
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 = " " ;
2007-10-25 18:20:55 +00:00
echo " <input onclick= \" fieldChanged() \" $ch type= \" checkbox \" name= \" languages[] \" value= \" $r->lang\ " /> $r -> langname < br /> " ;
2005-02-11 16:08:16 +00:00
}
echo " </td> \n " ;
echo " </tr> \n " ;
2006-07-11 20:22:42 +00:00
questions_print_answer_editor ( 'judgereg' ,
$_SESSION [ 'judges_id' ], $config [ 'FAIRYEAR' ], 'questions' );
2004-12-20 19:46:08 +00:00
2004-12-20 19:49:15 +00:00
echo " </table> " ;
echo " <input type= \" submit \" value= \" " . i18n ( " Save Personal Information " ) . " \" /> \n " ;
echo " </form> " ;
2004-12-19 23:16:46 +00:00
2005-02-16 18:21:32 +00:00
echo " <br /> " ;
2005-02-21 23:07:10 +00:00
echo " <a onclick= \" return confirmChanges(); \" href= \" register_judges_main.php \" ><< " . i18n ( " Back to Judges Registration Summary " ) . " </a><br /> " ;
2004-12-19 23:16:46 +00:00
2004-12-20 19:49:15 +00:00
send_footer ();
2004-12-19 23:16:46 +00:00
?>