Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 1482 Rev 1484
Line 169... Line 169...
169
					$this->construireWhereNomTaxon().
169
					$this->construireWhereNomTaxon().
170
					$this->construireWhereDate().
170
					$this->construireWhereDate().
171
					$this->construireWhereCommentaire().
171
					$this->construireWhereCommentaire().
172
					$this->construireWherePhotosSeulement().
172
					$this->construireWherePhotosSeulement().
173
					$this->construireWhereProjet().
173
					$this->construireWhereProjet().
174
					$this->construireWhereTag().' GROUP BY id_coord';
174
					$this->construireWhereTag().
175
		
-
 
-
 
175
					$this->construireWhereNombreDeJours().
176
		//echo $requete;exit;
176
					' GROUP BY id_coord';
Line 177... Line 177...
177
 
177
 
178
		$resultats_emplacements = $this->executerRequete($requete);
178
		$resultats_emplacements = $this->executerRequete($requete);
179
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
179
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
180
		return $emplacements;
180
		return $emplacements;
Line 205... Line 205...
205
					$this->construireWhereNomTaxon().
205
					$this->construireWhereNomTaxon().
206
					$this->construireWhereDate().
206
					$this->construireWhereDate().
207
					$this->construireWhereCommentaire().
207
					$this->construireWhereCommentaire().
208
					$this->construireWherePhotosSeulement().
208
					$this->construireWherePhotosSeulement().
209
					$this->construireWhereProjet().
209
					$this->construireWhereProjet().
210
					$this->construireWhereTag();
210
					$this->construireWhereTag().
-
 
211
					$this->construireWhereNombreDeJours();
211
		//echo $requete;exit;
212
		//echo $requete;exit;
212
		$resultats_nb_obs = $this->executerRequete($requete);
213
		$resultats_nb_obs = $this->executerRequete($requete);
213
		return $resultats_nb_obs[0]['nb'];
214
		return $resultats_nb_obs[0]['nb'];
214
	}
215
	}
Line 388... Line 389...
388
						$this->construireWhereDate().
389
						$this->construireWhereDate().
389
						$this->construireWhereCommentaire().
390
						$this->construireWhereCommentaire().
390
						$this->construireWherePhotosSeulement().
391
						$this->construireWherePhotosSeulement().
391
						$this->construireWhereProjet().
392
						$this->construireWhereProjet().
392
						$this->construireWhereTag().
393
						$this->construireWhereTag().
-
 
394
						$this->construireWhereNombreDeJours().
393
	                    'ORDER BY nom_sel ASC '.
395
	                    'ORDER BY nom_sel ASC '.
394
	                    "LIMIT {$this->start},{$this->limit} ";
396
	                    "LIMIT {$this->start},{$this->limit} ";
395
			//echo $requete;exit;
397
			//echo $requete;exit;
396
			$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
398
			$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
397
			$requete = 'SELECT FOUND_ROWS()';
399
			$requete = 'SELECT FOUND_ROWS()';
Line 540... Line 542...
540
					$this->construireWhereDate().
542
					$this->construireWhereDate().
541
					$this->construireWhereCommentaire().
543
					$this->construireWhereCommentaire().
542
					$this->construireWherePhotosSeulement().
544
					$this->construireWherePhotosSeulement().
543
					$this->construireWhereProjet().
545
					$this->construireWhereProjet().
544
					$this->construireWhereTag().
546
					$this->construireWhereTag().
-
 
547
					$this->construireWhereNombreDeJours().
545
					'ORDER BY nom_ret ASC '.
548
					'ORDER BY nom_ret ASC '.
546
                    "LIMIT {$this->start},{$this->limit} ";
549
                    "LIMIT {$this->start},{$this->limit} ";
547
		//$this->debug[] = $requete;
550
		//$this->debug[] = $requete;
548
		$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
551
		$resultats = $this->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
549
		//echo $requete;exit;
552
		//echo $requete;exit;
Line 1034... Line 1037...
1034
			$sql = " AND ($tag_sql) ";
1037
			$sql = " AND ($tag_sql) ";
1035
		}
1038
		}
1036
		return $sql;
1039
		return $sql;
1037
	}
1040
	}
Line -... Line 1041...
-
 
1041
	
-
 
1042
	private function construireWhereNombreDeJours() {
-
 
1043
		$sql = null;
-
 
1044
		extract($this->parametres);
-
 
1045
		if (isset($nbjours) && !$this->etreNull($nbjours)) {
-
 
1046
			$sql = ' AND DATEDIFF(CURDATE(),co.date_creation) <= '.$this->proteger($nbjours).' ';
-
 
1047
		}
-
 
1048
		return $sql;
-
 
1049
	}
1038
	
1050
	
1039
	/**
1051
	/**
1040
	 * Traitement de $tag pour construction du filtre dans la requête
1052
	 * Traitement de $tag pour construction du filtre dans la requête
1041
	 */
1053
	 */
1042
	private function getSqlWhereObsAvecImagesTaguees($tag) {
1054
	private function getSqlWhereObsAvecImagesTaguees($tag) {