Subversion Repositories Applications.papyrus

Rev

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

Rev 633 Rev 673
Line 17... Line 17...
17
// |                                                                                                      |
17
// |                                                                                                      |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
18
// | You should have received a copy of the GNU Lesser General Public                                     |
19
// | License along with this library; if not, write to the Free Software                                  |
19
// | License along with this library; if not, write to the Free Software                                  |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
20
// | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA                            |
21
// +------------------------------------------------------------------------------------------------------+
21
// +------------------------------------------------------------------------------------------------------+
22
// CVS : $Id: inscription.class.php,v 1.7 2005-12-02 13:47:47 florian Exp $
22
// CVS : $Id: inscription.class.php,v 1.8 2005-12-19 13:17:53 alexandre_tb Exp $
23
/**
23
/**
24
* Inscription
24
* Inscription
25
*
25
*
26
* Un module d'inscription, en général ce code est spécifique à
26
* Un module d'inscription, en général ce code est spécifique à
27
* un site web
27
* un site web
Line 29... Line 29...
29
*@package inscription
29
*@package inscription
30
//Auteur original :
30
//Auteur original :
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
31
*@author        Alexandre GRANIER <alexandre@tela-botanica.org>
32
//Autres auteurs :
32
//Autres auteurs :
33
*@copyright     Tela-Botanica 2000-2004
33
*@copyright     Tela-Botanica 2000-2004
34
*@version       $Revision: 1.7 $ $Date: 2005-12-02 13:47:47 $
34
*@version       $Revision: 1.8 $ $Date: 2005-12-19 13:17:53 $
35
// +------------------------------------------------------------------------------------------------------+
35
// +------------------------------------------------------------------------------------------------------+
36
*/
36
*/
Line 37... Line 37...
37
 
37
 
38
// +------------------------------------------------------------------------------------------------------+
38
// +------------------------------------------------------------------------------------------------------+
Line 89... Line 89...
89
	    while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
89
	    while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
90
		    $retour[$ligne[INS_CHAMPS_ID_PAYS]] = $ligne[INS_CHAMPS_LABEL_PAYS] ;
90
		    $retour[$ligne[INS_CHAMPS_ID_PAYS]] = $ligne[INS_CHAMPS_LABEL_PAYS] ;
91
	    }
91
	    }
92
	    return $retour ;
92
	    return $retour ;
93
    }
93
    }
-
 
94
    
-
 
95
    /** Renvoie le nom d'un pays traduit dans la langue passé en paramètre
-
 
96
     *
-
 
97
     *  @param  string  une chaine de type i18n ou une chaine code iso langue (fr_FR ou fr ou FR)
-
 
98
     * @return  un tableau contenant en clé, le code iso du pays, en majuscule et en valeur le nom du pays traduit
-
 
99
     */
-
 
100
    function getNomPays($codeIso, $i18n = INS_LANGUE_DEFAUT) {
-
 
101
	    if (strlen($i18n) == 2) {
-
 
102
		    $i18n = strtolower($i18n)."-".strtoupper($i18n) ;
-
 
103
	    }
-
 
104
	    $requete = 'select '.INS_CHAMPS_LABEL_PAYS.' from '.INS_TABLE_PAYS.
-
 
105
							' where '.INS_CHAMPS_I18N_PAYS.'="'.$i18n.'" and '.
-
 
106
							INS_CHAMPS_ID_PAYS.'="'.$codeIso.'"';
-
 
107
	    $resultat = $this->_db->query($requete) ;
-
 
108
	    
-
 
109
	    if (DB::isError($resultat)) {
-
 
110
		    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
-
 
111
	    }
-
 
112
	    if ($resultat->numRows() == 0) {
-
 
113
		    return $this->raiseError('Le code fourni ne correspond à aucun pays ou n\'est pas dans la table!') ;
-
 
114
	    }
-
 
115
	    $ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC) ;
-
 
116
	    return $ligne[INS_CHAMPS_LABEL_PAYS] ;
-
 
117
    }
94
}
118
}
Line 95... Line 119...
95
 
119