forked from science-ation/science-ation
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)
This commit is contained in:
parent
54769f999a
commit
d3090b934f
@ -34,6 +34,7 @@
|
||||
{
|
||||
echo "<a href=\"judges_invite.php\">".i18n("Invite Judges")."</a><br />";
|
||||
}
|
||||
echo "<a href=\"judges_judges.php\">".i18n("Judges List")."</a><br />";
|
||||
echo "<a href=\"judges_teams.php\">".i18n("Manage Judging Teams")."</a><br />";
|
||||
echo "<a href=\"judges_teams_members.php\">".i18n("Manage Judging Team Members")."</a><br />";
|
||||
echo "<a href=\"judges_timeslots.php\">".i18n("Manage Judging Timeslots")."</a><br />";
|
||||
|
125
admin/judges_judges.php
Normal file
125
admin/judges_judges.php
Normal file
@ -0,0 +1,125 @@
|
||||
<?
|
||||
/*
|
||||
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");
|
||||
auth_required('admin');
|
||||
include "judges.inc.php";
|
||||
|
||||
send_header("Administration - Judges");
|
||||
?>
|
||||
<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>
|
||||
|
||||
<?
|
||||
echo "<a href=\"index.php\"><< ".i18n("Back to Administration")."</a>\n";
|
||||
echo "<a href=\"judges.php\"><< ".i18n("Back to Judges")."</a>\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 "<h3>".i18n("Judges list")."</h3>";
|
||||
echo "<table class=\"viewtable\">";
|
||||
$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 "<tr>";
|
||||
echo " <th>".i18n("Judge Name")."</th>";
|
||||
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>";
|
||||
if($r->complete=="yes")
|
||||
{
|
||||
$cl="happy";
|
||||
$completeyes++;
|
||||
}
|
||||
else
|
||||
{
|
||||
$cl="error";
|
||||
$completeno++;
|
||||
}
|
||||
echo "<td class=\"$cl\" align=\"center\">";
|
||||
echo $r->complete;
|
||||
echo "</td>";
|
||||
echo "<td align=\"center\">";
|
||||
echo "<a onclick=\"return confirmClick('Are you sure you want to remove 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>";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "</table>";
|
||||
echo "<br />";
|
||||
echo i18n("There are %1 total judges.",array($num),array("the number of judges"));
|
||||
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();
|
||||
?>
|
Loading…
Reference in New Issue
Block a user