From 0d365bc731f96ed21cc8c0181b2aed9ffe909b75 Mon Sep 17 00:00:00 2001 From: james Date: Thu, 3 Mar 2011 01:46:37 +0000 Subject: [PATCH] mentors are also incomplete if we have less than we say we're gonna have --- participant.inc.php | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/participant.inc.php b/participant.inc.php index 544a2cc..24280d9 100644 --- a/participant.inc.php +++ b/participant.inc.php @@ -181,26 +181,26 @@ function mentorStatus($reg_id="") if($r->nummentors==null) return "incomplete"; + //grab all the mentors for this registration $q=mysql_query("SELECT * FROM mentors WHERE registrations_id='$rid' AND conferences_id='".$conference['id']."'"); //if we dont have the minimum, return incomplete if(mysql_num_rows($q)<$config['minmentorserproject']) return "incomplete"; - while($r=mysql_fetch_object($q)) - { - foreach ($required_fields AS $req) - { - if(!$r->$req) - { + //and if we have less than they say we're gonna have, we're also incomplete + if(mysql_num_rows($q)<$r->nummentors) + return "incomplete"; + + while($r=mysql_fetch_object($q)) { + foreach ($required_fields AS $req) { + if(!$r->$req) { return "incomplete"; } } } - //if it made it through without returning incomplete, then we must be complete return "complete"; - } function safetyStatus($reg_id="")