Subversion Repositories eFlore/Applications.coel

Rev

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

Rev 1757 Rev 1761
Line 367... Line 367...
367
		}
367
		}
368
		if (isset($p['bot'])) {
368
		if (isset($p['bot'])) {
369
			$where[] = "ccb_ce_truk_type IN ({$p['bot']})";
369
			$where[] = "ccb_ce_truk_type IN ({$p['bot']})";
370
		}
370
		}
371
		if (isset($p['lieu-stockage'])) {
371
		if (isset($p['lieu-stockage'])) {
-
 
372
      $join[] = 'LEFT JOIN coel_meta_liste_valeur cmlv ON cmlv.cmlv_id_valeur = cs_ce_truk_pays';
-
 
373
      $join[] = 'LEFT JOIN coel_meta_liste_valeur cmlv2 ON cmlv2.cmlv_id_valeur = cs_ce_truk_region';
372
			$where[] = '(' . implode(' OR ', array(
374
			$where[] = '(' . implode(' OR ', array(
373
				"cs_adresse_01 LIKE {$p['lieu-stockage']}",
375
				"cs_adresse_01 LIKE {$p['lieu-stockage']}",
374
				"cs_adresse_02 LIKE {$p['lieu-stockage']}",
376
				"cs_adresse_02 LIKE {$p['lieu-stockage']}",
375
				"cs_code_postal LIKE {$p['lieu-stockage']}",
377
				"cs_code_postal LIKE {$p['lieu-stockage']}",
376
				"cs_ville LIKE {$p['lieu-stockage']}",
378
				"cs_ville LIKE {$p['lieu-stockage']}",
377
				"cs_ce_truk_region LIKE {$p['lieu-stockage']}", // @TODO joindre la table meta
379
				"cs_ce_truk_region LIKE {$p['lieu-stockage']}",
378
				"cs_ce_truk_pays LIKE {$p['lieu-stockage']}"
380
				"cs_ce_truk_pays LIKE {$p['lieu-stockage']}",
-
 
381
				"cmlv.cmlv_nom LIKE {$p['lieu-stockage']}",
-
 
382
				"cmlv2.cmlv_nom LIKE {$p['lieu-stockage']}"
379
			)) . ')';
383
			)) . ')';
380
		}
384
		}
381
		if (isset($p['zg'])) {
385
		if (isset($p['zg'])) {
382
			$where[] = "cc_truk_couverture_lieu LIKE {$p['zg']}";
386
			$where[] = "cc_truk_couverture_lieu LIKE {$p['zg']}";
383
		}
387
		}
Line 458... Line 462...
458
 
462
 
459
		if (isset($p['nom-famille'])) {
463
		if (isset($p['nom-famille'])) {
460
			$where[] = "cp_nom LIKE {$p['nom-famille']}";
464
			$where[] = "cp_nom LIKE {$p['nom-famille']}";
461
		}
465
		}
-
 
466
		if (isset($p['adresse'])) {
-
 
467
      $join[] = 'LEFT JOIN coel_meta_liste_valeur cmlv ON cmlv.cmlv_id_valeur = cp_ce_truk_pays';
462
		if (isset($p['adresse'])) {
468
      $join[] = 'LEFT JOIN coel_meta_liste_valeur cmlv2 ON cmlv2.cmlv_id_valeur = cp_ce_truk_region';
463
			$where[] = '(' . implode(' OR ', array(
469
			$where[] = '(' . implode(' OR ', array(
464
				"cp_adresse_01 LIKE {$p['adresse']}",
470
				"cp_adresse_01 LIKE {$p['adresse']}",
465
				"cp_adresse_02 LIKE {$p['adresse']}",
471
				"cp_adresse_02 LIKE {$p['adresse']}",
466
				"cp_code_postal LIKE {$p['adresse']}",
472
				"cp_code_postal LIKE {$p['adresse']}",
467
				"cp_ville LIKE {$p['adresse']}",
473
				"cp_ville LIKE {$p['adresse']}",
-
 
474
				"cp_ce_truk_pays LIKE {$p['adresse']}",
468
				"cp_ce_truk_pays LIKE {$p['adresse']}",
475
				"cp_ce_truk_region LIKE {$p['adresse']}",
469
				"cp_naissance_lieu LIKE {$p['adresse']}",
476
				"cp_naissance_lieu LIKE {$p['adresse']}",
-
 
477
				"cp_deces_lieu LIKE {$p['adresse']}",
-
 
478
				"cmlv.cmlv_nom LIKE {$p['adresse']}",
470
				"cp_deces_lieu LIKE {$p['adresse']}"
479
				"cmlv2.cmlv_nom LIKE {$p['adresse']}"
471
			)) . ')';
480
			)) . ')';
472
		}
481
		}
473
		if (isset($p['date-vivant'])) {
482
		if (isset($p['date-vivant'])) {
-
 
483
			$where[] = "cp_naissance_date <= {$p['date-vivant']}";
-
 
484
			$where[] = "cp_deces_date >= {$p['date-vivant']}";
-
 
485
			$where[] = "cp_naissance_date IS NOT NULL";
474
			$where[] = "cp_naissance_date <= {$p['date-vivant']}";
486
			$where[] = "cp_deces_date IS NOT NULL";
475
			$where[] = "(cp_deces_date IS NULL OR cp_deces_date >= {$p['date-vivant']})";
487
			//$where[] = "(cp_deces_date IS NULL OR cp_deces_date >= {$p['date-vivant']})";
Line 476... Line 488...
476
		}
488
		}
477
 
489
 
478
		// pour inclure éventuellement les adresses de la structure
490
		// pour inclure éventuellement les adresses de la structure