From 258db162c7688f5c6a8c781adbf7b3b0e1ebf42c Mon Sep 17 00:00:00 2001 From: james Date: Thu, 10 Mar 2005 19:43:49 +0000 Subject: [PATCH] implement system to keep track of which judges are complete make judge teams only list complete judges --- admin/judges_teams.php | 3 ++- register_judges.inc.php | 20 ++++++++++++++++++++ register_judges_expertise.php | 1 + register_judges_main.php | 22 ++++++++++++++++++++-- register_judges_personal.php | 1 + 5 files changed, 44 insertions(+), 3 deletions(-) diff --git a/admin/judges_teams.php b/admin/judges_teams.php index 3a37b88..654d1a7 100644 --- a/admin/judges_teams.php +++ b/admin/judges_teams.php @@ -140,7 +140,8 @@ function delbuttonclicked(team_id,team_num,judge) WHERE judges_years.year='".$config['FAIRYEAR']."' AND judges.id=judges_years.judges_id AND - judges_teams_link.judges_id IS NULL + judges_teams_link.judges_id IS NULL AND + judges.complete='yes' ORDER BY lastname, firstname"; diff --git a/register_judges.inc.php b/register_judges.inc.php index a1951d8..a50f55a 100644 --- a/register_judges.inc.php +++ b/register_judges.inc.php @@ -106,4 +106,24 @@ if(!strstr($_SERVER['PHP_SELF'],"register_judges_password.php")) } } + +//ji = judgeinfo record from database (select * from judges where id='whatever') +function updateJudgeCompleteStatus($ji) +{ + if( personalStatus()=="complete" && + expertiseStatus()=="complete" + ) + $complete="yes"; + else + $complete="no"; + + if($complete!=$ji->complete) + { + mysql_query("UPDATE judges SET complete='$complete' WHERE id='".$ji->id."'"); + } +} + +//finally, if everything else is good, update their 'overall status' if it needs to be +updateJudgeCompleteStatus($judgeinfo); + ?> diff --git a/register_judges_expertise.php b/register_judges_expertise.php index 23c24b9..094319d 100644 --- a/register_judges_expertise.php +++ b/register_judges_expertise.php @@ -64,6 +64,7 @@ } $q=mysql_query("SELECT * FROM judges WHERE email='".$_SESSION['email']."' AND id='".$_SESSION['judges_id']."'"); $judgeinfo=mysql_fetch_object($q); + updateJudgeCompleteStatus($judgeinfo); //output the current status $newstatus=expertiseStatus(); diff --git a/register_judges_main.php b/register_judges_main.php index fcd4ed5..4151b3c 100644 --- a/register_judges_main.php +++ b/register_judges_main.php @@ -81,6 +81,7 @@ } else { + $overallstatus="complete"; echo i18n("Please use the checklist below to complete your registration. Click on an item in the table to edit that information. When you have entered all information, the Status field will change to Complete"); echo "
"; @@ -98,6 +99,7 @@ //check to see if its complete $statuspersonal=personalStatus(); echo outputStatus($statuspersonal); + if($statuspersonal!="complete") $overallstatus="incomplete"; echo ""; /* @@ -122,13 +124,29 @@ //check to see if its complete $statusexpertise=expertiseStatus(); echo outputStatus($statusexpertise); + if($statusexpertise!="complete") $overallstatus="incomplete"; + echo ""; + + echo "
"; + echo "".i18n("Overall Status").""; + echo outputStatus($overallstatus); echo ""; echo ""; - - echo "
"; echo "
"; + + if($overallstatus!="complete") + { + echo error(i18n("You will not be marked as an active judge until your \"Overall Status\" is \"Complete\"")); + } + else + { + echo happy(i18n("Thank you for completing the judge registration process. We look forward to seeing you at the fair")); + } + echo "
"; + + echo i18n("If you are unable to participate as a judge in the %1 %2 please click the deactivate button below to deactivate your judges account for the fair",array($config['FAIRYEAR'],$config['fairname'])); echo "
"; echo "
"; diff --git a/register_judges_personal.php b/register_judges_personal.php index 7469752..e365669 100644 --- a/register_judges_personal.php +++ b/register_judges_personal.php @@ -79,6 +79,7 @@ } $q=mysql_query("SELECT * FROM judges WHERE email='".$_SESSION['email']."' AND id='".$_SESSION['judges_id']."'"); $judgeinfo=mysql_fetch_object($q); + updateJudgeCompleteStatus($judgeinfo); //output the current status $newstatus=personalStatus();