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"; + } +} ".$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 ""; - echo ""; - if($_SESSION['viewstate']['judges_projects_list_show']=='all') + + if(count($team['awards'])) { - echo ""; - echo ""; + $awardlist="  "; + foreach($team['awards'] AS $award) + { + $awardlist.=$award['name']; + $awardlist.=", "; + } + echo "".i18n("Judging Team Awards").": "; + $awardlist=substr($awardlist,0,-2); + echo "
"; } else - { - echo ""; - echo ""; - - } - echo ""; - echo ""; - echo ""; - echo "
".i18n("show unassigned")."".i18n("show all")."".i18n("show unassigned")."".i18n("show all")." 
"; - echo ""; - echo ""; - echo "$numprojects projects listed"; - echo "
"; - + $awardlist=error(i18n("Team has no awards assigned to it. Assign Awards Here")); + echo $awardlist; //get the timeslots that this team has. $q=mysql_query("SELECT @@ -193,59 +163,146 @@ if( ($action=="edit" || $action=="assign" ) && $edit) $numslots=mysql_num_rows($q); - echo "
"; - echo "
"; - - echo ""; - echo ""; - echo ""; - echo ""; - echo ""; - - - while($r=mysql_fetch_object($q)) + if($numslots) { - echo "
TimeslotProject
"; - echo ""; - if($show_date) - echo "$r->date "; - echo substr($r->starttime,0,-3); - echo " - "; - echo substr($r->endtime,0,-3); - 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 ""; + echo ""; + + echo ""; + if($_SESSION['viewstate']['judges_projects_list_show']=='all') + { + echo ""; + echo ""; + } + else + { + echo ""; + echo ""; + } + echo ""; + echo ""; + echo ""; - } - echo "
".i18n("show unassigned")."".i18n("show all")."".i18n("show unassigned")."".i18n("show all")." 
"; + + if($_SESSION['viewstate']['judges_projects_list_show']=='all') + { + $querystr="SELECT projects.id, - projects.title + projects.projectnumber, + projects.title, + registrations.status FROM projects, - judges_teams_timeslots_projects_link + registrations 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']."' + projectnumber is not null AND + registrations.status='complete' AND + projects.registrations_id=registrations.id AND + projects.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
"; - + projectnumber"; } - echo "id]\" type=\"button\" onclick=\"assign('$r->id')\" value=\"Assign\">"; + else if($_SESSION['viewstate']['judges_projects_list_show']=='unassigned') + { + $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"; + } + $pq=mysql_query($querystr); + echo mysql_error(); + $numprojects=mysql_num_rows($pq); + echo ""; + echo "
"; + echo "$numprojects projects listed"; echo "
"; + echo "
"; + echo "
"; + echo "
"; + + echo ""; + echo ""; + echo ""; + echo ""; + echo ""; + + + while($r=mysql_fetch_object($q)) + { + echo ""; + } + echo "
TimeslotProject
"; + + echo ""; + if($show_date) + echo "$r->date "; + echo substr($r->starttime,0,-3); + echo " - "; + echo substr($r->endtime,0,-3); + 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 "
"; + } + else + { + echo error(i18n("Team has no timeslots assigned to it. Assign Timeslots Here")); + }