Subversion Repositories Applications.papyrus

Rev

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

Rev 1689 Rev 1731
Line 90... Line 90...
90
	//$GLOBALS['ins_url']->removeQueryString('voir_competences');
90
	//$GLOBALS['ins_url']->removeQueryString('voir_competences');
91
	$res.= '</ul>'."\n";
91
	$res.= '</ul>'."\n";
92
	return $res;
92
	return $res;
93
}
93
}
Line 94... Line 94...
94
 
94
 
95
/** function affiche_onglet_info()  sélectionne le type d'information à montrer pour une fiche
95
/** function affiche_onglet_info()  selectionne le type d'information a montrer pour une fiche
96
*
96
*
97
*
97
*
98
*
98
*
99
*	@return string HTML
99
*	@return string HTML
Line 138... Line 138...
138
    $option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
138
    $option_type=array ('0' => INS_PERSONNES_OU_STRUCTURES,
139
                        '1' => INS_PERSONNES,
139
                        '1' => INS_PERSONNES,
140
                        '2' => INS_STRUCTURES);
140
                        '2' => INS_STRUCTURES);
141
    $form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
141
    $form->addElement('select', 'nom_type', INS_JE_RECHERCHE, $option_type);
Line 142... Line -...
142
    
-
 
143
    //requete pour recuperer la liste des pays
-
 
144
    $requete = 'SELECT '.INS_CHAMPS_ID_PAYS.', '.INS_CHAMPS_LABEL_PAYS.' FROM '.INS_TABLE_PAYS.' WHERE '.INS_CHAMPS_I18N_PAYS.'="fr-FR"';
-
 
145
	$resultat = $GLOBALS['ins_db']->query($requete) ;
-
 
146
	if (DB::isError($resultat)) {
-
 
147
	    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
-
 
148
	}
-
 
149
	$option_pays = array('zz' => INS_TOUS_PAYS) ;
-
 
150
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
151
	    $option_pays[$ligne[INS_CHAMPS_ID_PAYS]] = $ligne[INS_CHAMPS_LABEL_PAYS] ;
-
 
152
	}
-
 
Line 153... Line -...
153
    $form->addElement('select', 'nom_pays', INS_PAYS, $option_pays);
-
 
154
    
-
 
155
    //requete pour recuperer la liste des départements
-
 
156
    $requete = 'SELECT '.INS_CHAMPS_ID_DEPARTEMENT.', '.INS_CHAMPS_NOM_DEPARTEMENT.' FROM '.INS_TABLE_DPT;
-
 
157
	$resultat = $GLOBALS['ins_db']->query($requete) ;
-
 
158
	if (DB::isError($resultat)) {
-
 
159
	    die ("Echec de la requete : $requete<br />".$resultat->getMessage()) ;
-
 
160
	}
-
 
161
	$option_departements = array('0' => INS_TOUS_DEPARTEMENTS) ;
-
 
162
	while ($ligne = $resultat->fetchRow(DB_FETCHMODE_ASSOC)) {
-
 
163
	    $option_departements[$ligne[INS_CHAMPS_ID_DEPARTEMENT]] = $ligne[INS_CHAMPS_NOM_DEPARTEMENT] ;
-
 
164
	}
-
 
165
    $form->addElement('select', 'nom_departement', INS_DEPARTEMENT_POUR_LA_FRANCE, $option_departements);
142
    
Line -... Line 143...
-
 
143
    
-
 
144
	$form->addElement('text', 'nom_annuaire', INS_NOM_ANNUAIRE);
-
 
145
	
-
 
146
	// Appel de l api formulaire
-
 
147
	include_once GEN_CHEMIN_API.'/formulaire/formulaire.fonct.inc.php';
-
 
148
    $tableau= formulaire_valeurs_template_champs($GLOBALS['ins_config']['ic_inscription_template']);
-
 
149
    
-
 
150
    for ($i=0; $i<count($tableau); $i++) {
-
 
151
		if (($tableau[$i]['type'] == 'liste' || $tableau[$i]['type'] == 'checkbox') && $tableau[$i]['recherche'] == 1) {
-
 
152
			$tableau[$i]['type']($form, $tableau[$i]['nom_bdd'], $tableau[$i]['label'], $tableau[$i]['limite1'],
-
 
153
	                         $tableau[$i]['limite2'], $tableau[$i]['defaut'], $tableau[$i]['table_source'], $tableau[$i]['obligatoire'], 1, 'bazar') ;
166
	
154
		}
167
	$form->addElement('text', 'nom_annuaire', INS_NOM_ANNUAIRE);
155
	}
168
	
156
    
169
	$form->addElement('submit', 'bouton_rechercher', INS_RECHERCHER);
157
    $form->addElement('submit', 'bouton_rechercher', INS_RECHERCHER);
170
	
158
    
Line 171... Line 159...
171
	//valeurs par defaut
159
	//valeurs par defaut
172
	$defauts=array('nom_pays'=>'fr','nom_departement'=>'0');
160
	$defauts=array('nom_pays'=>'fr','nom_departement'=>'0');
Line 173... Line 161...
173
	$form->setDefaults($defauts);
161
	$form->setDefaults($defauts);
174
	
162
	
175
	//affichage du formulaire
163
	//affichage du formulaire
176
	$res .=$form->toHtml();
164
	$res .=$form->toHtml();
177
	
165
	
178
	//on teste si l'on affiche le resultat de la recherche ou 
166
	//on teste si l'on affiche le resultat de la recherche ou 
179
	if (isset($_POST['nom_type'])) {
167
	if (isset($_POST['nom_type'])) {
180
		$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
-
 
181
		$requete .= ' FROM '.INS_ANNUAIRE.' WHERE ';
168
		$requete = 'SELECT '.INS_CHAMPS_ID.', '.INS_CHAMPS_NOM.', '.INS_CHAMPS_PRENOM.', '.INS_CHAMPS_VILLE.', '.INS_CHAMPS_CODE_POSTAL;
182
		$req_where=0;
169
		$requete .= ' FROM '.INS_ANNUAIRE.' WHERE 1 ';
183
		if ($_POST['nom_type']==1) {
-
 
184
			$requete .= INS_CHAMPS_EST_STRUCTURE.'=0 ';
-
 
185
			$req_where=1;
-
 
186
		} elseif ($_POST['nom_type']==2) {
-
 
187
			$requete .= INS_CHAMPS_EST_STRUCTURE.'=1 ';
-
 
188
			$req_where=1;
-
 
189
		}
-
 
190
		if ($_POST['nom_pays']!='0'and$_POST['nom_pays']!='zz') {
-
 
191
			if ($req_where) {
-
 
192
				$requete .= 'AND ';
-
 
193
			} else {
-
 
194
				$req_where=1;
-
 
195
			} 
-
 
196
			$requete .= INS_CHAMPS_PAYS.'="'.$_POST['nom_pays'].'" ';
-
 
197
		}
-
 
198
		if ($_POST['nom_departement']!='0') {
-
 
199
			if ($req_where) {
-
 
200
				$requete .= 'AND ';
170
		$req_where=0;
-
 
171
		if ($_POST['nom_type']==1) {
201
			} else {
172
			$requete .= INS_CHAMPS_EST_STRUCTURE.'=0 ';
202
				$req_where=1;
-
 
203
			} 
-
 
204
			$requete .= INS_CHAMPS_DEPARTEMENT.'="'.$_POST['nom_departement'].'" ';
-
 
205
		}
-
 
206
		if ($_POST['nom_annuaire']!='') {
-
 
207
			if ($req_where) {
173
		} elseif ($_POST['nom_type']==2) {
208
				$requete .= 'AND ';
174
			$requete .= INS_CHAMPS_EST_STRUCTURE.'=1 ';
209
			} else {
175
		}
-
 
176
		
-
 
177
		if ($_POST['nom_annuaire']!='') {
-
 
178
			$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
-
 
179
						' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
-
 
180
						' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%")';
210
				$req_where=1;
181
						
-
 
182
		}
-
 
183
		for ($i=0; $i<count($tableau); $i++) {
211
			} 
184
			if (($tableau[$i]['type'] == 'liste')) {
212
			$requete .= '('.INS_CHAMPS_NOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
-
 
213
						' OR '.INS_CHAMPS_PRENOM.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
185
				if (isset($_POST[$tableau[$i]['nom_bdd']]) && $_POST[$tableau[$i]['nom_bdd']] != 0) {
214
						' OR '.INS_CHAMPS_SIGLE_STRUCTURE.' LIKE "%'.$_POST['nom_annuaire'].'%"'.
186
					$requete .= ' and '.$tableau[$i]['nom_bdd'].'="'.$_POST[$tableau[$i]['nom_bdd']].'"';
-
 
187
				}
215
						' OR '.INS_CHAMPS_DESCRIPTION.' LIKE "%'.$_POST['nom_annuaire'].'%") ';
188
			}
216
		}
189
		}
217
		if (!$req_where) $requete .= '1';
190
		$requete .=' ORDER BY '.INS_CHAMPS_NOM;
218
		$requete .=' ORDER BY '.INS_CHAMPS_NOM;
191
		$resultat = $GLOBALS['ins_db']->query($requete);
219
		$resultat = $GLOBALS['ins_db']->query($requete);
192
		if (DB::isError($resultat)) return $resultat->getMessage().'<br />'.$resultat->getDebugInfo();
Line 249... Line 222...
249
    return $res ;
222
    return $res ;
250
}
223
}
Line 251... Line 224...
251
 
224
 
252
/**
225
/**
253
 *  Renvoie le code HTML de la liste des inscrits
226
 *  Renvoie le code HTML de la liste des inscrits
254
 *  en fonction de la requete passé en parametre
227
 *  en fonction de la requete passe en parametre
255
 *
228
 *
256
 * @return  Renvoie le code HTML de la liste des inscrits
229
 * @return  Renvoie le code HTML de la liste des inscrits
Line 257... Line 230...
257
 */
230
 */
Line 274... Line 247...
274
    	}
247
    	}
275
    	$res .= '<a href="'.$GLOBALS['ins_url']->getURL().'">'."\n";    	
248
    	$res .= '<a href="'.$GLOBALS['ins_url']->getURL().'">'."\n";    	
276
    	$res .= '<strong>'.$donnees_membres[$i][INS_CHAMPS_NOM].
249
    	$res .= '<strong>'.$donnees_membres[$i][INS_CHAMPS_NOM].
277
				'&nbsp;'.$donnees_membres[$i][INS_CHAMPS_PRENOM].'</strong>'."\n".
250
				'&nbsp;'.$donnees_membres[$i][INS_CHAMPS_PRENOM].'</strong>'."\n".
278
    	        '&nbsp;'.$donnees_membres[$i][INS_CHAMPS_CODE_POSTAL].
251
    	        '&nbsp;'.$donnees_membres[$i][INS_CHAMPS_CODE_POSTAL].
279
    	        '&nbsp;'.$donnees_membres[$i][INS_CHAMPS_VILLE];
252
    	        '&nbsp;'.stripslashes($donnees_membres[$i][INS_CHAMPS_VILLE]);
280
    	$res .= '</a>'."\n".'</li>'."\n";
253
    	$res .= '</a>'."\n".'</li>'."\n";
281
    }
254
    }
282
    $res .= '</ul>'."\n";
255
    $res .= '</ul>'."\n";
283
    if ($GLOBALS['AUTH']->getAuth()&&$affiche_form_mail) {
256
    if ($GLOBALS['AUTH']->getAuth()&&$affiche_form_mail) {
284
    	$res .= INS_CHECK_UNCHECK ;
257
    	$res .= INS_CHECK_UNCHECK ;
285
    	$res .= '&nbsp;<input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"><br />';
258
    	$res .= '&nbsp;<input type="checkbox" name="selecttotal" onclick="javascript:setCheckboxes(\'formmail\');"><br />';
286
    	$res .= '<h3>'.INS_ENVOYER_MAIL.'</h3>'."\n";
259
    	$res .= '<h3>'.INS_ENVOYER_MAIL.'</h3>'."\n";
287
    	$res .= '<p style="text-align:right;">'.INS_SUJET.'&nbsp;:&nbsp;<input style="border:1px solid #000;width:450px;" type="text" name="titre_mail"><br />'."\n".
260
    	$res .= '<p style="text-align:right;">'.INS_SUJET.'&nbsp;:&nbsp;<input style="border:1px solid #000;width:450px;" type="text" name="titre_mail"><br />'."\n".
288
           		INS_MESSAGE.'&nbsp;:&nbsp;<textarea style="border:1px solid #000;width:450px;" name="corps" rows="5" cols="60"></textarea></p>'."\n".
261
           		INS_MESSAGE.'&nbsp;:&nbsp;<textarea style="border:1px solid #000;width:450px;" name="corps" rows="5" cols="60"></textarea></p>'."\n".
289
           		'<p style="width:100px;margin:4px auto;text-align:center;"><input name="bouton_envoi_mail" type="submit" value="'.INS_ENVOYER.'" /></p>'."\n".
262
           		'<p style="width:100px;margin:4px auto;text-align:center;"><input name="bouton_envoi_mail" type="submit" value="'.INS_ENVOYER.'" /></p>'."\n".
290
           		'<p style="width:100px;margin:4px auto;text-align:center;"><input type="submit" value="'.INS_ENVOYER.'" /></p>'."\n".
-
 
291
           		'<input type="hidden" name="fin" value="true" /><input type="hidden" name="mailer" value="1" />'.
263
           		'<input type="hidden" name="fin" value="true" /><input type="hidden" name="mailer" value="1" />'.
292
				'</form>'."\n";
264
				'</form>'."\n";
293
	} else {
265
	} else {
294
		if ($affiche_form_mail) $res .='<br /><p class="zone_info">'.INS_PAS_IDENTIFIE.'</p>'."\n";
266
		if ($affiche_form_mail) $res .='<br /><p class="zone_info">'.INS_PAS_IDENTIFIE.'</p>'."\n";
295
    }
267
    }
Line 342... Line 314...
342
*	@return string  HTML
314
*	@return string  HTML
343
*/
315
*/
344
function carto_liste_fiches(&$monde, $nom_table1, $nom_table2, $nom_champs_pays, $nom_champs_cp, $requete_sql) {
316
function carto_liste_fiches(&$monde, $nom_table1, $nom_table2, $nom_champs_pays, $nom_champs_cp, $requete_sql) {
Line 345... Line 317...
345
 
317
 
346
    global $mailer;
318
    global $mailer;
Line 347... Line 319...
347
    global $select;//utilisé dans liste_inscrit.php
319
    global $select;//utilise dans liste_inscrit.php
348
    
320
    
349
	$javascript = "
321
	$javascript = "
350
	function confirmer () {
322
	function confirmer () {
Line 1337... Line 1309...
1337
 
1309
 
1338
 
1310
 
1339
//-- Fin du code source    ------------------------------------------------------------
1311
//-- Fin du code source    ------------------------------------------------------------
-
 
1312
/*
-
 
1313
* $Log$
-
 
1314
* Revision 1.28.2.1  2007-11-16 11:17:11  alexandre_tb
-
 
1315
* amelioration gestion des newsletters
-
 
1316
* amelioration de la fontion info()
-
 
1317
* suppression fct inscription_envoi_mail()
1340
/*
1318
* encodage dans les commentaires
1341
* $Log$
1319
*
1342
* Revision 1.28  2007-11-08 09:27:26  alexandre_tb
1320
* Revision 1.28  2007-11-08 09:27:26  alexandre_tb
1343
* modification de inscription_verif_doublon_mail pour compatibilite avec annuaire_backoffice
1321
* modification de inscription_verif_doublon_mail pour compatibilite avec annuaire_backoffice
1344
*
1322
*