Subversion Repositories eFlore/Archives.eflore-consultation-v2

Rev

Rev 28 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
28 jpm 1
<?php
2
class NOM_SELECTION extends macroElement {
3
    function getSQL()
4
    {
5
        $contexte = array();
6
        if (array_key_exists('radical',$this->contexteRef) and array_key_exists('rang',$this->contexteRef) ) {
7
            $contexte['radical']= $this->contexteRef['radical'];
8
            $contexte['rang']= $this->contexteRef['rang'];
9
            if(!empty($contexte['radical']) and !empty($contexte['rang']) ) {
10
                return
11
                    'SELECT nom.*, intitule.eni_intitule_nom
32 jpm 12
                    FROM eflore_nom_intitule AS intitule, eflore_nom AS nom
13
                    WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"
28 jpm 14
                    AND nom.en_id_nom = intitule.eni_id_nom
15
                    AND nom.en_ce_rang = '.$contexte['rang'];
16
            }
17
        }
18
        if (array_key_exists('radical',$this->contexteRef) ) {
19
            $contexte['radical']= $this->contexteRef['radical'];
20
            if(!empty($contexte['radical']) ) {
21
                return
22
                    'SELECT nom.*, intitule.eni_intitule_nom
32 jpm 23
                    FROM eflore_nom_intitule AS intitule, eflore_nom AS nom
24
                    WHERE intitule.eni_intitule_nom LIKE "%'.$contexte['radical'].'%"
28 jpm 25
                    AND nom.en_id_nom = intitule.eni_id_nom';
26
            }
27
        }
28
        return null;
29
    }
30
}
31
?>