2008-10-17 19:34:11 +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 .
*/
?>
< ?
require_once ( 'common.inc.php' );
require_once ( 'user.inc.php' );
require_once ( 'judge.inc.php' );
require_once ( " questions.inc.php " );
2009-01-19 23:33:54 +00:00
if ( $_SESSION [ 'embed' ] == true ) {
$u = user_load ( $_SESSION [ 'embed_edit_id' ]);
} else {
$u = user_load ( $_SESSION [ 'users_id' ]);
}
2008-10-17 19:34:11 +00:00
if ( $_POST [ 'action' ] == " save " )
{
2008-10-17 22:44:33 +00:00
if ( ! is_array ( $_POST [ 'languages' ])) $_POST [ 'languages' ] = array ();
$u [ 'languages' ] = array ();
foreach ( $_POST [ 'languages' ] AS $val )
$u [ 'languages' ][] = $val ;
$u [ 'special_award_only' ] = ( $_POST [ 'special_award_only' ] == 'yes' ) ? 'yes' : 'no' ;
$u [ 'willing_chair' ] = ( $_POST [ 'willing_chair' ] == 'yes' ) ? 'yes' : 'no' ;
$u [ 'years_school' ] = intval ( $_POST [ 'years_school' ]);
$u [ 'years_regional' ] = intval ( $_POST [ 'years_regional' ]);
$u [ 'years_national' ] = intval ( $_POST [ 'years_national' ]);
$u [ 'highest_psd' ] = stripslashes ( $_POST [ 'highest_psd' ]);
2008-10-17 19:34:11 +00:00
user_save ( $u );
message_push ( notice ( i18n ( " Preferences successfully saved " )));
2008-10-19 21:42:57 +00:00
$u = user_load ( $u [ 'id' ]);
2008-10-17 19:34:11 +00:00
}
2009-01-19 23:33:54 +00:00
if ( $_SESSION [ 'embed' ] == true ) {
echo " <br /> " ;
display_messages ();
echo " <h3> " . i18n ( 'Other Information' ) . " </h3> " ;
echo " <br /> " ;
} else {
//send the header
send_header ( 'Other Information' ,
array ( 'Judge Registration' => 'judge_main.php' )
);
}
2008-10-18 03:30:58 +00:00
judge_status_update ( $u );
2008-10-17 19:34:11 +00:00
2009-01-19 23:33:54 +00:00
if ( $_SESSION [ 'embed' ] != true ) {
//output the current status
$newstatus = judge_status_other ( $u );
if ( $newstatus != " complete " )
echo error ( i18n ( " Other Information Incomplete " ));
else
echo happy ( i18n ( " Other Information Complete " ));
}
if ( $_SESSION [ 'embed' ] == true ) {
echo " <form name= \" otherform \" method= \" post \" action= \" { $_SESSION [ 'embed_submit_url' ] } \" > \n " ;
} else {
echo " <form name= \" otherform \" method= \" post \" action= \" judge_other.php \" > \n " ;
}
2008-10-17 19:34:11 +00:00
echo " <input type= \" hidden \" name= \" action \" value= \" save \" > \n " ;
echo " <table> \n " ;
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " I can judge in the following languages " ) . " " . REQUIREDFIELD . " </td> " ;
echo " <td colspan= \" 2 \" > " ;
$q = mysql_query ( " SELECT * FROM languages WHERE active='Y' ORDER BY langname " );
2008-10-17 22:44:33 +00:00
echo mysql_error ();
2008-10-17 19:34:11 +00:00
while ( $r = mysql_fetch_object ( $q ))
{
2008-10-17 22:44:33 +00:00
$ch = ( in_array ( $r -> lang , $u [ 'languages' ])) ? 'checked="checked"' : '' ;
2008-10-17 19:34:11 +00:00
echo " <input onclick= \" fieldChanged() \" $ch type= \" checkbox \" name= \" languages[] \" value= \" $r->lang\ " /> $r -> langname < br /> " ;
}
echo " </td> \n " ;
echo " </tr> \n " ;
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> " ;
2008-10-17 22:44:33 +00:00
$ch = ( $u [ 'special_award_only' ] == 'yes' ) ? 'checked="checked"' : '' ;
echo " <td colspan= \" 2 \" ><input $ch type= \" checkbox \" name= \" special_award_only \" value= \" yes \" /> " ;
2008-10-17 19:34:11 +00:00
echo " </td> " ;
echo " </tr> \n " ;
}
echo " <tr><td colspan= \" 4 \" ><hr /></td></tr> " ;
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " Years of judging experience at a School level: " ) . " </td> " ;
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" years_school \" size= \" 5 \" value= \" { $u [ 'years_school' ] } \" /></td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " Years of judging experience at a Regional level: " ) . " </td> " ;
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" years_regional \" size= \" 5 \" value= \" { $u [ 'years_regional' ] } \" /></td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " Years of judging experience at a National level: " ) . " </td> " ;
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" years_national \" size= \" 5 \" value= \" { $u [ 'years_national' ] } \" /></td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
2008-10-17 22:44:33 +00:00
echo " <td colspan= \" 2 \" > " . i18n ( " I am willing to be the lead for my judging team " ) . " </td> " ;
$ch = ( $u [ 'willing_chair' ] == 'yes' ) ? 'checked="checked"' : '' ;
echo " <td colspan= \" 2 \" ><input $ch type= \" checkbox \" name= \" willing_chair \" value= \" yes \" /> " ;
2008-10-17 19:34:11 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
echo " <td colspan= \" 2 \" > " . i18n ( " Highest post-secondary degree " ) . " </td> " ;
2008-10-17 22:44:33 +00:00
echo " <td colspan= \" 2 \" ><input onchange= \" fieldChanged() \" type= \" text \" name= \" highest_psd \" size= \" 35 \" value= \" { $u [ 'highest_psd' ] } \" /></td> \n " ;
2008-10-17 19:34:11 +00:00
echo " </tr> \n " ;
2008-10-17 22:44:33 +00:00
echo " <tr><td colspan= \" 4 \" ><hr /></td></tr> " ;
questions_print_answer_editor ( 'judgereg' , $u , 'questions' );
2008-10-17 19:34:11 +00:00
echo " </table> " ;
echo " <br /> " ;
echo " <br /> " ;
echo " <input type= \" submit \" value= \" " . i18n ( " Save Information " ) . " \" /> \n " ;
echo " </form> " ;
2009-01-19 23:33:54 +00:00
if ( $_SESSION [ 'embed' ] != true ) send_footer ();
2008-10-17 19:34:11 +00:00
?>