Always show the city in the school access login page, and sort it first by city then school name (previously it only showed the city for duplicate school names)

This commit is contained in:
james 2008-02-27 15:59:03 +00:00
parent f70314653b
commit 17745cbb0a

View File

@ -234,15 +234,9 @@ else
<select name="schoolid"> <select name="schoolid">
<option value=""><?=i18n("Choose your school")?></option> <option value=""><?=i18n("Choose your school")?></option>
<? <?
$q=mysql_query("SELECT id,school,city FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER BY school"); $q=mysql_query("SELECT id,school,city FROM schools WHERE year='".$config['FAIRYEAR']."' ORDER BY city,school");
$prev="somethingthatdoesnotexist"; while($r=mysql_fetch_object($q)) {
while($r=mysql_fetch_object($q)) echo "<option $sel value=\"$r->id\">".htmlspecialchars($r->city).' - '.htmlspecialchars($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> </select>