From a5e30e55fc7fae12781c5e91320fadcaaa9cb11e Mon Sep 17 00:00:00 2001 From: =?utf8?q?St=C3=A9phane=20Jacob?= Date: Thu, 21 Aug 2008 15:09:09 +0200 Subject: [PATCH] Order educations by country name for better display. --- include/education.func.inc.php | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) 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 .= '