2006-02-15 18:10:27 +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 ( " ../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-02-15 18:10:27 +00:00
include " judges.inc.php " ;
2007-11-18 23:50:23 +00:00
send_header ( " Judge List " ,
array ( 'Committee Main' => 'committee_main.php' ,
'Administration' => 'admin/index.php' ,
'Judges' => 'admin/judges.php' )
);
2006-02-15 18:10:27 +00:00
?>
< script language = " javascript " type = " text/javascript " >
function openjudgeinfo ( id )
{
if ( id )
currentid = id ;
else
currentid = document . forms . judges [ " judgelist[] " ] . options [ document . forms . judges [ " judgelist[] " ] . selectedIndex ] . value ;
window . open ( " judges_info.php?id= " + currentid , " JudgeInfo " , " location=no,menubar=no,directories=no,toolbar=no,width=770,height=500,scrollbars=yes " );
return false ;
}
</ script >
< ?
if ( $_GET [ 'action' ] == " remove " && $_GET [ 'remove' ])
{
//we need to remove them from:
// judges_teams
// judges_years
mysql_query ( " DELETE FROM judges_teams_link WHERE judges_id=' " . $_GET [ 'remove' ] . " ' AND year= " . $config [ 'FAIRYEAR' ] . " ' " );
mysql_query ( " DELETE FROM judges_years WHERE judges_id=' " . $_GET [ 'remove' ] . " ' AND year=' " . $config [ 'FAIRYEAR' ] . " ' " );
echo happy ( i18n ( " Successfully removed judge from this year's fair " ));
}
2006-10-16 17:50:28 +00:00
echo " <h3> " . i18n ( " Active Judges list for %1 " , array ( $config [ 'FAIRYEAR' ])) . " </h3> " ;
2006-02-15 18:10:27 +00:00
echo " <table class= \" viewtable \" > " ;
$querystr = " SELECT
judges . id ,
judges . firstname ,
judges . lastname ,
2007-02-09 14:57:07 +00:00
judges . email ,
2006-10-16 17:50:28 +00:00
judges . complete ,
judges_years . year
2006-02-15 18:10:27 +00:00
FROM
2006-10-16 17:50:28 +00:00
judges
2007-10-25 18:20:55 +00:00
JOIN judges_years ON judges . id = judges_years . judges_id
2006-02-15 18:10:27 +00:00
WHERE
2007-10-25 18:20:55 +00:00
judges_years . year = '".$config[' FAIRYEAR ']."'
AND judges . deleted = 'no'
2006-02-15 18:10:27 +00:00
ORDER BY
lastname ,
firstname " ;
$q = mysql_query ( $querystr );
$num = mysql_num_rows ( $q );
echo i18n ( " Listing %1 judges total. See the bottom for breakdown of judges by complete status " , array ( $num ), array ( " the number of judges " ));
echo mysql_error ();
echo " <tr> " ;
echo " <th> " . i18n ( " Judge Name " ) . " </th> " ;
2007-02-09 14:57:07 +00:00
echo " <th> " . i18n ( " Email Address " ) . " </th> " ;
2006-02-15 18:10:27 +00:00
echo " <th> " . i18n ( " Complete " ) . " </th> " ;
echo " <th> " . i18n ( " Actions " ) . " </th> " ;
echo " </tr> " ;
$completeyes = 0 ;
$completeno = 0 ;
while ( $r = mysql_fetch_object ( $q ))
{
echo " <tr><td> " ;
echo " <a href= \" \" onclick= \" return openjudgeinfo( $r->id ) \" > $r->firstname $r->lastname </a> " ;
echo " </td> " ;
2007-02-09 14:57:07 +00:00
echo " <td> $r->email </td> " ;
2006-10-16 17:50:28 +00:00
if ( $r -> complete == " yes " && $r -> year )
{
echo " <td class= \" happy \" align= \" center \" > " . i18n ( " yes " ) . " </td> " ;
2006-02-15 18:10:27 +00:00
$completeyes ++ ;
}
else
{
2006-10-16 17:50:28 +00:00
echo " <td class= \" error \" align= \" center \" > " . i18n ( " no " ) . " </td> " ;
2006-02-15 18:10:27 +00:00
$cl = " error " ;
$completeno ++ ;
}
echo " <td align= \" center \" > " ;
2007-10-25 18:20:55 +00:00
echo " <a onclick= \" return confirmClick('Are you sure you want to deactivate this judge from this years fair?') \" href= \" judges_judges.php?action=remove&remove= $r->id\ " >< img border = 0 src = \ " " . $config [ 'SFIABDIRECTORY' ] . " /images/16/button_cancel. " . $config [ 'icon_extension' ] . " \" ></a> " ;
2006-02-15 18:10:27 +00:00
echo " </td> " ;
echo " </tr> " ;
}
echo " </table> " ;
2007-10-25 18:20:55 +00:00
echo i18n ( " Note: Deleting judges from this list only deactivates the judge for this year's fair. To completely delete a judge, use the 'Manage Judges' page " );
echo " <br /> " ;
2006-02-15 18:10:27 +00:00
echo " <br /> " ;
2007-10-25 18:20:55 +00:00
echo i18n ( " There are %1 total active judges. " , array ( $num ), array ( " the number of judges " ));
2006-02-15 18:10:27 +00:00
echo " <br /> " ;
echo i18n ( " There are %1 complete judges. " , array ( $completeyes ), array ( " the number of judges " ));
echo " <br /> " ;
echo i18n ( " There are %1 incomplete judges. " , array ( $completeno ), array ( " the number of judges " ));
echo " <br /> " ;
echo " <br /> " ;
echo " <br /> " ;
send_footer ();
?>