Subversion Repositories Applications.papyrus

Rev

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

Rev 1292 Rev 1298
Line 8... Line 8...
8
// | Les fonctions de annuaire_moteur.php                                           |
8
// | Les fonctions de annuaire_moteur.php                                           |
9
// +--------------------------------------------------------------------------------+
9
// +--------------------------------------------------------------------------------+
10
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> 		  		        |
10
// | Auteur : Alexandre Granier <alexandre@tela-botanica.org> 		  		        |
11
// +--------------------------------------------------------------------------------+
11
// +--------------------------------------------------------------------------------+
12
//
12
//
13
// $Id: annuaire_backoffice.fonct.php,v 1.9 2007-04-06 08:35:46 neiluj Exp $
13
// $Id: annuaire_backoffice.fonct.php,v 1.10 2007-04-11 08:30:12 neiluj Exp $
Line 14... Line 14...
14
 
14
 
15
 
15
 
16
/** function mkengine ()
16
/** function mkengine ()
17
*
17
*
18
*
18
*
19
*
19
*
Line 20... Line 20...
20
*	@return
20
*	@return
21
*/
21
*/
Line 22... Line 22...
22
 
22
 
23
include_once 'Pager/Pager.php' ;
23
include_once PAP_CHEMIN_API_PEAR.'Pager/Pager.php' ;
24
include_once 'HTML/Table.php';
24
include_once PAP_CHEMIN_API_PEAR.'HTML/Table.php';
25
 
25
 
Line 78... Line 78...
78
    
78
    
79
 
79
 
80
  if ($resultat_nbre_inscrit->numRows() == 1) {
80
  if ($resultat_nbre_inscrit->numRows() == 1) {
81
        $tmp_nb = $resultat_nbre_inscrit->fetchRow(DB_FETCHMODE_OBJECT);
81
        $tmp_nb = $resultat_nbre_inscrit->fetchRow(DB_FETCHMODE_OBJECT);
82
        $nbr_total = $tmp_nb->CPT;
82
        $nbr_total = $tmp_nb->CPT;
83
        if ($nbr_total > 0) $chaine = "parmi $nbr_total données";
83
        $chaine = "parmi $nbr_total données";
84
        else die("<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $query");
84
        if ($nbr_total <= 0) $ret .= "<B>Erreur</B> lors du comptage des structures ($nbr_total trouvées) : $requete_nbre_inscrit";
Line 85... Line 85...
85
    }
85
    }
Line 86... Line 86...
86
  else die("<B>Erreur</B> lors du comptage des structures : $query");
86
  else $ret .=  "<B>Erreur</B> lors du comptage des structures : $requete_nbre_inscrit";
Line 195... Line 195...
195
								
195
								
196
			// Pour la france on met le département, sinon on laisse le nom du pays
196
			// Pour la france on met le département, sinon on laisse le nom du pays
197
			if ($data[$i][INS_CHAMPS_PAYS] != 'fr') {
197
			if ($data[$i][INS_CHAMPS_PAYS] != 'fr') {
198
				array_push ($ligne_inscrit, $data[$i][INS_CHAMPS_LABEL_PAYS]);
198
				array_push ($ligne_inscrit, $data[$i][INS_CHAMPS_LABEL_PAYS]);
199
			} else {
199
			} else {
200
		        $req_dpt = 'select '.INS_CHAMPS_NOM_DEPARTEMENT.' from '.INS_TABLE_DEPARTEMENT.",".INS_ANNUAIRE.
200
		        $req_dpt = 'select '.INS_CHAMPS_NOM_DEPARTEMENT.' from '.INS_TABLE_DPT.",".INS_ANNUAIRE.
201
							" where ".INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'='.$data[$i][INS_CHAMPS_ID] ;
201
							" where ".INS_ANNUAIRE.'.'.INS_CHAMPS_ID.'='.$data[$i][INS_CHAMPS_ID] ;
202
		        $req_dpt .= " and ".INS_ANNUAIRE.'.'.INS_CHAMPS_ID_DEPARTEMENT.'='.INS_TABLE_DEPARTEMENT.'.'
202
		        $req_dpt .= " and ".INS_ANNUAIRE.'.'.INS_CHAMPS_DEPARTEMENT.'='.INS_TABLE_DPT.'.'
203
		        					.INS_CHAMPS_ID_DEPARTEMENT ;
203
		        					.INS_CHAMPS_ID_DEPARTEMENT ;
-
 
204
		        $resultat_dpt = $GLOBALS['ins_db']->query($req_dpt) ;
-
 
205
		        if (DB::isError($resultat_dpt)) {
-
 
206
		        	echo $resultat_dpt->getMessage().$resultat_dpt->getDebugInfo();		        	
204
		        $resultat_dpt = $GLOBALS['ins_db']->query($req_dpt) ;
207
		        }
205
		        $ligne_dpt = $resultat_dpt->fetchRow(DB_FETCHMODE_ASSOC) ;
208
		        $ligne_dpt = $resultat_dpt->fetchRow(DB_FETCHMODE_ASSOC) ;
206
				array_push ($ligne_inscrit, $ligne_dpt[INS_CHAMPS_NOM_DEPARTEMENT]) ;
209
				array_push ($ligne_inscrit, $ligne_dpt[INS_CHAMPS_NOM_DEPARTEMENT]) ;
Line 207... Line 210...
207
			}
210
			}
Line 349... Line 352...
349
						str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL()), '', '') ;
352
						str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL()), '', '') ;
350
	$formulaire->construitFormulaire(str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL())) ;
353
	$formulaire->construitFormulaire(str_replace ('&amp;', '&', $GLOBALS['ins_url']->getURL())) ;
Line 351... Line 354...
351
	
354
	
352
	if (isset($_REQUEST['ajouter_v'])) {
355
	if (isset($_REQUEST['ajouter_v'])) {
353
		if ($formulaire->validate()) {
356
		if ($formulaire->validate()) {
-
 
357
			$id_utilisateur = insertion($formulaire->getSubmitValues()) ;
-
 
358
			
-
 
359
			// Appel des actions desinscriptions des applications clientes
-
 
360
		        $d = dir(GEN_CHEMIN_CLIENT);
-
 
361
				while (false !== ($repertoire = $d->read())) {
-
 
362
					if (file_exists(GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php'))
-
 
363
					include_once GEN_CHEMIN_CLIENT.$repertoire.GEN_SEP.$repertoire.'.inscription.inc.php' ;   
-
 
364
				}
354
			insertion($formulaire->getSubmitValues()) ;
365
					$d->close();
355
			if (INS_CHAMPS_LETTRE != '' && isset ($valeurs['lettre'])) {
366
			if (INS_CHAMPS_LETTRE != '' && isset ($valeurs['lettre'])) {
356
				inscription_lettre(INS_MAIL_INSCRIPTION_LISTE) ;
367
				inscription_lettre(INS_MAIL_INSCRIPTION_LISTE) ;
357
			}
368
			}
358
		    return mkengine();
369
		    return mkengine();