<?php
/***************************************************************************
- * Copyright (C) 2003-2010 Polytechnique.org *
+ * Copyright (C) 2003-2013 Polytechnique.org *
* http://opensource.polytechnique.org/ *
* *
* This program is free software; you can redistribute it and/or modify *
function education_options($current = 0)
{
- $html = '<option value="-1"></option>';
- $res = XDB::iterator("SELECT e.id AS id, gc.countryFR AS country,
+ $html = '<option value="-1"> </option>';
+ $res = XDB::iterator("SELECT e.id AS id, gc.country,
IF(CHAR_LENGTH(e.name) > 76, e.abbreviation, e.name) AS name
FROM profile_education_enum AS e
LEFT JOIN geoloc_countries AS gc ON (e.country = gc.iso_3166_1_a2)
WHERE EXISTS (SELECT *
FROM profile_education_degree AS d
- WHERE e.id = d.eduid)
- ORDER BY gc.countryFR, e.name");
+ WHERE e.id = d.eduid) AND e.name != {?}
+ ORDER BY gc.country, e.name",
+ Profile::EDU_X);
$country = "";
while ($arr_edu = $res->next()) {
if ($arr_edu["country"] != $country) {
+ if ($country) {
+ $html .= '</optgroup>';
+ }
$country = $arr_edu["country"];
- $html .= "<optgroup label=" . $country . ">";
+ $html .= '<optgroup label="' . $country . '">';
}
$html .= '<option value="' . $arr_edu["id"] . '"';
if ($arr_edu["id"] == $current) {
}
$html .= '>' . htmlspecialchars($arr_edu["name"]) . "</option>\n";
}
+ if ($country) {
+ $html .= '</optgroup>';
+ }
return $html;
}