Show the school list sorted alphabetically, and if two schools ahve the same name, put the city after teh school name in brackets.

This commit is contained in:
james 2006-02-06 15:58:34 +00:00
parent b807381418
commit cbfd619af7

View File

@ -221,10 +221,15 @@ else
<select name="schoolid">
<option value=""><?=i18n("Choose your school")?></option>
<?
$q=mysql_query("SELECT id,school FROM schools WHERE year='".$config['FAIRYEAR']."'");
$q=mysql_query("SELECT id,school,city FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER BY school");
$prev="somethingthatdoesnotexist";
while($r=mysql_fetch_object($q))
{
echo "<option value=\"$r->id\">$r->school</option>\n";
if($r->school==$prev)
echo "<option value=\"$r->id\">$r->school ($r->city)</option>\n";
else
echo "<option value=\"$r->id\">$r->school</option>\n";
$prev=$r->school;
}
?>
</select>