Subversion Repositories Sites.obs-saisons.fr

Rev

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

Rev 324 Rev 327
Line 35... Line 35...
35
 
35
 
Line 36... Line 36...
36
	private function getElementParDefaut($params) {
36
	private function getElementParDefaut($params) {
Line -... Line 37...
-
 
37
 
-
 
38
   	}
-
 
39
 
-
 
40
		private function getAnneeMinimumObservation() {
-
 
41
			$requete_annee_min_obs = 'SELECT MIN(YEAR(oo_date)) as min_annee FROM ods_observations '.
-
 
42
														'WHERE oo_date != "0000-00-00"';
-
 
43
			$resultat_min_annee_obs = $this->executerRequete($requete_annee_min_obs);
-
 
44
			return !empty($resultat_min_annee_obs) ? $resultat_min_annee_obs[0]['min_annee'] : Date('Y');
-
 
45
		}
-
 
46
 
-
 
47
		private function getAnneesAyantObservations() {
-
 
48
			$requete_annee_min_obs = 'SELECT DISTINCT YEAR(oo_date) as annee FROM ods_observations '.
-
 
49
														'WHERE oo_date != "0000-00-00" AND YEAR(oo_date) <= "'.date('Y').'" '.
-
 
50
														'ORDER BY annee DESC';
-
 
51
														
-
 
52
			$resultat_annees_ayant_obs = $this->executerRequete($requete_annee_min_obs);
-
 
53
			$annees_ayant_obs = [];
-
 
54
			foreach($resultat_annees_ayant_obs as $res_annee_ayant_obs) {
-
 
55
				$annees_ayant_obs[] = $res_annee_ayant_obs['annee'];
-
 
56
			}
-
 
57
 
37
 
58
			return $annees_ayant_obs;
Line 38... Line 59...
38
   	}
59
		}
39
 
60
 
Line 232... Line 253...
232
			if($est_une_suppression_obs && $obs_existante['oo_absence_evenement'] == 1) {
253
			if($est_une_suppression_obs && $obs_existante['oo_absence_evenement'] == 1) {
Line 233... Line 254...
233
 
254
 
234
				$requete_suppression_observation = 'DELETE FROM ods_observations '.
255
				$requete_suppression_observation = 'DELETE FROM ods_observations '.
235
					'WHERE oo_id_observation = '.$this->proteger($donnees_obs_a_inserer['id_observation']).' '.
256
					'WHERE oo_id_observation = '.$this->proteger($donnees_obs_a_inserer['id_observation']).' '.
236
					'AND oo_absence_evenement = 1';
257
					'AND oo_absence_evenement = 1';
237
					
258
 
238
					$this->executerRequeteSimple($requete_suppression_observation);
259
					$this->executerRequeteSimple($requete_suppression_observation);
239
			} else {
260
			} else {
240
				$requete_modification_observation = 'UPDATE ods_observations '.
261
				$requete_modification_observation = 'UPDATE ods_observations '.
241
					'SET '.
262
					'SET '.