Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 3080 Rev 3666
Line 220... Line 220...
220
		$info = (int) Cel::db()->requeterValeurUnique($requete);
220
		$info = (int) Cel::db()->requeterValeurUnique($requete);
221
		return $info;
221
		return $info;
222
	}
222
	}
Line 223... Line 223...
223
 
223
 
224
	private function construireRequeteNbreObs() {
224
	private function construireRequeteNbreObs() {
225
		$requete = 	'SELECT COUNT(id_observation) AS nbre '.
225
		$requete = 	'SELECT COUNT(id) AS nbre '.
Line 226... Line 226...
226
					'FROM cel_obs ';
226
					'FROM cel_obs ';
227
 
227
 
228
		if (count($this->parametres) != 0) {
228
		if (count($this->parametres) != 0) {
Line 229... Line 229...
229
			$filtres = array();
229
			$filtres = array();
230
			extract($this->parametres);
230
			extract($this->parametres);
231
 
231
 
232
			if (isset($utilisateur)) {
232
			if (isset($utilisateur)) {
233
				$filtres[] = "courriel_utilisateur = $utilisateur ";
233
				$filtres[] = "user_email = $utilisateur ";
234
			}
234
			}
235
			if (isset($num_taxon)) {
235
			if (isset($num_taxon)) {
236
				$filtres[] = "num_taxon = $num_taxon ";
236
				$filtres[] = "accepted_sci_name_id = $num_taxon ";
237
			}
237
			}
Line 238... Line 238...
238
			if (isset($taxon)) {
238
			if (isset($taxon)) {
239
				$filtres[] = "nom_ret LIKE $taxon ";
239
				$filtres[] = "accepted_sci_name LIKE $taxon ";
Line 240... Line 240...
240
			}
240
			}
241
 
241
 
Line 242... Line 242...
242
			$requete .= ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
242
			$requete .= ((count($filtres) > 0) ? 'WHERE '.implode(' AND ', $filtres) : '');
243
		}
243
		}
244
 
244
 
245
		return $requete;
245
		return $requete;
Line 246... Line 246...
246
	}
246
	}
247
 
247
 
248
	private function construireRequeteNbreObsPubliques() {
248
	private function construireRequeteNbreObsPubliques() {
Line 249... Line 249...
249
		$requete = 	'SELECT COUNT(id_observation) AS nbre '.
249
		$requete = 	'SELECT COUNT(id) AS nbre '.
250
					'FROM cel_obs '.
250
					'FROM cel_obs '.
251
					"WHERE transmission = 1 ";
251
					"WHERE is_public = 1 ";
252
 
252
 
253
		if (count($this->parametres) != 0) {
253
		if (count($this->parametres) != 0) {
254
			$filtres = array();
254
			$filtres = array();
255
			extract($this->parametres);
255
			extract($this->parametres);
256
 
256
 
257
			if (isset($utilisateur)) {
257
			if (isset($utilisateur)) {
Line 258... Line 258...
258
				$filtres[] = "courriel_utilisateur = $utilisateur ";
258
				$filtres[] = "user_email = $utilisateur ";
259
			}
259
			}