106,6 → 106,24 |
|
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']); |
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,7 → 132,7 |
|
$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"; |
|
$resultat = $this->getBdd()->recuperer($req); |