Subversion Repositories Applications.annuaire

Rev

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

Rev 245 Rev 313
Line 476... Line 476...
476
			$separateur = ' AND ';
476
			$separateur = ' AND ';
477
		} else {
477
		} else {
478
			$separateur = ' OR ';
478
			$separateur = ' OR ';
479
		}
479
		}
Line 480... Line 480...
480
 
480
 
Line 481... Line 481...
481
		$chaine_recherche = '';
481
		$chaine_recherche = '' ;
Line -... Line 482...
-
 
482
 
-
 
483
	 	if(!$exclusive) {
482
 
484
 
483
		foreach($valeurs as $nom_champ => $valeur) {
485
			foreach($valeurs as $nom_champ => $valeur) {
484
 
486
 
485
			if(is_array($valeur)) {
487
				if(is_array($valeur)) {
486
				foreach($valeur as $cle => $valeur_multi_meta) {
488
					foreach($valeur as $cle => $valeur_multi_meta) {
487
					$chaine_recherche .= '(amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur LIKE '.$this->proteger('%'.$cle.'%').')'.$separateur;
489
						$chaine_recherche .= '(amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur LIKE '.$this->proteger('%'.$cle.'%').')'.$separateur;
488
				}
490
					}
-
 
491
				} else {
489
			} else {
492
					if(trim($valeur) != '') {
490
				if(trim($valeur) != '') {
493
						$chaine_recherche .= '(amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur = '.$this->proteger($valeur).')'.$separateur;
-
 
494
					}
-
 
495
				}
-
 
496
			}
-
 
497
		} else {
-
 
498
			foreach($valeurs as $nom_champ => $valeur) {
-
 
499
 
-
 
500
				if(is_array($valeur)) {
-
 
501
					foreach($valeur as $cle => $valeur_multi_meta) {
-
 
502
						$chaine_recherche .= ' amv_cle_ligne IN (SELECT amv_cle_ligne FROM annu_meta_valeurs WHERE amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur LIKE '.$this->proteger('%'.$cle.'%').')'.$separateur;
-
 
503
					}
-
 
504
				} else {
-
 
505
					if(trim($valeur) != '') {
-
 
506
						$chaine_recherche .= ' amv_cle_ligne IN (SELECT amv_cle_ligne FROM annu_meta_valeurs WHERE amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur = '.$this->proteger($valeur).')'.$separateur;
491
					$chaine_recherche .= '(amv_ce_colonne = '.$this->proteger($nom_champ).' AND amv_valeur = '.$this->proteger($valeur).')'.$separateur;
507
					}
Line 492... Line 508...
492
				}
508
				}
493
			}
509
 			}
494
		}
510
		}
Line 500... Line 516...
500
		$chaine_recherche = rtrim($chaine_recherche,$separateur);
516
		$chaine_recherche = rtrim($chaine_recherche,$separateur);
Line 501... Line 517...
501
 
517
 
502
	 	$requete_recherche = 'SELECT DISTINCT amv_cle_ligne '.
518
	 	$requete_recherche = 'SELECT DISTINCT amv_cle_ligne '.
503
							'FROM annu_meta_valeurs '.
519
							'FROM annu_meta_valeurs '.
504
							'WHERE '.$chaine_recherche ;
520
							'WHERE '.$chaine_recherche ;
505
 
521
	 	
Line 506... Line 522...
506
		$resultat_recherche = $this->requeteTous($requete_recherche);
522
		$resultat_recherche = $this->requeteTous($requete_recherche);
Line 507... Line 523...
507
 
523