Subversion Repositories eFlore/Applications.cel

Rev

Rev 2670 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 2670 Rev 2683
Line 129... Line 129...
129
					$this->construireWherePhotosSeulement().
129
					$this->construireWherePhotosSeulement().
130
					$this->construireWhereProjet().
130
					$this->construireWhereProjet().
131
					$this->construireWhereTag().
131
					$this->construireWhereTag().
132
					$this->construireWhereNombreDeJours().
132
					$this->construireWhereNombreDeJours().
133
					$this->construireWhereAnnee().
133
					$this->construireWhereAnnee().
-
 
134
					$this->construireWhereGroupeZoneGeo().
134
					' GROUP BY id_coord';
135
					' GROUP BY id_coord';
Line 135... Line 136...
135
 
136
 
136
		$resultats_emplacements = Cel::db()->requeter($requete);
137
		$resultats_emplacements = Cel::db()->requeter($requete);
137
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
138
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
Line 167... Line 168...
167
					$this->construireWhereCommentaire().
168
					$this->construireWhereCommentaire().
168
					$this->construireWherePhotosSeulement().
169
					$this->construireWherePhotosSeulement().
169
					$this->construireWhereProjet().
170
					$this->construireWhereProjet().
170
					$this->construireWhereTag().
171
					$this->construireWhereTag().
171
					$this->construireWhereNombreDeJours().
172
					$this->construireWhereNombreDeJours().
172
					$this->construireWhereAnnee();
173
					$this->construireWhereAnnee().
-
 
174
					$this->construireWhereGroupeZoneGeo();
Line 173... Line 175...
173
 
175
 
174
		$resultats_nb_obs = Cel::db()->requeter($requete);
176
		$resultats_nb_obs = Cel::db()->requeter($requete);
175
		return $resultats_nb_obs[0]['nb'];
177
		return $resultats_nb_obs[0]['nb'];
Line 353... Line 355...
353
						$this->construireWhereCommentaire().
355
						$this->construireWhereCommentaire().
354
						$this->construireWherePhotosSeulement().
356
						$this->construireWherePhotosSeulement().
355
						$this->construireWhereProjet().
357
						$this->construireWhereProjet().
356
						$this->construireWhereTag().
358
						$this->construireWhereTag().
357
						$this->construireWhereNombreDeJours().
359
						$this->construireWhereNombreDeJours().
358
					$this->construireWhereAnnee().
360
						$this->construireWhereAnnee().
-
 
361
						$this->construireWhereGroupeZoneGeo().
359
	                    'ORDER BY nom_sel ASC '.
362
	                    'ORDER BY nom_sel ASC '.
360
	                    "LIMIT {$this->start},{$this->limit} ";
363
	                    "LIMIT {$this->start},{$this->limit} ";
361
			//echo $requete;exit;
364
			//echo $requete;exit;
362
			$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
365
			$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
363
			$requete = 'SELECT FOUND_ROWS()';
366
			$requete = 'SELECT FOUND_ROWS()';
Line 502... Line 505...
502
					$this->construireWherePhotosSeulement().
505
					$this->construireWherePhotosSeulement().
503
					$this->construireWhereProjet().
506
					$this->construireWhereProjet().
504
					$this->construireWhereTag().
507
					$this->construireWhereTag().
505
					$this->construireWhereNombreDeJours().
508
					$this->construireWhereNombreDeJours().
506
					$this->construireWhereAnnee().
509
					$this->construireWhereAnnee().
-
 
510
					$this->construireWhereGroupeZoneGeo().
507
					'ORDER BY nom_ret ASC '.
511
					'ORDER BY nom_ret ASC '.
508
                    "LIMIT {$this->start},{$this->limit} ";
512
                    "LIMIT {$this->start},{$this->limit} ";
509
		//$this->debug[] = $requete;
513
		//$this->debug[] = $requete;
510
		$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
514
		$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
511
		//echo $requete;exit;
515
		//echo $requete;exit;
Line 765... Line 769...
765
			$this->construireWhereNumTaxon().
769
			$this->construireWhereNumTaxon().
766
			$this->construireWhereNomTaxon().
770
			$this->construireWhereNomTaxon().
767
			$this->construireWhereReferentiel().
771
			$this->construireWhereReferentiel().
768
			$this->construireWhereProjet().
772
			$this->construireWhereProjet().
769
			$this->construireWhereTag().
773
			$this->construireWhereTag().
-
 
774
			$this->construireWhereGroupeZoneGeo().
770
			'ORDER BY utilisateur ASC, ordre ASC';
775
			'ORDER BY utilisateur ASC, ordre ASC';
771
		//$this->debug[] = $requete;
776
		//$this->debug[] = $requete;
772
		//die($requete);
777
		//die($requete);
773
		$resultats = Cel::db()->requeter($requete);
778
		$resultats = Cel::db()->requeter($requete);
Line 1102... Line 1107...
1102
		if (isset($annee) && !$this->etreNull($annee)) {
1107
		if (isset($annee) && !$this->etreNull($annee)) {
1103
			$sql = ' AND YEAR(co.date_creation) = ' . Cel::db()->proteger($annee) . ' ';
1108
			$sql = ' AND YEAR(co.date_creation) = ' . Cel::db()->proteger($annee) . ' ';
1104
		}
1109
		}
1105
		return $sql;
1110
		return $sql;
1106
	}
1111
	}
-
 
1112
	
-
 
1113
	private function construireWhereGroupeZoneGeo() {
-
 
1114
		$sql = null;
-
 
1115
		extract($this->parametres);
-
 
1116
		if (isset($groupe_zones_geo) && !$this->etreNull($groupe_zones_geo)) {
-
 
1117
			$req = "SELECT valeur FROM cel_groupes_zones WHERE id_groupe = ".Cel::db()->proteger($groupe_zones_geo);
-
 
1118
			$res = Cel::db()->requeter($req);
-
 
1119
 
-
 
1120
			$zones = array();
-
 
1121
			foreach($res as &$r) {
-
 
1122
				$zones[] = Cel::db()->proteger($r['valeur']);
-
 
1123
			}
-
 
1124
			$sql = 'AND ce_zone_geo IN ('.implode(',', $zones).') ';
-
 
1125
		}
-
 
1126
		
-
 
1127
		return $sql;
-
 
1128
	}
Line 1107... Line 1129...
1107
 
1129
 
1108
	/**
1130
	/**
1109
	 * Traitement de $tag pour construction du filtre dans la requête
1131
	 * Traitement de $tag pour construction du filtre dans la requête
1110
	 */
1132
	 */