Subversion Repositories eFlore/Applications.cel

Compare Revisions

Ignore whitespace Rev 1032 → Rev 1033

/trunk/jrest/services/CelWidgetMap.php
70,8 → 70,8
public function getIconeGroupe($params) {
extract($this->parametres);
 
//TODO: changer ceci pour une adresse indiquée dans un fichier de config
$img = imagecreatefrompng("/home/aurelien/web/cel_GWT2/widget/documents/icones/carto/groupe/g$type.png");
$chemin_marqueur = sprintf($this->config['settings']['cheminCelMarkerObsTpl'], $type);
$img = imagecreatefrompng($chemin_marqueur);
 
$noir = imagecolorallocate($img, 0, 0, 0);
$texte = (String) $nbre;
149,18 → 149,18
") as type_emplacement, ".
"IF ((coord_x != '000null' AND coord_x != '' ".
" AND coord_y != '000null' AND coord_y != ''), ".
"ROUND(coord_x,5), ".
"ROUND(wgs84_latitude,5) ".
"coord_x, ".
"wgs84_latitude ".
") as lat, ".
"IF ((coord_x != '000null' AND coord_x != '' ".
" AND coord_y != '000null' AND coord_y != ''), ".
"ROUND(coord_y,5), ".
"ROUND(wgs84_longitude,5) ".
"coord_y, ".
"wgs84_longitude ".
") as lng, ".
"IF ((coord_x != '000null' AND coord_x != '' ".
" AND coord_y != '000null' AND coord_y != ''), ".
'CONCAT("'.self::MARQUEUR_STATION.':",ROUND(coord_x,5),"|",ROUND(coord_y,5)), '.
'CONCAT("'.self::MARQUEUR_COMMUNE.':",ROUND(wgs84_latitude,5),"|",ROUND(wgs84_longitude,5)) '.
'CONCAT("'.self::MARQUEUR_STATION.':",coord_x,"|",coord_y), '.
'CONCAT("'.self::MARQUEUR_COMMUNE.':",wgs84_latitude,"|",wgs84_longitude) '.
") as id ".
'FROM cel_inventory AS i '.
' LEFT JOIN locations AS l '.
167,13 → 167,14
' ON (l.name = i.location AND l.code = i.id_location) '.
"WHERE transmission = '1' ".
" AND (".
"(".$this->construireWhereRectangleStationOR().
" AND (mots_cles_texte IS NULL OR mots_cles_texte NOT LIKE '%sensible%') ".
"(".($this->construireWhereRectangleStationOR() != null ? $this->construireWhereRectangleStationOR().' AND ' : '').
" (mots_cles_texte IS NULL OR mots_cles_texte NOT LIKE '%sensible%') ".
")".
" OR ".
" ( ".
$this->construireWhereRectangleCommuneOR().
" OR mots_cles_texte LIKE '%sensible%' ".
"(".($this->construireWhereRectangleCommuneOR() != null ? $this->construireWhereRectangleCommuneOR().' Or ' : '').
" mots_cles_texte LIKE '%sensible%' ".
")".
" ) ".
") ".
$this->construireWhereDept().
186,6 → 187,7
$this->construireWhereProjet().
$this->construireWhereTag();
 
 
$resultats_emplacements = $this->executerRequete($requete);
$emplacements = $this->traiterEmplacements($resultats_emplacements);
 
361,9 → 363,8
$this->construireWhereTag().
'ORDER BY nom_sel ASC '.
"LIMIT {$this->start},{$this->limit} ";
//die($requete);
 
$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
 
$requete = 'SELECT FOUND_ROWS()';
$total = (int) $this->requeter($requete, self::SQL_RETOUR_COLONNE);
}
545,7 → 546,7
if ($type == self::MARQUEUR_COMMUNE) {
$lat = $this->proteger($lat);
$lng = $this->proteger($lng);
$sql = " AND (wgs84_latitude = $lat AND wgs84_longitude = $lng) ";
$sql = " AND (ROUND(wgs84_latitude,5) = ROUND($lat,5) AND ROUND(wgs84_longitude,5) = ROUND($lng,5)) ";
} else if ($type == self::MARQUEUR_STATION) {
$lat = $this->proteger($lat);
$lng = $this->proteger($lng);
1123,8 → 1124,8
if (isset($this->parametres['station'])) {
$station = $this->parametres['station'];
$this->debug[] = $station;
list($type, $coord) = explode(':', $station);
list($lat, $lng) = explode('|', $coord);
@list($type, $coord) = explode(':', $station);
@list($lat, $lng) = explode('|', $coord);
 
$station_infos = array('type' => $type, 'lat' => $lat, 'lng' => $lng);
}