$adresse_parent1 = $DB_TAB_parents[1]['adresse_ligne1'] . $DB_TAB_parents[1]['adresse_ligne2'] . $DB_TAB_parents[1]['adresse_ligne3'] . $DB_TAB_parents[1]['adresse_ligne4'] . $DB_TAB_parents[1]['adresse_postal_code'] . $DB_TAB_parents[1]['adresse_postal_libelle'] . $DB_TAB_parents[1]['adresse_pays_nom']; if ($adresse_parent0 != $adresse_parent1) { // Voir levenshtein() voir http://fr.php.net/levenshtein // Autre méthode dénichée mais non essayée : http://tonyarchambeau.com/blog/400-php-coefficient-de-dice/ if (levenshtein($adresse_parent0, $adresse_parent1) < 10) { $parent_id0 = $DB_TAB_parents[0]['parent_id']; $parent_id1 = $DB_TAB_parents[1]['parent_id']; if (!isset($tab_parents_id[$parent_id0]) && !isset($tab_parents_id[$parent_id1])) { $tab_parents_id[] = $parent_id0; $tab_parents_id[] = $parent_id1; } } } } } $DB_TAB = count($tab_parents_id) ? DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants(TRUE, TRUE, '', '', implode(',', $tab_parents_id), TRUE) : array(); // Préparation de l'export CSV $separateur = ';'; $export_csv = 'NOM PRENOM' . $separateur . 'ADRESSE L1' . $separateur . 'ADRESSE L2' . $separateur . 'ADRESSE L3' . $separateur . 'ADRESSE L4' . $separateur . 'ADRESSE CP' . $separateur . 'ADRESSE COMMUNE' . $separateur . 'ADRESSE PAYS' . $separateur . 'RESPONSABILITES' . "\r\n\r\n"; } } ?> <table id="table_action" class="form t9 hsort"> <thead> <tr> <th>Resp</th> <th>Nom Prénom</th> <th>Adresse (4 lignes)</th> <th>C.P.</th> <th>Commune</th>
// Lister les parents, par nom / prénom ou recherche d'homonymies if(!$find_doublon) { $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants( FALSE /*with_adresse*/ , $statut , $debut_nom , $debut_prenom ); } elseif($find_doublon) // (forcément) { $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::lister_parents_homonymes(); if(!empty($DB_TAB)) { $tab_parents_id = array(); foreach($DB_TAB as $DB_ROW) { $tab_parents_id = array_merge( $tab_parents_id , explode(',',$DB_ROW['identifiants']) ); } $DB_TAB = count($tab_parents_id) ? DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants( FALSE /*with_adresse*/ , TRUE /*statut*/ , '' /*debut_nom*/ , '' /*debut_prenom*/ , implode(',',$tab_parents_id) ) : array() ; // Préparation de l'export CSV $separateur = ';'; // ajout du préfixe 'ENT_' pour éviter un bug avec M$ Excel « SYLK : Format de fichier non valide » (http://support.microsoft.com/kb/323626/fr). $export_csv = 'ENT_ID'.$separateur.'SCONET_ID'.$separateur.'NOM'.$separateur.'PRENOM'.$separateur.'RESPONSABILITES'."\r\n\r\n"; } } ?> <table id="table_action" class="form t9 hsort"> <thead> <tr> <th class="nu"><q class="cocher_tout" title="Tout cocher."></q><br /><q class="cocher_rien" title="Tout décocher."></q></th> <th>Resp</th> <th>Id. ENT</th> <th>Id. GEPI</th>
<th>Id. ENT</th> <th>Id. GEPI</th> <th>Id Sconet</th> <th>Référence</th> <th>Nom</th> <th>Prénom</th> <th>Login</th> <th>Mot de passe</th> <th>Date sortie</th> <th class="nu"><q class="ajouter" title="Ajouter un parent."></q></th> </tr> </thead> <tbody> <?php // Lister les parents $DB_TAB = DB_STRUCTURE_ADMINISTRATEUR::DB_lister_parents_avec_infos_enfants( FALSE /*with_adresse*/ , $statut , $debut_nom , $debut_prenom ); if(!empty($DB_TAB)) { foreach($DB_TAB as $DB_ROW) { // Formater la date (dont on ne garde que le jour) $date_mysql = $DB_ROW['user_sortie_date']; $date_affich = ($date_mysql!=SORTIE_DEFAUT_MYSQL) ? convert_date_mysql_to_french($date_mysql) : '-' ; // Afficher une ligne du tableau echo'<tr id="id_'.$DB_ROW['user_id'].'">'; echo '<td class="nu"><input type="checkbox" name="f_ids" value="'.$DB_ROW['user_id'].'" /></td>'; echo ($DB_ROW['enfants_nombre']) ? '<td>'.$DB_ROW['enfants_nombre'].' <img alt="" src="./_img/bulle_aide.png" title="'.str_replace('§BR§','<br />',html($DB_ROW['enfants_liste'])).'" /></td>' : '<td>0 <img alt="" src="./_img/bulle_aide.png" title="Aucun lien de responsabilité !" /></td>' ; echo '<td class="label">'.html($DB_ROW['user_id_ent']).'</td>'; echo '<td class="label">'.html($DB_ROW['user_id_gepi']).'</td>'; echo '<td class="label">'.html($DB_ROW['user_sconet_id']).'</td>'; echo '<td class="label">'.html($DB_ROW['user_reference']).'</td>';