From: Stéphane Jacob Date: Thu, 21 Aug 2008 13:09:09 +0000 (+0200) Subject: Order educations by country name for better display. X-Git-Tag: xorg/1.0.0~332^2~525 X-Git-Url: http://git.polytechnique.org/?a=commitdiff_plain;h=a5e30e55fc7fae12781c5e91320fadcaaa9cb11e;p=platal.git Order educations by country name for better display. --- diff --git a/include/education.func.inc.php b/include/education.func.inc.php index 2cca09b..64da8f1 100644 --- a/include/education.func.inc.php +++ b/include/education.func.inc.php @@ -22,10 +22,16 @@ function education_options($current = 0) { $html = ''; - $res = XDB::iterator("SELECT * - FROM profile_education_enum - ORDER BY name"); + $res = XDB::iterator("SELECT e.id AS id, e.name AS name, g.pays AS country + FROM profile_education_enum AS e + INNER JOIN geoloc_pays AS g ON (e.country = g.a2) + ORDER BY g.pays, e.name"); + $country = ""; while ($arr_edu = $res->next()) { + if ($arr_edu["country"] != $country) { + $country = $arr_edu["country"]; + $html .= ""; + } $html .= '