2005-03-30 18:02:45 +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 .
*/
?>
< ?
//this file is meant to be used as a popup from the judging teams page to view the judge info
//it needs the judge ID passed into it.
//thus, we do not need the normal header and footer
2006-07-11 20:22:42 +00:00
require ( " ../questions.inc.php " );
2005-03-30 18:02:45 +00:00
require ( " ../common.inc.php " );
2007-11-21 17:02:09 +00:00
require_once ( " ../user.inc.php " );
2007-11-18 23:50:23 +00:00
user_auth_required ( 'committee' , 'admin' );
2006-01-03 02:08:23 +00:00
$preferencechoices = array (
- 2 => " Very Low " ,
- 1 => " Low " ,
0 => " Indifferent " ,
1 => " Medium " ,
2 => " High "
);
2005-03-30 18:02:45 +00:00
if ( $_GET [ 'id' ])
{
2006-01-03 02:08:23 +00:00
//include "../register_judges.inc.php";
2005-03-30 18:02:45 +00:00
$q = mysql_query ( " SELECT
2006-01-03 02:08:23 +00:00
judges .*
2005-03-30 18:02:45 +00:00
FROM
judges
WHERE
judges . id = '".$_GET[' id ']."' " );
echo mysql_error ();
$judgeinfo = mysql_fetch_object ( $q );
send_popup_header ( i18n ( " Judge Information - %1 %2 " , array ( $judgeinfo -> firstname , $judgeinfo -> lastname )));
2006-10-18 17:05:18 +00:00
echo " Complete for { $config [ 'FAIRYEAR' ] } : " . (( $judgeinfo -> complete == " yes " ) ? " Yes " : " No " );
echo " <br /> " ;
2005-03-30 18:19:31 +00:00
echo " <h3> " . i18n ( " Personal Info " ) . " </h3> " ;
2005-03-30 18:13:58 +00:00
echo " <table class= \" viewtable \" > \n " ;
2005-03-30 18:02:45 +00:00
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " First Name " ) . " </th><td> $judgeinfo->firstname </td> \n " ;
echo " <th> " . i18n ( " Last Name " ) . " </th><td> $judgeinfo->lastname </td> \n " ;
2005-03-30 18:02:45 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " Email Address " ) . " </th><td> $judgeinfo->email </td> \n " ;
echo " <th> " . i18n ( " City " ) . " </th><td> $judgeinfo->city </td> \n " ;
2005-03-30 18:02:45 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " Address 1 " ) . " </th><td> $judgeinfo->address </td> \n " ;
2008-07-16 17:23:53 +00:00
echo " <th> " . i18n ( $config [ 'provincestate' ]) . " </th><td> $judgeinfo->province " ;
2005-03-30 18:02:45 +00:00
echo " </td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " Address 2 " ) . " </th><td> $judgeinfo->address2 </td> \n " ;
echo " <th> " . i18n ( " Phone (Home) " ) . " </th><td> $judgeinfo->phonehome </td> \n " ;
2005-03-30 18:02:45 +00:00
echo " </tr> \n " ;
echo " <tr> \n " ;
2008-07-16 17:23:53 +00:00
echo " <th> " . i18n ( $config [ 'postalzip' ]) . " </th><td> $judgeinfo->postalcode </td> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " Phone (Work) " ) . " </th><td> $judgeinfo->phonework ext $judgeinfo->phoneworkext </td> \n " ;
2005-03-30 18:02:45 +00:00
echo " </tr> " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th> " . i18n ( " Organization " ) . " </th><td> $judgeinfo->organization </td> \n " ;
echo " <th> " . i18n ( " Phone (Cell) " ) . " </th><td> $judgeinfo->phonecell </td> \n " ;
2005-03-30 18:02:45 +00:00
echo " </tr> " ;
echo " <tr><td colspan= \" 4 \" ><hr /></td></tr> " ;
echo " <tr> \n " ;
2006-01-03 02:08:23 +00:00
echo " <th valign= \" top \" colspan= \" 2 \" > " . i18n ( " Age category preference " ) . " </th><td colspan= \" 2 \" > " ;
2006-01-16 04:55:46 +00:00
$q = mysql_query ( " SELECT judges_catpref.*,projectcategories.category FROM judges_catpref,projectcategories WHERE judges_id=' { $_GET [ 'id' ] } ' AND judges_catpref.year=' " . $config [ 'FAIRYEAR' ] . " ' AND projectcategories.year=' " . $config [ 'FAIRYEAR' ] . " ' AND judges_catpref.projectcategories_id=projectcategories.id " );
2006-01-03 02:08:23 +00:00
echo mysql_error ();
while ( $r = mysql_fetch_object ( $q ))
echo i18n ( $r -> category ) . " : " . $preferencechoices [ $r -> rank ] . " <br /> " ;
2005-03-30 18:02:45 +00:00
echo " </td> \n " ;
echo " </tr> \n " ;
echo " </td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th colspan= \" 2 \" > " . i18n ( " Highest post-secondary degree " ) . " </th> " ;
2005-03-30 18:02:45 +00:00
echo " <td colspan= \" 2 \" > $judgeinfo->highest_psd </td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
2005-03-30 18:13:58 +00:00
echo " <th colspan= \" 2 \" > " . i18n ( " Other professional qualifications " ) . " </th> " ;
2005-03-30 18:02:45 +00:00
echo " <td colspan= \" 2 \" > $judgeinfo->professional_quals </td> \n " ;
echo " </tr> \n " ;
echo " <tr> \n " ;
2006-01-03 02:08:23 +00:00
echo " <th colspan= \" 2 \" valign= \" top \" > " . i18n ( " Languages " ) . " </th> " ;
2005-03-30 18:02:45 +00:00
echo " <td colspan= \" 2 \" > " ;
$q = mysql_query ( " SELECT languages_lang FROM judges_languages WHERE judges_id=' $judgeinfo->id ' " );
while ( $r = mysql_fetch_object ( $q ))
{
echo $r -> languages_lang ;
echo " <br /> " ;
}
echo " </td> \n " ;
echo " </tr> \n " ;
2006-07-11 20:22:42 +00:00
questions_print_answers ( 'judgereg' , $judgeinfo -> id , $config [ 'FAIRYEAR' ]);
2005-03-30 18:02:45 +00:00
echo " </table> " ;
echo " <hr /> " ;
echo " <br /> " ;
2005-03-30 18:19:31 +00:00
echo " <h3>Areas of Expertise</h3> " ;
2005-03-30 18:13:58 +00:00
echo " <table class= \" viewtable \" > " ;
2005-03-30 18:02:45 +00:00
//grab the list of divisions, because the last fields of the table will be the sub-divisions
2006-01-16 04:55:46 +00:00
$q = mysql_query ( " SELECT * FROM projectdivisions WHERE year=' " . $config [ 'FAIRYEAR' ] . " ' ORDER BY id " );
2005-03-30 18:02:45 +00:00
$divs = array ();
while ( $r = mysql_fetch_object ( $q ))
{
$divs [] = $r -> id ;
$divnames [ $r -> id ] = $r -> division ;
}
2006-01-16 04:55:46 +00:00
$subdivq = mysql_query ( " SELECT judges_expertise.*,
projectsubdivisions . subdivision ,
projectsubdivisions . projectdivisions_id AS parent_id
FROM judges_expertise
2005-03-30 18:02:45 +00:00
LEFT JOIN projectsubdivisions ON judges_expertise . projectsubdivisions_id = projectsubdivisions . id
2006-01-16 04:55:46 +00:00
WHERE judges_id = '$judgeinfo->id'
AND judges_expertise . year = '".$config[' FAIRYEAR ']."'
ORDER BY projectdivisions_id , projectsubdivisions_id " );
echo mysql_error ();
2005-03-30 18:02:45 +00:00
$judge_divs = array ();
$judge_subdivs = array ();
$divdata = array ();
while ( $subdivr = mysql_fetch_object ( $subdivq ))
{
if ( $subdivr -> projectdivisions_id )
{
$judge_divs [ $subdivr -> projectdivisions_id ] = $subdivr -> val ;
}
else
$judge_subdivs [ $subdivr -> parent_id ][] = $subdivr -> subdivision ;
}
foreach ( $divs as $div )
{
2005-03-30 18:05:53 +00:00
echo " <tr><th> " . i18n ( $divnames [ $div ]) . " </th> " ;
2005-03-30 18:02:45 +00:00
echo " <td> " . $judge_divs [ $div ] . " /5</td> " ;
echo " <td> " ;
if ( count ( $judge_subdivs [ $div ]))
{
2005-03-30 18:24:20 +00:00
$divdata = implode ( " , " , $judge_subdivs [ $div ]);
2005-03-30 18:05:53 +00:00
echo " $divdata " ;
2005-03-30 18:02:45 +00:00
}
else
echo " " ;
echo " </td> " ;
echo " </tr> " ;
}
echo " </table> " ;
}
else
{
send_popup_header ( " Judge Information " );
echo error ( i18n ( " No Judge ID passed to Judges Info " ));
}
send_popup_footer ();
?>