53,71 → 53,55 |
define('EF_URL_CHORO', 'http://www.tela-botanica.org/eflore/BDNFF/4.02/nn/'); |
// 182/chorologie |
|
class NameMap extends Cel { |
|
Class NameMap extends DBAccessor { |
// TODO: voir avec David quoi faire de cette variable inutilisée |
private $extendMapProductor; |
|
|
var $config; |
var $extendMapProductor; |
|
|
function NameMap($config) { |
|
$this->config=$config; |
} |
|
|
|
function getElement($uid){ |
|
|
// Num nomenclatural : recherche nt |
$DB=$this->connectDB($this->config); |
$query = "SELECT DISTINCT b.esn_id_taxon FROM eflore_nom, eflore_nom_rang," . |
" eflore_selection_nom a, eflore_selection_nom b". |
" WHERE a.esn_id_nom= ".$uid[0]. |
" AND a.esn_id_version_projet_taxon = 25 ". |
" AND a.esn_id_taxon=b.esn_id_taxon ". |
" AND b.esn_ce_statut=3 ". |
" AND a.esn_id_version_projet_taxon=b.esn_id_version_projet_taxon" . |
" AND en_ce_rang = enrg_id_rang" . |
" AND en_id_nom = b.esn_id_nom" . |
" AND a.esn_id_version_projet_taxon=en_id_version_projet_nom "; |
|
|
$res =& $DB->query($query); |
|
|
if (DB::isError($res)) { |
die($res->getMessage()); |
} |
$requete_recherche_nt = "SELECT DISTINCT b.esn_id_taxon FROM eflore_nom, eflore_nom_rang," . |
" eflore_selection_nom a, eflore_selection_nom b". |
" WHERE a.esn_id_nom= ".$this->proteger($uid[0]). |
" AND a.esn_id_version_projet_taxon = 25 ". |
" AND a.esn_id_taxon=b.esn_id_taxon ". |
" AND b.esn_ce_statut=3 ". |
" AND a.esn_id_version_projet_taxon=b.esn_id_version_projet_taxon" . |
" AND en_ce_rang = enrg_id_rang" . |
" AND en_id_nom = b.esn_id_nom" . |
" AND a.esn_id_version_projet_taxon=en_id_version_projet_nom "; |
|
$resultat_recherche_nt = $this->requeter($requete_recherche_nt); |
|
$nt = null; |
if (is_array($resultat_recherche_nt) && count($resultat_recherche_nt) > 0) { |
|
} |
|
|
while ($row =& $res->fetchrow(DB_FETCHMODE_ASSOC)) { |
$nt=$row['esn_id_taxon']; |
} |
|
// si le taxon cherché n'existe pas |
if(!$nt) { |
$output = json_encode(array('')); |
print($output); |
exit(); |
} |
|
$nt=$resultat_recherche_nt[0]['esn_id_taxon']; |
|
$retour = array(''); |
|
// si le taxon cherché existe |
if ($nt) { |
$file = EF_URL_CARTO."france_BDNFF_4.02_nt".$nt.".png"; |
$file_headers = @get_headers($file); |
if($file_headers[0] == 'HTTP/1.1 404 Not Found') { |
|
if ($file_headers[0] == 'HTTP/1.1 404 Not Found') { |
} |
else { |
$service=EF_URL_CHORO.$uid[0].'/chorologie'; |
@get_headers($service); |
} |
|
$output = json_encode(array($file)); |
print($output); |
} |
|
$retour = array($file); |
} |
|
$output = json_encode($retour); |
print($output); |
|
} |
|
} |
|
/* +--Fin du code ---------------------------------------------------------------------------------------+ |
127,11 → 111,5 |
* |
* Revision 1.1 2007-06-06 13:31:16 ddelon |
* v0.09 |
* |
* |
* |
* |
*/ |
|
|
?> |
?> |