Update winners list to properly show more than one school if needed

This commit is contained in:
james 2009-04-14 18:36:34 +00:00
parent db76fa01f7
commit 64d3d6022f

View File

@ -148,6 +148,7 @@ if($_GET['year'] && $_GET['type'])
$studnum=0; $studnum=0;
$students=""; $students="";
$schools=array();
while($studentinfo=mysql_fetch_object($sq)) while($studentinfo=mysql_fetch_object($sq))
{ {
if($studnum>0 && $prev) $students.=", "; if($studnum>0 && $prev) $students.=", ";
@ -166,7 +167,10 @@ if($_GET['year'] && $_GET['type'])
//we will assume that they are coming from the same school, so lets just grab the last students school //we will assume that they are coming from the same school, so lets just grab the last students school
//and use it. //and use it.
$school=$studentinfo->school; if(!in_array($studentinfo->school,$schools))
$schools[]=$studentinfo->school;
// $school=$studentinfo->school;
} }
echo "<br />"; echo "<br />";
echo "&nbsp&nbsp;&nbsp;&nbsp;"; echo "&nbsp&nbsp;&nbsp;&nbsp;";
@ -179,7 +183,11 @@ if($_GET['year'] && $_GET['type'])
echo "<br />"; echo "<br />";
echo "&nbsp&nbsp;&nbsp;&nbsp;"; echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo "&nbsp&nbsp;&nbsp;&nbsp;"; echo "&nbsp&nbsp;&nbsp;&nbsp;";
echo i18n("School").": $school"; echo i18n("School").": ";
$schoollist="";
foreach($schools AS $school) $schoollist.=$school.", ";
$schoollist=substr($schoollist,0,-2);
echo $schoollist;
echo "<br />"; echo "<br />";
} }
else else