6,7 → 6,12 |
/** |
* Fonction d'affichage par défaut |
*/ |
|
|
public function executerActionParDefaut() { |
if (isset($_GET['referentiel'])) { |
Registre::set('parametres.referentiel', $_GET['referentiel']); |
} |
$this->executerAccueil(); |
} |
|
33,9 → 38,11 |
if ($_GET['eflore_nom'] == '') { |
$donnees['information'] = 'Veuillez saisir un radical contenant au moins 3 caractères alphabétiques !'; |
} elseif ($_GET['eflore_type_nom'] == 'nom_vernaculaire') { |
$donnees['nom_approche'] = $_GET['eflore_nom'];//$this->getNomVerna(); |
$noms = new NomsVernaculaires(Config::get('referentielVerna')); |
$donnees['nom_approche'] = $this->rechercherNom($noms); |
} else { |
$donnees['nom_approche'] = $_GET['eflore_nom']; |
$noms = new Noms(Registre::get('parametres.referentiel')); |
$donnees['nom_approche'] = $this->rechercherNom($noms); |
} |
if (isset($donnees)) { |
$donnees['eflore_type_nom'] = $_GET['eflore_type_nom']; |
51,5 → 58,22 |
// envoyerResultat; |
} |
} |
|
public function rechercherNom($noms) { |
$noms_approches = ''; |
$res = $noms->getRechercheEtendue($_GET['eflore_nom']); //print_r($res); |
if ($res == false || $res->entete->total == 0) { |
$res = $noms->getRechercheFloue($_GET['eflore_nom']); |
if (!($res == false || $res->entete->total == 0)) { |
$res = (array) $res->resultat; |
$noms_appr = array_shift($res); //print_r($noms_appr); |
/*foreach ($res->resultat as $id=>$nom) { |
$noms_approches[$id]['nom'] = ($_GET['eflore_type_nom'] == 'nom_vernaculaire') ? $nom->nom : $nom->nom_sci; |
$noms_approches[$id]['url'] = $nom->href; |
}*/ |
} |
} |
return $noms_approches; |
} |
} |
?> |