diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php
index 8a60666..988e74c 100644
--- a/admin/judges_teams_projects.php
+++ b/admin/judges_teams_projects.php
@@ -34,6 +34,18 @@ function assign(ts)
document.forms.teamsprojects.timeslot.value=ts;
document.forms.teamsprojects.submit();
}
+
+function eligibleclick()
+{
+ if(document.forms.teamsprojects.showeligible.checked)
+ {
+ window.location.href="judges_teams_projects.php?action=edit&edit="+document.forms.teamsprojects.edit.value+"&judges_projects_list_eligible=true";
+ }
+ else
+ {
+ window.location.href="judges_teams_projects.php?action=edit&edit="+document.forms.teamsprojects.edit.value+"&judges_projects_list_eligible=false";
+ }
+}
@@ -55,6 +67,12 @@ if(!$_SESSION['viewstate']['judges_projects_list_show'])
if($_GET['judges_projects_list_show'])
$_SESSION['viewstate']['judges_projects_list_show']=$_GET['judges_projects_list_show'];
+if(!$_SESSION['viewstate']['judges_projects_list_eligible'])
+ $_SESSION['viewstate']['judges_projects_list_eligible']='true';
+//now update the judges_teams_list_show viewstate
+if($_GET['judges_projects_list_eligible'])
+ $_SESSION['viewstate']['judges_projects_list_eligible']=$_GET['judges_projects_list_eligible'];
+
if($_GET['action']=="delete" && $_GET['delete'] && $_GET['edit'])
{
@@ -87,91 +105,43 @@ if( ($action=="edit" || $action=="assign" ) && $edit)
$team=getJudgingTeam($edit);
echo "".$team['name']." (#".$team['num'].")
";
- $memberlist=" ";
- foreach($team['members'] AS $member)
+ if(count($team['members']))
{
- if($member['captain']=="yes")
- $memberlist.="";
- $memberlist.=$member['firstname']." ".$member['lastname'];
- if($member['captain']=="yes")
- $memberlist.="";
- $memberlist.=", ";
+ $memberlist=" ";
+ foreach($team['members'] AS $member)
+ {
+ if($member['captain']=="yes")
+ $memberlist.="";
+ $memberlist.=$member['firstname']." ".$member['lastname'];
+ if($member['captain']=="yes")
+ $memberlist.="";
+ $memberlist.=", ";
+ }
+ echo "".i18n("Judging Team Members").": ";
+ $memberlist=substr($memberlist,0,-2);
+ echo "
";
}
- $memberlist=substr($memberlist,0,-2);
+ else
+ $memberlist=error(i18n("Team has no members assigned to it. Assign Judges Here"));
echo $memberlist;
echo "
";
-
- if($_SESSION['viewstate']['judges_projects_list_show']=='all')
- {
- $querystr="SELECT
- projects.id,
- projects.projectnumber,
- projects.title,
- registrations.status
- FROM
- projects,
- registrations
- WHERE
- projectnumber is not null AND
- registrations.status='complete' AND
- projects.registrations_id=registrations.id AND
- projects.year='".$config['FAIRYEAR']."'
- ORDER BY
- projectnumber";
- }
- else
- {
- $querystr="SELECT
- projects.id,
- projects.projectnumber,
- projects.title,
- registrations.status
- FROM
- projects
- LEFT JOIN judges_teams_timeslots_projects_link ON projects.id = judges_teams_timeslots_projects_link.projects_id,
- registrations
- WHERE
- projectnumber is not null AND
- registrations.status='complete' AND
- projects.registrations_id=registrations.id AND
- judges_teams_timeslots_projects_link.projects_id IS NULL AND
- projects.year='".$config['FAIRYEAR']."'
- ORDER BY
- projectnumber";
- }
- $q=mysql_query($querystr);
- echo mysql_error();
- $numprojects=mysql_num_rows($q);
-
echo "
";
- echo "
".i18n("show unassigned")." | "; - echo "".i18n("show all")." | "; + $awardlist=" "; + foreach($team['awards'] AS $award) + { + $awardlist.=$award['name']; + $awardlist.=", "; + } + echo "".i18n("Judging Team Awards").": "; + $awardlist=substr($awardlist,0,-2); + echo "".i18n("show unassigned")." | "; - echo "".i18n("show all")." | "; - - } - echo ""; - echo " |
"; - echo ""; - echo " | "; - echo "$numprojects projects listed"; - echo " |
Timeslot | "; - echo "Project | "; - echo "||||||||
---|---|---|---|---|---|---|---|---|---|
";
- echo " | ";
-
- $projq=mysql_query("SELECT
- judges_teams_timeslots_projects_link.id AS link_id,
- projects.projectnumber,
+ echo " "; + echo " "; + if($_SESSION['viewstate']['judges_projects_list_eligible']=='true') + $ch="checked=\"checked\""; + else + $ch=""; + + echo " Show only projects eligible for awards assigned to this team"; + echo "
|
Timeslot | "; + echo "Project | "; + echo "
---|---|
";
+
+ echo " | ";
+
+ $projq=mysql_query("SELECT
+ judges_teams_timeslots_projects_link.id AS link_id,
+ projects.projectnumber,
+ projects.id,
+ projects.title
+ FROM
+ projects,
+ judges_teams_timeslots_projects_link
+ WHERE
+ judges_teams_timeslots_projects_link.judges_timeslots_id='$r->id' AND
+ judges_teams_timeslots_projects_link.judges_teams_id='".$team['id']."' AND
+ judges_teams_timeslots_projects_link.projects_id=projects.id AND
+ judges_teams_timeslots_projects_link.year='".$config['FAIRYEAR']."'
+ ORDER BY
+ projectnumber
+ ");
+
+ echo mysql_Error();
+ while($proj=mysql_fetch_object($projq))
+ {
+ echo "link_id."&edit=".$team['id']."\">";
+ echo "$proj->projectnumber - $proj->title "; + + } + echo "id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"Assign\">"; + + echo " |