diff --git a/admin/judges_teams_projects.php b/admin/judges_teams_projects.php index 00d5b16..16ca8cf 100644 --- a/admin/judges_teams_projects.php +++ b/admin/judges_teams_projects.php @@ -49,6 +49,12 @@ function assign(ts) if($_GET['edit']) $edit=$_GET['edit']; else if($_POST['edit']) $edit=$_POST['edit']; +if(!$_SESSION['viewstate']['judges_projects_list_show']) + $_SESSION['viewstate']['judges_projects_list_show']='unassigned'; +//now update the judges_teams_list_show viewstate +if($_GET['judges_projects_list_show']) + $_SESSION['viewstate']['judges_projects_list_show']=$_GET['judges_projects_list_show']; + if($_GET['action']=="delete" && $_GET['delete'] && $_GET['edit']) { @@ -96,8 +102,50 @@ function assign(ts) echo $memberlist; echo "
"; +/* + if($_SESSION['viewstate']['judges_teams_list_show']=='all') + { + $querystr="SELECT + judges.id, + judges.firstname, + judges.lastname + FROM + judges, + judges_years + WHERE + judges_years.year='".$config['FAIRYEAR']."' AND + judges.id=judges_years.judges_id AND + judges.complete='yes' + ORDER BY + lastname, + firstname"; + } + else + { + $querystr="SELECT + judges.id, + judges.firstname, + judges.lastname, + judges_teams_link.judges_id + FROM + judges + LEFT JOIN judges_teams_link ON judges.id = judges_teams_link.judges_id, + judges_years + WHERE + judges_years.year='".$config['FAIRYEAR']."' AND + judges.id=judges_years.judges_id AND + judges_teams_link.judges_id IS NULL AND + judges.complete='yes' + ORDER BY + lastname, + firstname"; + } - $q=mysql_query("SELECT + +*/ + if($_SESSION['viewstate']['judges_projects_list_show']=='all') + { + $querystr="SELECT projects.id, projects.projectnumber, projects.title, @@ -111,11 +159,49 @@ function assign(ts) projects.registrations_id=registrations.id AND projects.year='".$config['FAIRYEAR']."' ORDER BY - projectnumber - "); - echo mysql_error(); + 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') + { + echo ""; + 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 "
"; //get the timeslots that this team has. @@ -189,7 +278,7 @@ function assign(ts) echo mysql_Error(); while($proj=mysql_fetch_object($projq)) { - echo "link_id."&edit=".$team['id']."\">"; + echo "link_id."&edit=".$team['id']."\">"; echo "$proj->projectnumber - $proj->title
"; }