Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 2282 Rev 2291
Line 123... Line 123...
123
					$this->construireWhereCommentaire().
123
					$this->construireWhereCommentaire().
124
					$this->construireWherePhotosSeulement().
124
					$this->construireWherePhotosSeulement().
125
					$this->construireWhereProjet().
125
					$this->construireWhereProjet().
126
					$this->construireWhereTag().
126
					$this->construireWhereTag().
127
					$this->construireWhereNombreDeJours().
127
					$this->construireWhereNombreDeJours().
-
 
128
					$this->construireWhereAnnee().
128
					' GROUP BY id_coord';
129
					' GROUP BY id_coord';
Line 129... Line 130...
129
 
130
 
130
		$resultats_emplacements = Cel::db()->requeter($requete);
131
		$resultats_emplacements = Cel::db()->requeter($requete);
131
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
132
		$emplacements = $this->traiterEmplacements($resultats_emplacements, $this->compterObservations($params));
Line 160... Line 161...
160
					$this->construireWhereCommentaire().
161
					$this->construireWhereCommentaire().
161
					$this->construireWherePhotosSeulement().
162
					$this->construireWherePhotosSeulement().
162
					$this->construireWhereProjet().
163
					$this->construireWhereProjet().
163
					$this->construireWhereTag().
164
					$this->construireWhereTag().
164
					$this->construireWhereNombreDeJours();
165
					$this->construireWhereNombreDeJours();
-
 
166
					$this->construireWhereAnnee().
Line 165... Line 167...
165
 
167
 
166
		$resultats_nb_obs = Cel::db()->requeter($requete);
168
		$resultats_nb_obs = Cel::db()->requeter($requete);
167
		return $resultats_nb_obs[0]['nb'];
169
		return $resultats_nb_obs[0]['nb'];
Line 344... Line 346...
344
						$this->construireWhereCommentaire().
346
						$this->construireWhereCommentaire().
345
						$this->construireWherePhotosSeulement().
347
						$this->construireWherePhotosSeulement().
346
						$this->construireWhereProjet().
348
						$this->construireWhereProjet().
347
						$this->construireWhereTag().
349
						$this->construireWhereTag().
348
						$this->construireWhereNombreDeJours().
350
						$this->construireWhereNombreDeJours().
-
 
351
					$this->construireWhereAnnee().
349
	                    'ORDER BY nom_sel ASC '.
352
	                    'ORDER BY nom_sel ASC '.
350
	                    "LIMIT {$this->start},{$this->limit} ";
353
	                    "LIMIT {$this->start},{$this->limit} ";
351
			//echo $requete;exit;
354
			//echo $requete;exit;
352
			$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
355
			$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
353
			$requete = 'SELECT FOUND_ROWS()';
356
			$requete = 'SELECT FOUND_ROWS()';
Line 490... Line 493...
490
					$this->construireWhereCommentaire().
493
					$this->construireWhereCommentaire().
491
					$this->construireWherePhotosSeulement().
494
					$this->construireWherePhotosSeulement().
492
					$this->construireWhereProjet().
495
					$this->construireWhereProjet().
493
					$this->construireWhereTag().
496
					$this->construireWhereTag().
494
					$this->construireWhereNombreDeJours().
497
					$this->construireWhereNombreDeJours().
-
 
498
					$this->construireWhereAnnee().
495
					'ORDER BY nom_ret ASC '.
499
					'ORDER BY nom_ret ASC '.
496
                    "LIMIT {$this->start},{$this->limit} ";
500
                    "LIMIT {$this->start},{$this->limit} ";
497
		//$this->debug[] = $requete;
501
		//$this->debug[] = $requete;
498
		$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
502
		$resultats = Cel::db()->requeter($requete, self::SQL_RETOUR_COMPLET, self::SQL_MODE_OBJET);
499
		//echo $requete;exit;
503
		//echo $requete;exit;
Line 1073... Line 1077...
1073
			$sql = ' AND DATEDIFF(CURDATE(),co.date_creation) <= '.Cel::db()->proteger($nbjours).' ';
1077
			$sql = ' AND DATEDIFF(CURDATE(),co.date_creation) <= '.Cel::db()->proteger($nbjours).' ';
1074
		}
1078
		}
1075
		return $sql;
1079
		return $sql;
1076
	}
1080
	}
Line -... Line 1081...
-
 
1081
 
-
 
1082
	private function construireWhereAnnee() {
-
 
1083
		$sql = null;
-
 
1084
		extract($this->parametres);
-
 
1085
		if (isset($annee) && !$this->etreNull($annee)) {
-
 
1086
			$sql = ' AND YEAR(co.date_creation) = ' . Cel::db()->proteger($annee) . ' ';
-
 
1087
		}
-
 
1088
		return $sql;
-
 
1089
	}
1077
 
1090
 
1078
	/**
1091
	/**
1079
	 * Traitement de $tag pour construction du filtre dans la requête
1092
	 * Traitement de $tag pour construction du filtre dans la requête
1080
	 */
1093
	 */
1081
	private function getSqlWhereObsAvecImagesTaguees($tag) {
1094
	private function getSqlWhereObsAvecImagesTaguees($tag) {