Subversion Repositories eFlore/Applications.del

Rev

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

Rev 2029 Rev 2031
Line 280... Line 280...
280
				$dateP = $this->bdd->proteger($date);
280
				$dateP = $this->bdd->proteger($date);
281
				$dateWhere = sprintf($sqlTpl, $dateP);
281
				$dateWhere = sprintf($sqlTpl, $dateP);
282
				$this->addWhere('masque.date', $dateWhere);
282
				$this->addWhere('masque.date', $dateWhere);
283
			}
283
			}
Line 284... Line 284...
284
 
284
 
285
			if ($this->etreAppliImg()) {
-
 
286
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
-
 
287
			}
285
			$this->ajouterJoinObsSiNecessaire();
288
		}
286
		}
Line 289... Line 287...
289
	}
287
	}
290
 
288
 
291
	private function ajouterContrainteDepartement() {
289
	private function ajouterContrainteDepartement() {
292
		if (isset($this->parametres['masque.departement'])) {
290
		if (isset($this->parametres['masque.departement'])) {
293
			$dept = $this->parametres['masque.departement'];
291
			$dept = $this->parametres['masque.departement'];
Line 294... Line 292...
294
			$deptMotif = $this->bdd->proteger("INSEE-C:$dept");
292
			$deptMotif = $this->bdd->proteger("INSEE-C:$dept");
295
			$this->addWhere('masque.departement', "do.ce_zone_geo LIKE $deptMotif");
-
 
296
 
-
 
297
			if ($this->etreAppliImg()) {
293
			$this->addWhere('masque.departement', "do.ce_zone_geo LIKE $deptMotif");
298
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
294
 
Line 299... Line 295...
299
			}
295
			$this->ajouterJoinObsSiNecessaire();
300
		}
296
		}
Line 310... Line 306...
310
			}
306
			}
311
			$pays = explode(',', $this->parametres['masque.pays']);
307
			$pays = explode(',', $this->parametres['masque.pays']);
312
			$pays = implode(',', $this->bdd->proteger($pays));
308
			$pays = implode(',', $this->bdd->proteger($pays));
313
			$this->addWhere('masque.pays', "do.pays IN ($pays)");
309
			$this->addWhere('masque.pays', "do.pays IN ($pays)");
Line 314... Line 310...
314
	
310
	
315
			if ($this->etreAppliImg()) {
-
 
316
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
-
 
317
			}
311
			$this->ajouterJoinObsSiNecessaire();
318
		}
312
		}
Line 319... Line 313...
319
	}
313
	}
320
 
314
 
321
	private function ajouterContrainteIdZoneGeo() {
315
	private function ajouterContrainteIdZoneGeo() {
322
		if (isset($this->parametres['masque.id_zone_geo'])) {
316
		if (isset($this->parametres['masque.id_zone_geo'])) {
-
 
317
			$idZgMotif = $this->bdd->proteger($this->parametres['masque.id_zone_geo']);
323
			$idZgMotif = $this->bdd->proteger($this->parametres['masque.id_zone_geo']);
318
			$this->addWhere('masque.id_zone_geo', "do.ce_zone_geo = $idZgMotif");
324
			$this->addWhere('masque.id_zone_geo', "do.ce_zone_geo = $idZgMotif");
-
 
325
			if ($this->etreAppliImg()) {
-
 
326
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
319
			
327
			}
320
			$this->ajouterJoinObsSiNecessaire();
Line 328... Line 321...
328
		}
321
		}
329
	}
322
	}
330
 
323
 
331
	private function ajouterContrainteGenre() {
324
	private function ajouterContrainteGenre() {
332
		if (isset($this->parametres['masque.genre'])) {
325
		if (isset($this->parametres['masque.genre'])) {
Line 333... Line 326...
333
			$genre = $this->parametres['masque.genre'];
326
			$genre = $this->parametres['masque.genre'];
334
			$genreMotif = $this->bdd->proteger("$genre%");
-
 
335
			$this->addWhere('masque.genre', "do.nom_sel LIKE $genreMotif");
-
 
336
 
327
			$genreMotif = $this->bdd->proteger("$genre%");
337
			if ($this->etreAppliImg()) {
328
			$this->addWhere('masque.genre', "do.nom_sel LIKE $genreMotif");
Line 338... Line 329...
338
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
329
 
339
			}
330
			$this->ajouterJoinObsSiNecessaire();
340
		}
331
		}
341
	}
332
	}
Line 342... Line 333...
342
 
333
 
343
	private function ajouterContrainteFamille() {
-
 
344
		if (isset($this->parametres['masque.famille'])) {
-
 
345
			$familleMotif = $this->bdd->proteger($this->parametres['masque.famille']);
334
	private function ajouterContrainteFamille() {
346
			$this->addWhere('masque.famille', "do.famille = $familleMotif");
335
		if (isset($this->parametres['masque.famille'])) {
Line 347... Line 336...
347
 
336
			$familleMotif = $this->bdd->proteger($this->parametres['masque.famille']);
348
			if ($this->etreAppliImg()) {
337
			$this->addWhere('masque.famille', "do.famille = $familleMotif");
349
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
338
 
350
			}
339
			$this->ajouterJoinObsSiNecessaire();
351
		}
340
		}
352
	}
341
	}
353
 
342
 
354
	private function ajouterContrainteNs() {
-
 
355
		if (isset($this->parametres['masque.ns'])) {
-
 
356
			$ns = $this->parametres['masque.ns'];
343
	private function ajouterContrainteNs() {
357
			$nsMotif = $this->bdd->proteger("$ns%");
344
		if (isset($this->parametres['masque.ns'])) {
Line 358... Line 345...
358
			$this->addWhere('masque.ns', "do.nom_sel LIKE $nsMotif");
345
			$ns = $this->parametres['masque.ns'];
359
 
346
			$nsMotif = $this->bdd->proteger("$ns%");
360
			if ($this->etreAppliImg()) {
347
			$this->addWhere('masque.ns', "do.nom_sel LIKE $nsMotif");
361
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
348
			
362
			}
349
			$this->ajouterJoinObsSiNecessaire();
Line 363... Line 350...
363
		}
350
		}
364
	}
-
 
365
 
-
 
366
	private function ajouterContrainteNn() {
351
	}
367
		if (isset($this->parametres['masque.nn'])) {
352
 
Line 368... Line 353...
368
			$sqlTpl = '(do.nom_sel_nn = %1$d OR do.nom_ret_nn = %1$d)';
353
	private function ajouterContrainteNn() {
369
			$nnWhere = sprintf($sqlTpl, $this->parametres['masque.nn']);
354
		if (isset($this->parametres['masque.nn'])) {
370
			$this->addWhere('masque.nn', $nnWhere);
355
			$sqlTpl = '(do.nom_sel_nn = %1$d OR do.nom_ret_nn = %1$d)';
371
 
356
			$nnWhere = sprintf($sqlTpl, $this->parametres['masque.nn']);
372
			if ($this->etreAppliImg()) {
357
			$this->addWhere('masque.nn', $nnWhere);
Line 373... Line 358...
373
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
358
 
374
			}
-
 
375
		}
-
 
376
	}
359
			$this->ajouterJoinObsSiNecessaire();
377
 
360
		}
Line 378... Line 361...
378
	private function ajouterContrainteReferentiel() {
361
	}
379
		if (isset($this->parametres['masque.referentiel'])) {
362
 
380
			$ref = $this->parametres['masque.referentiel'];
363
	private function ajouterContrainteReferentiel() {
381
			$refMotif = $this->bdd->proteger("$ref%");
364
		if (isset($this->parametres['masque.referentiel'])) {
382
			$this->addWhere('masque.referentiel', "do.nom_referentiel LIKE $refMotif");
365
			$ref = $this->parametres['masque.referentiel'];
Line -... Line 366...
-
 
366
			$refMotif = $this->bdd->proteger("$ref%");
-
 
367
			$this->addWhere('masque.referentiel', "do.nom_referentiel LIKE $refMotif");
-
 
368
 
-
 
369
			$this->ajouterJoinObsSiNecessaire();
-
 
370
		}
383
 
371
	}
384
			if ($this->etreAppliImg()) {
372
 
385
				$this->addJoin('LEFT JOIN del_observation AS do ON (di.ce_observation = do.id_observation) ');
373
	private function ajouterContrainteCommune() {
386
			}
-
 
387
		}
374
		if (isset($this->parametres['masque.commune'])) {
Line 388... Line 375...
388
	}
375
			$commune = $this->parametres['masque.commune'];
389
 
376
			$communeMotif = $this->bdd->proteger("$commune%");
390
	private function ajouterContrainteCommune() {
377
			$this->addWhere('masque.commune', "do.zone_geo LIKE $communeMotif");