Subversion Repositories eFlore/Applications.cel

Rev

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

Rev 920 Rev 995
Line 33... Line 33...
33
		
33
		
34
		$requete_recherche = '';
34
		$requete_recherche = '';
35
		// Genre et Espece 
35
		// Genre et Espece 
36
		if ($espece != null && $genre != null) {	
36
		if ($espece != null && $genre != null) {	
37
            if (strlen($espece) > 0 ) {
37
            if (strlen($espece) > 0 ) {
38
				$espece=ereg_replace('\*+','%',$espece);
38
				$espece=preg_replace('/\*+/','%',$espece);
39
    	       	$requete_recherche = "SELECT DISTINCT en_nom_genre, en_epithete_espece, en_nom_supra_generique, en_epithete_infra_generique,". 
39
    	       	$requete_recherche = "SELECT DISTINCT en_nom_genre, en_epithete_espece, en_nom_supra_generique, en_epithete_infra_generique,". 
40
    	       			"   auteur_bex.enaia_intitule_abrege AS abreviation_auteur_basio_ex ".
40
    	       			"   auteur_bex.enaia_intitule_abrege AS abreviation_auteur_basio_ex ".
41
    	       			" , auteur_b.enaia_intitule_abrege AS abreviation_auteur_basio ".
41
    	       			" , auteur_b.enaia_intitule_abrege AS abreviation_auteur_basio ".
42
    	       			" , auteur_mex.enaia_intitule_abrege AS abreviation_auteur_modif_ex ".
42
    	       			" , auteur_mex.enaia_intitule_abrege AS abreviation_auteur_modif_ex ".
Line 60... Line 60...
60
    	       			" ORDER BY esn_ce_statut, en_ce_rang, en_epithete_espece, en_nom_genre LIMIT 50";
60
    	       			" ORDER BY esn_ce_statut, en_ce_rang, en_epithete_espece, en_nom_genre LIMIT 50";
61
            }
61
            }
62
		}
62
		}
63
		else {
63
		else {
64
			if ($genre != null) {
64
			if ($genre != null) {
65
				$genre=ereg_replace('\*+','%',$genre);
65
				$genre=preg_replace('/\*+/','%',$genre);
66
				//TODO: comprendre pourquoi à l'origine il y avait : (strlen($genre) >= 1) /*&& ($genre != '%')
66
				//TODO: comprendre pourquoi à l'origine il y avait : (strlen($genre) >= 1) /*&& ($genre != '%')
67
				// voir avec david
67
				// voir avec david
68
	            if ((strlen($genre) >= 1)) {
68
	            if ((strlen($genre) >= 1)) {
69
				    $requete_recherche = "SELECT DISTINCT en_nom_genre, en_id_nom, 0 as esn_ce_statut FROM  eflore_nom WHERE en_id_version_projet_nom = '25'" .
69
				    $requete_recherche = "SELECT DISTINCT en_nom_genre, en_id_nom, 0 as esn_ce_statut FROM  eflore_nom WHERE en_id_version_projet_nom = '25'" .
70
				    "AND en_ce_rang = 160 " .
70
				    "AND en_ce_rang = 160 " .
Line 255... Line 255...
255
	private function formaterNom($rawnom) {
255
	private function formaterNom($rawnom) {
Line 256... Line 256...
256
 
256
 
257
        // Constitution du nom:
257
        // Constitution du nom:
Line 258... Line 258...
258
        $nom = '';
258
        $nom = '';
259
 
259
 
260
        if ($rawnom['en_nom_supra_generique'] != '') {
260
        if (isset($rawnom['en_nom_supra_generique']) && $rawnom['en_nom_supra_generique'] != '') {
261
            $nom .= $rawnom['en_nom_supra_generique'];
261
            $nom .= $rawnom['en_nom_supra_generique'];
262
        } else if ($rawnom['en_epithete_infra_generique'] != '') {
262
        } else if (isset($rawnom['en_epithete_infra_generique']) && $rawnom['en_epithete_infra_generique'] != '') {
263
            $nom .= $rawnom['en_epithete_infra_generique'];
263
            $nom .= $rawnom['en_epithete_infra_generique'];
264
        } else {
264
        } else {
265
            if ($rawnom['en_nom_genre'] != '') {
265
            if (isset($rawnom['en_nom_genre']) &&  $rawnom['en_nom_genre'] != '') {
266
                $nom .=  $rawnom['en_nom_genre'];
266
                $nom .=  $rawnom['en_nom_genre'];
267
            }
267
            }
268
            if ($rawnom['en_epithete_espece']!= '') {
268
            if (isset($rawnom['en_epithete_espece']) &&  $rawnom['en_epithete_espece']!= '') {
269
                $nom .= ' '.$rawnom['en_epithete_espece'];
269
                $nom .= ' '.$rawnom['en_epithete_espece'];
270
            }
270
            }
271
            if ($rawnom['en_epithete_infra_specifique'] != '') {
271
            if (isset($rawnom['en_epithete_infra_specifique']) &&  $rawnom['en_epithete_infra_specifique'] != '') {
272
                if (!empty($rawnom['enrg_abreviation_rang'])) {
272
                if (!empty($rawnom['enrg_abreviation_rang'])) {
273
                        $nom .= ' '.$rawnom['enrg_abreviation_rang'].'';
273
                        $nom .= ' '.$rawnom['enrg_abreviation_rang'].'';
274
                }
274
                }