forked from science-ation/science-ation
If all the schools are the same, then only show the school name once, instead of once for each student.
This commit is contained in:
parent
d209b0648f
commit
e2ee104434
@ -133,12 +133,21 @@
|
|||||||
$studnum=1;
|
$studnum=1;
|
||||||
$schools="";
|
$schools="";
|
||||||
$students="";
|
$students="";
|
||||||
|
$sameschools=true;
|
||||||
|
$lastschool="";
|
||||||
while($studentinfo=mysql_fetch_object($sq))
|
while($studentinfo=mysql_fetch_object($sq))
|
||||||
{
|
{
|
||||||
$students.="$studentinfo->firstname $studentinfo->lastname<br />";
|
$students.="$studentinfo->firstname $studentinfo->lastname<br />";
|
||||||
$schools.="$studentinfo->school <br />";
|
$schools.="$studentinfo->school <br />";
|
||||||
|
if($lastschool)
|
||||||
|
{
|
||||||
|
if($lastschool!=$studentinfo->school)
|
||||||
|
$sameschools=false;
|
||||||
|
}
|
||||||
|
$lastschool=$studentinfo->school;
|
||||||
$stats_totalstudents++;
|
$stats_totalstudents++;
|
||||||
}
|
}
|
||||||
|
if($sameschools) $schools=$lastschool;
|
||||||
echo "<td>$schools</td>";
|
echo "<td>$schools</td>";
|
||||||
echo "<td>$students</td>";
|
echo "<td>$students</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
|
Loading…
x
Reference in New Issue
Block a user