Subversion Repositories Sites.obs-saisons.fr

Compare Revisions

Regard whitespace Rev 170 → Rev 171

/trunk/applications/jrest/services/OdsCommune.php
57,7 → 57,7
$commune = $this->remplacerNomCommunePourRecherche($commune);
$requete_infos_communes = 'SELECT * FROM ods.COMMUNE WHERE COMMUNE_NOM LIKE '.$this->proteger($commune).' ORDER BY COMMUNE_NOM LIMIT 0,10';
$requete_infos_communes = 'SELECT * FROM ods_communes WHERE oc_nom LIKE '.$this->proteger($commune).' ORDER BY oc_nom LIMIT 0,10';
$infos_communes = $this->executerRequete($requete_infos_communes);
104,11 → 104,24
foreach($infos_communes as $commune) {
$cp = $commune['oc_code_insee'];
$limite = 2;
if(strlen($cp) == 4) {
$limite = 1;
}
$dpt = substr($cp,0,$limite);
if($limite == 1) {
$dpt = '0'.$dpt;
}
$infos_formatees[] = array(
'commune' => $commune['COMMUNE_NOM'],
'dpt' => $commune['COMMUNE_CODEPOSTAL'],
'lat' => $commune['COMMUNE_LATITUDE'],
'lon' => $commune['COMMUNE_LONGITUDE']
'commune' => $commune['oc_nom'],
'dpt' => $dpt,
'code_insee' => $commune['oc_code_insee'],
'lat' => $commune['oc_latitude'],
'lon' => $commune['oc_longitude']
);
}
return $infos_formatees;