diff --git a/htdocs/html.form.class.php b/htdocs/html.form.class.php index edbafdf6892..c320d9fdf86 100644 --- a/htdocs/html.form.class.php +++ b/htdocs/html.form.class.php @@ -166,52 +166,52 @@ class Form { */ Function select_forme_juridique($selected='') { - print ''; - // On recherche les formes juridiques actives des pays actifs - $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays FROM llx_c_forme_juridique as f, llx_c_pays as p"; - $sql .= " WHERE f.fk_pays=p.rowid"; - $sql .= " AND f.active = 1 AND p.active = 1 ORDER BY code_pays, code ASC"; - - if ($this->db->query($sql)) + // On recherche les formes juridiques actives des pays actifs + $sql = "SELECT f.rowid, f.code as code , f.libelle as nom, f.active, p.libelle as libelle_pays, p.code as code_pays FROM llx_c_forme_juridique as f, llx_c_pays as p"; + $sql .= " WHERE f.fk_pays=p.rowid"; + $sql .= " AND f.active = 1 AND p.active = 1 ORDER BY code_pays, code ASC"; + + if ($this->db->query($sql)) { - $num = $this->db->num_rows(); - $i = 0; - if ($num) + $num = $this->db->num_rows(); + $i = 0; + if ($num) { - $pays=''; - while ($i < $num) + $pays=''; + while ($i < $num) { - $obj = $this->db->fetch_object( $i); - if ($obj->code == 0) { - print ''; - } - else { - if ($pays == '' || $pays != $obj->libelle_pays) { - // Affiche la rupture - print '\n"; - $pays=$obj->libelle_pays; - } - - if ($selected > 0 && $selected == $obj->code) - { - print ''; - } - else - { - print ''; - } - } - $i++; + $obj = $this->db->fetch_object( $i); + if ($obj->code == 0) { + print ''; + } + else { + if ($pays == '' || $pays != $obj->libelle_pays) { + // Affiche la rupture + print '\n"; + $pays=$obj->libelle_pays; + } + + if ($selected > 0 && $selected == $obj->code) + { + print ''; + } + else + { + print ''; + } + } + $i++; } } } - else { - print "Erreur : $sql : ".$this->db->error(); - } - print ''; + else { + print "Erreur : $sql : ".$this->db->error(); + } + print ''; } - + /* * *