From d3090b934fc09b680f321ddcc085b9b72889ddb0 Mon Sep 17 00:00:00 2001 From: james Date: Wed, 15 Feb 2006 18:10:27 +0000 Subject: [PATCH] Add a judges list to the judges management page, this list allows you to view the status of the judges as well as delete judges from the current year's fair (note: only deactivates their account for the fair, does not delete it completely) --- admin/judges.php | 1 + admin/judges_judges.php | 125 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 126 insertions(+) create mode 100644 admin/judges_judges.php diff --git a/admin/judges.php b/admin/judges.php index 15b3b5b..57ed666 100644 --- a/admin/judges.php +++ b/admin/judges.php @@ -34,6 +34,7 @@ { echo "".i18n("Invite Judges")."
"; } + echo "".i18n("Judges List")."
"; echo "".i18n("Manage Judging Teams")."
"; echo "".i18n("Manage Judging Team Members")."
"; echo "".i18n("Manage Judging Timeslots")."
"; diff --git a/admin/judges_judges.php b/admin/judges_judges.php new file mode 100644 index 0000000..65b0438 --- /dev/null +++ b/admin/judges_judges.php @@ -0,0 +1,125 @@ + + Copyright (C) 2005 James Grant + + 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. +*/ +?> + + + +<< ".i18n("Back to Administration")."\n"; + echo "<< ".i18n("Back to Judges")."\n"; + + 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")); + } + + echo "

".i18n("Judges list")."

"; + echo ""; + $querystr="SELECT + judges.id, + judges.firstname, + judges.lastname, + judges.complete + FROM + judges, + judges_years + WHERE + judges_years.year='".$config['FAIRYEAR']."' AND + judges.id=judges_years.judges_id + 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 ""; + echo " "; + echo " "; + echo " "; + echo ""; + $completeyes=0; + $completeno=0; + while($r=mysql_fetch_object($q)) + { + echo ""; + if($r->complete=="yes") + { + $cl="happy"; + $completeyes++; + } + else + { + $cl="error"; + $completeno++; + } + echo ""; + echo ""; + echo ""; + } + + echo "
".i18n("Judge Name")."".i18n("Complete")."".i18n("Actions")."
"; + echo "id)\">$r->firstname $r->lastname"; + echo ""; + echo $r->complete; + echo ""; + echo "id\">"; + echo "
"; + echo "
"; + echo i18n("There are %1 total judges.",array($num),array("the number of judges")); + echo "
"; + echo i18n("There are %1 complete judges.",array($completeyes),array("the number of judges")); + echo "
"; + echo i18n("There are %1 incomplete judges.",array($completeno),array("the number of judges")); + echo "
"; + echo "
"; + echo "
"; + + send_footer(); +?>