diff --git a/admin/cwsfregister.php b/admin/cwsfregister.php index 14c9a74b..4a0f9a12 100644 --- a/admin/cwsfregister.php +++ b/admin/cwsfregister.php @@ -28,11 +28,11 @@ include "xml.inc.php"; { global $config; $winners=array(); + $winners_ids=array(); $q=mysql_query("SELECT * FROM award_awards WHERE cwsfaward='1' AND year='".$config['FAIRYEAR']."'"); - if(mysql_num_rows($q)==1) + while($award=mysql_fetch_object($q)) { - $award=mysql_fetch_object($q); $pq=mysql_query("SELECT * FROM award_prizes WHERE award_awards_id='$award->id'"); while($prize=mysql_fetch_object($pq)) { @@ -55,6 +55,11 @@ include "xml.inc.php"; echo mysql_error(); while($project=mysql_fetch_object($wq)) { + if(array_key_exists($project->id, $winners_ids)) { + continue; + } else { + $winners_ids[$project->id] = true; + } $sq=mysql_query("SELECT * FROM students WHERE registrations_id='$project->registrations_id' AND year='".$config['FAIRYEAR']."'"); $students=array(); $cwsf_agecategory=0; @@ -194,15 +199,14 @@ include "xml.inc.php"; echo error(i18n("Cannot find an award that is specified as the Canada-Wide Science Fair Award")); echo i18n("Please go to the awards manager and select which award identifies your CWSF students"); } - else if(mysql_num_rows($q)>1) - { - echo error(i18n("There is more than one award that is identified as your Canada-Wide Science Fair award.")); - echo i18n("Please go to the awards manager and choose only one award that identifies your CWSF students"); - } else { - $award=mysql_fetch_object($q); - echo "".i18n("CWSF Award").": ".$award->name."
"; + echo "".i18n("CWSF Awards").":
"; + echo ""; echo i18n("Please review the list of winning projects/students below. If it is all correct then you can click the 'Register for CWSF' button at the bottom of the page to send the information to YSC"); echo "
"; echo "
";