+ $html.= '<option value="0"'.($valeur==0?$sel:"")."></option>\n";
+ }
+ $optgrp = null;
+ while (list($my_id,$my_text,$my_grp) = $res->next()) {
+ if ($my_grp != $optgrp) {
+ if (!is_null($optgrp)) {
+ $html .= '</optgroup>';
+ }
+ $html .= '<optgroup label="' . pl_entities($my_grp, ENT_QUOTES) . '">';
+ $optgrp = $my_grp;
+ }
+ $html .= sprintf("<option value=\"%s\" %s>%s</option>\n",
+ $my_id, $valeur==$my_id ? $sel : "", pl_entities($my_text));