Subversion Repositories eFlore/Projets.eflore-projets

Compare Revisions

Ignore whitespace Rev 1169 → Rev 1170

/trunk/services/modules/0.1/chorodep/InfosEspece.php
106,6 → 106,25
protected function getInfosPresenceDepartement($champ_nt_ou_nn, $nt_ou_nn, $departement) {
// Dans le cas où un num nom est demandé on ajoute les synonymes à la recherche
if($champ_nt_ou_nn == "num_nom") {
$url = $this->ajouterHrefAutreProjet('noms', $nt_ou_nn, '/relations/synonymie', 'bdtfx', 'retour.format=min');
$val = (array)$this->consulterHref($url);
if(isset($val['resultat'])) {
$nt_ou_nn_tab = array_keys((array)$val['resultat']);
//print_r($nt_ou_nn_tab);exit;
foreach($nt_ou_nn_tab as &$nnt) {
$nnt = $this->getBdd()->proteger($nnt);
}
$nt_ou_nn = implode(',', $nt_ou_nn_tab);
} else {
$nt_ou_nn = $this->getBdd()->proteger($nt_ou_nn);
}
} else {
$nt_ou_nn = $this->getBdd()->proteger($nt_ou_nn);
}
// Afin de s'assurer d'une valeur numérique
$departement = intval($departement);
// Afin de gérer les noms de colonnes qui commencent par 0 sans imposer de format
114,9 → 133,9
 
$req = "SELECT count(*) > 0 as present".
" FROM ".$this->table.
" WHERE ".$champ_nt_ou_nn." = ".$this->getBdd()->proteger($nt_ou_nn).' AND '.
" WHERE ".$champ_nt_ou_nn." IN (".$nt_ou_nn.") AND ".
"`".$departement."` = 1";
//echo $req;exit;
 
$resultat = $this->getBdd()->recuperer($req);
return $resultat;
}