Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

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

Rev 32 Rev 37
Line 1... Line 1...
1
<?php
1
<?php
2
class NOM_SELECTION extends macroElement {
2
class NOM_SELECTION extends macroElement {
3
    function getSQL()
3
    function getSQL()
4
    {
4
    {
5
        $contexte = array();
5
        $contexte = array();
6
        if (array_key_exists('radical',$this->contexteRef) and array_key_exists('rang',$this->contexteRef) ) {
6
        if (array_key_exists('radical', $this->contexteRef) and array_key_exists('rang', $this->contexteRef) ) {
7
            $contexte['radical']= $this->contexteRef['radical'];
7
            $contexte['radical'] = $this->contexteRef['radical'];
8
            $contexte['rang']= $this->contexteRef['rang'];
8
            $contexte['rang'] = $this->contexteRef['rang'];
9
            if(!empty($contexte['radical']) and !empty($contexte['rang']) ) {
9
            if(!empty($contexte['radical']) and !empty($contexte['rang']) ) {
10
                return 
10
                return 
-
 
11
                'SELECT nom.en_id_nom,
-
 
12
                nom.en_nom_supra_generique,
-
 
13
                nom.en_nom_genre,
-
 
14
                nom.en_epithete_infra_generique,
-
 
15
                nom.en_epithete_espece,
-
 
16
                nom. en_epithete_infra_specifique,
-
 
17
                auteur_bex. enaia_intitule_naturaliste_abrege AS intitule_abrege_auteur_basio_ex,
-
 
18
                auteur_b. enaia_intitule_naturaliste_abrege AS intitule_abrege_auteur_basio,
-
 
19
                auteur_mex.enaia_intitule_naturaliste_abrege AS intitule_abrege_auteur_modif_ex,
-
 
20
                auteur_m.enaia_intitule_naturaliste_abrege AS intitule_abrege_auteur_modif,
-
 
21
                citation.enci_intitule_complet_citation,
11
                    'SELECT nom.*, intitule.eni_intitule_nom 
22
                intitule.eni_intitule_nom ,
-
 
23
                commentaire.enic_intitule_cn_complet
12
                    FROM eflore_nom_intitule AS intitule, eflore_nom AS nom 
24
                FROM eflore_nom_intitule AS intitule,
-
 
25
                eflore_nom AS nom,
-
 
26
                eflore_naturaliste_intitule_abreviation AS auteur_bex,
-
 
27
                eflore_naturaliste_intitule_abreviation AS auteur_b,
-
 
28
                eflore_naturaliste_intitule_abreviation AS auteur_mex,
-
 
29
                eflore_naturaliste_intitule_abreviation AS auteur_m,
-
 
30
                eflore_nom_citation AS citation,
-
 
31
                eflore_nom_intitule_commentaire AS commentaire
13
                    WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"
32
                WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"
-
 
33
                AND nom.en_ce_auteur_basio_ex = auteur_bex.enaia_id_intitule_naturaliste_abrege
-
 
34
                AND nom.en_ce_auteur_basio = auteur_b.enaia_id_intitule_naturaliste_abrege
-
 
35
                AND nom.en_ce_auteur_modif_ex = auteur_mex.enaia_id_intitule_naturaliste_abrege
-
 
36
                AND nom.en_ce_auteur_modif = auteur_m.enaia_id_intitule_naturaliste_abrege
-
 
37
                AND nom.en_ce_citation_initiale = citation.enci_id_citation
-
 
38
                AND nom.en_ce_intitule_cn = commentaire.enic_id_intitule_cn
14
                    AND nom.en_id_nom = intitule.eni_id_nom
39
                AND nom.en_id_nom = intitule.eni_id_nom
15
                    AND nom.en_ce_rang = '.$contexte['rang'];
40
                AND nom.en_ce_rang = '.$contexte['rang'];
16
            }
41
            }
17
        }
42
        }
18
        if (array_key_exists('radical',$this->contexteRef) ) {
43
        if (array_key_exists('radical', $this->contexteRef) ) {
19
            $contexte['radical']= $this->contexteRef['radical'];
44
            $contexte['radical'] = $this->contexteRef['radical'];
20
            if(!empty($contexte['radical']) ) {
45
            if(!empty($contexte['radical']) ) {
21
                return 
46
                return 
22
                    'SELECT nom.*, intitule.eni_intitule_nom 
47
                    'SELECT nom.*, intitule.eni_intitule_nom 
23
                    FROM eflore_nom_intitule AS intitule, eflore_nom AS nom 
48
                    FROM eflore_nom_intitule AS intitule, eflore_nom AS nom 
24
                    WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"
49
                    WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"