Subversion Repositories eFlore/Applications.cel

Rev

Rev 3602 | Rev 3617 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3602 Rev 3616
Line 101... Line 101...
101
		imagesavealpha($img, true);
101
		imagesavealpha($img, true);
Line 102... Line 102...
102
 
102
 
103
		return array('type' => 'png', 'img' => $img);
103
		return array('type' => 'png', 'img' => $img);
Line 104... Line 104...
104
	}
104
	}
Line 105... Line 105...
105
 
105
 
106
	public function getTout($params) {
106
	public function getTout($params) { 
Line 107... Line 107...
107
 
107
 
Line 118... Line 118...
118
					'FROM cel_export_total AS co '.
118
					'FROM cel_export_total AS co '.
119
                    '   LEFT JOIN cel_zones_geo AS zg '.
119
                    '   LEFT JOIN cel_zones_geo AS zg '.
120
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
120
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
121
                    "WHERE transmission = '1' ".
121
                    "WHERE transmission = '1' ".
122
                    $this->standard.
122
                    $this->standard.
123
					" AND (".
123
                    " AND (".
-
 
124
                    (($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
124
					$this->construireWhereRectangleStationOR()." OR ".
125
					$this->construireWhereRectangleStationOR()." OR ".
125
					$this->construireWhereRectangleCommuneOR().") ".
126
					$this->construireWhereRectangleCommuneOR().") ".
126
					$this->construireWhereDept().
127
					$this->construireWhereDept().
127
                    $this->construireWhereCommune().
128
                    $this->construireWhereCommune().
128
                    $this->construireWherePays().
129
                    $this->construireWherePays().
Line 159... Line 160...
159
					'FROM cel_export_total AS co '.
160
					'FROM cel_export_total AS co '.
160
                    '   LEFT JOIN cel_zones_geo AS zg '.
161
                    '   LEFT JOIN cel_zones_geo AS zg '.
161
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
162
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
162
                    "WHERE transmission = '1' ".
163
                    "WHERE transmission = '1' ".
163
                    $this->standard.
164
                    $this->standard.
164
					" AND (".
165
                    " AND (".
-
 
166
                    (($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
165
					$this->construireWhereRectangleStationOR()." OR ".
167
					$this->construireWhereRectangleStationOR()." OR ".
166
					$this->construireWhereRectangleCommuneOR().") ".
168
					$this->construireWhereRectangleCommuneOR().") ".
167
					$this->construireWhereDept().
169
					$this->construireWhereDept().
168
                    $this->construireWhereCommune().
170
                    $this->construireWhereCommune().
169
                    $this->construireWherePays().
171
                    $this->construireWherePays().
Line 977... Line 979...
977
 
979
 
978
 
980
 
979
	private function construireWherePhotosSeulement() {
981
	private function construireWherePhotosSeulement() {
980
		$sql = '';
982
		$sql = '';
981
		if (isset($this->parametres['photos']) && $this->parametres['photos'] == 1) {
983
		if (isset($this->parametres['photos']) && $this->parametres['photos'] == 1) {
982
			$sql = 'AND co.id_observation IN (SELECT DISTINCT ce_observation FROM cel_images) ';
984
			$sql = 'AND co.id_observation IN (SELECT DISTINCT ce_observation FROM cel_images_export) ';
983
		}
985
		}
Line 984... Line 986...
984
		return $sql;
986
		return $sql;
Line 1144... Line 1146...
1144
	private function getSqlWhereObsAvecImagesTaguees($tag) {
1146
	private function getSqlWhereObsAvecImagesTaguees($tag) {
1145
		$sql = null;
1147
		$sql = null;
1146
		if (isset($tag) && !$this->etreNull($tag)) {
1148
		if (isset($tag) && !$this->etreNull($tag)) {
1147
			$tag_sql = $this->getSqlWhereMotsCles($tag);
1149
			$tag_sql = $this->getSqlWhereMotsCles($tag);
1148
			// Construction de la requête
1150
			// Construction de la requête
1149
			$requete = 	'SELECT DISTINCT co.id_observation AS id_obs, ci.ce_utilisateur AS utilisateur '.
1151
			$requete = 	'SELECT DISTINCT co.id_observation AS id_obs, co.ce_utilisateur AS utilisateur '.
1150
						'FROM photo ci'.
1152
						'FROM cel_images_export ci'.
1151
						'	INNER JOIN cel_obs AS co '.
1153
						'	INNER JOIN cel_export_total AS co '.
1152
						'		ON (ci.ce_observation = co.id_observation) '.
1154
						'		ON (ci.ce_observation = co.id_observation) '.
1153
						'	LEFT JOIN cel_zones_geo AS zg '.
1155
						'	LEFT JOIN cel_zones_geo AS zg '.
1154
						"		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) ".
1156
						"		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) ".
1155
						"WHERE co.transmission = '1' ".
1157
						"WHERE co.transmission = '1' ".
1156
						$this->standard.
1158
						$this->standard.