Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3688 Rev 3689
Line 118... Line 118...
118
								"longitude, ".
118
								"longitude, ".
119
								"wgs84_longitude, ".
119
								"wgs84_longitude, ".
120
								$concatenation_id." as id_coord ".
120
								$concatenation_id." as id_coord ".
121
					'FROM '.$this->table_export.' AS co '.
121
					'FROM '.$this->table_export.' AS co '.
122
                    '   LEFT JOIN cel_zones_geo AS zg '.
122
                    '   LEFT JOIN cel_zones_geo AS zg '.
123
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
123
                    '       ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) '.
124
                    "WHERE ".$transmission.
124
                    "WHERE ".$transmission.
125
                    " (".
125
                    " (".
126
                    $this->construireWhereRectangleStationOR()." OR ".
126
                    $this->construireWhereRectangleStationOR()." OR ".
127
					$this->construireWhereRectangleCommuneOR().") ".
127
					$this->construireWhereRectangleCommuneOR().") ".
128
					$this->construireWhereDept().
128
					$this->construireWhereDept().
Line 159... Line 159...
159
	private function compterObservations($params) {
159
	private function compterObservations($params) {
160
	    $transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
160
	    $transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
161
		$requete =  'SELECT COUNT(*) as nb '.
161
		$requete =  'SELECT COUNT(*) as nb '.
162
					'FROM '.$this->table_export.' AS co '.
162
					'FROM '.$this->table_export.' AS co '.
163
                    '   LEFT JOIN cel_zones_geo AS zg '.
163
                    '   LEFT JOIN cel_zones_geo AS zg '.
164
                    '       ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
164
                    '       ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) '.
165
                    "WHERE ".$transmission.
165
                    "WHERE ".$transmission.
166
                    " (".
166
                    " (".
167
                    $this->construireWhereRectangleStationOR()." OR ".
167
                    $this->construireWhereRectangleStationOR()." OR ".
168
					$this->construireWhereRectangleCommuneOR().") ".
168
					$this->construireWhereRectangleCommuneOR().") ".
169
					$this->construireWhereDept().
169
					$this->construireWhereDept().
Line 353... Line 353...
353
						'	nom_sel, nom_ret, nom_sel_nn, nom_ret_nn, "" as nt, famille, '.
353
						'	nom_sel, nom_ret, nom_sel_nn, nom_ret_nn, "" as nt, famille, '.
354
						'	lieudit, zone_geo, date_observation, milieu, commentaire, '.
354
						'	lieudit, zone_geo, date_observation, milieu, commentaire, '.
355
						'	utm_secteur, utm_x, utm_y, code, date_transmission, nom_referentiel '.
355
						'	utm_secteur, utm_x, utm_y, code, date_transmission, nom_referentiel '.
356
						'FROM '.$this->table_export.' AS co '.
356
						'FROM '.$this->table_export.' AS co '.
357
						'	LEFT JOIN cel_zones_geo AS zg '.
357
						'	LEFT JOIN cel_zones_geo AS zg '.
358
						"		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) ".
358
						"		ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) ".
359
						"WHERE ".$transmission.
359
						"WHERE ".$transmission.
360
						(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
360
						(($this->communeEstDemandee()) ? $this->construireWhereCommuneSansCoordonneesAvecSensibles() : $this->construireWhereCoordonneesSansSensibles()).
361
						$this->construireWhereDept().
361
						$this->construireWhereDept().
362
						$this->construireWherePays().
362
						$this->construireWherePays().
363
						$this->construireWhereUtilisateur().
363
						$this->construireWhereUtilisateur().
Line 501... Line 501...
501
		$json = null;
501
		$json = null;
502
		$transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
502
		$transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
503
		$requete = 	'SELECT SQL_CALC_FOUND_ROWS DISTINCT nom_ret, nom_ret_nn, nt, famille '.
503
		$requete = 	'SELECT SQL_CALC_FOUND_ROWS DISTINCT nom_ret, nom_ret_nn, nt, famille '.
504
					'FROM '.$this->table_export.' AS co '.
504
					'FROM '.$this->table_export.' AS co '.
505
					'	LEFT JOIN cel_zones_geo AS zg '.
505
					'	LEFT JOIN cel_zones_geo AS zg '.
506
					'		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
506
					'		ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) '.
507
					"WHERE ".$transmission.
507
					"WHERE ".$transmission.
508
					"	nom_ret != '' ".
508
					"	nom_ret != '' ".
509
					$this->construireWhereDept().
509
					$this->construireWhereDept().
510
                    $this->construireWhereCommune().
510
                    $this->construireWhereCommune().
511
                    $this->construireWherePays().
511
                    $this->construireWherePays().
Line 763... Line 763...
763
	    $transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
763
	    $transmission = ( $this->standard = 0) ? "transmission = '1' AND " : "";
764
		// Construction de la requête
764
		// Construction de la requête
765
		$requete = 	'SELECT DISTINCT co.id_obs, co.ce_utilisateur AS utilisateur '.
765
		$requete = 	'SELECT DISTINCT co.id_obs, co.ce_utilisateur AS utilisateur '.
766
			'FROM '.$this->table_export.' AS co '.
766
			'FROM '.$this->table_export.' AS co '.
767
			'	LEFT JOIN cel_zones_geo AS zg '.
767
			'	LEFT JOIN cel_zones_geo AS zg '.
768
			'		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) '.
768
			'		ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) '.
769
			"WHERE ".$transmission." co.images != null".
769
			"WHERE ".$transmission." co.images != null".
770
			($type == 'date.creation' ? " AND co.date_creation LIKE $param " : '').
770
			($type == 'date.creation' ? " AND co.date_creation LIKE $param " : '').
771
			($type == 'commentaire.obs' ? "	AND co.commentaire LIKE $param " : '').
771
			($type == 'commentaire.obs' ? "	AND co.commentaire LIKE $param " : '').
772
			($type == 'commentaire.*' ? " AND co.commentaire LIKE $param " : '').
772
			($type == 'commentaire.*' ? " AND co.commentaire LIKE $param " : '').
773
			$this->construireWhereCoordonnees().
773
			$this->construireWhereCoordonnees().
Line 1152... Line 1152...
1152
			$requete = 	'SELECT DISTINCT co.id_observation AS id_obs, co.ce_utilisateur AS utilisateur '.
1152
			$requete = 	'SELECT DISTINCT co.id_observation AS id_obs, co.ce_utilisateur AS utilisateur '.
1153
						'FROM cel_images_export ci'.
1153
						'FROM cel_images_export ci'.
1154
						'	INNER JOIN '.$this->table_export.' AS co '.
1154
						'	INNER JOIN '.$this->table_export.' AS co '.
1155
						'		ON (ci.ce_observation = co.id_observation) '.
1155
						'		ON (ci.ce_observation = co.id_observation) '.
1156
						'	LEFT JOIN cel_zones_geo AS zg '.
1156
						'	LEFT JOIN cel_zones_geo AS zg '.
1157
						"		ON (zg.nom = co.zone_geo AND zg.id_zone_geo = co.ce_zone_geo) ".
1157
						"		ON (zg.nom = co.zone_geo AND zg.code = co.ce_zone_geo) ".
1158
						"WHERE ".$transmission.
1158
						"WHERE ".$transmission.
1159
						$this->construireWhereCoordonnees().
1159
						$this->construireWhereCoordonnees().
1160
						$this->construireWhereUtilisateur().
1160
						$this->construireWhereUtilisateur().
1161
						$this->construireWhereNumTaxon().
1161
						$this->construireWhereNumTaxon().
1162
						$this->construireWhereNomTaxon().
1162
						$this->construireWhereNomTaxon().