$lignes_inconnu .= '<tr><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td>non cherché car ' . $DB_ROW['user_profil_nom_court_singulier'] . ' sans Id Sconet</td></tr>' . NL;
     } else {
         list($code_erreur, $tab_valeurs_retournees) = recuperer_infos_user_LCS($DB_ROW['user_profil_type'], $DB_ROW['user_sconet_elenoet'], $DB_ROW['user_sconet_id']);
         if ($code_erreur) {
             // Contenu de SACoche à problème : retour erroné du LCS
             $lignes_pb .= '<tr><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td>non trouvé : erreur LCS n°' . html($code_erreur) . '</td></tr>' . NL;
         } elseif (count($tab_valeurs_retournees) == 0) {
             // Contenu de SACoche à ignorer : utilisateur non trouvé dans le LCS
             $identifiant = $DB_ROW['user_profil_type'] == 'eleve' ? $DB_ROW['user_sconet_elenoet'] : $DB_ROW['user_sconet_id'];
             $lignes_inconnu .= '<tr><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td>Identifiant ' . html($identifiant) . ' non trouvé dans le LCS</td></tr>' . NL;
         } elseif (count($tab_valeurs_retournees) != 1) {
             // Contenu de SACoche à problème : plusieurs réponses retournées par le LCS
             $identifiant = $DB_ROW['user_profil_type'] == 'eleve' ? $DB_ROW['user_sconet_elenoet'] : $DB_ROW['user_sconet_id'];
             $lignes_pb .= '<tr><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td>Identifiant ' . html($identifiant) . ' trouvé plusieurs fois dans le LCS</td></tr>' . NL;
         } else {
             $id_ent_LCS = Clean::id_ent($tab_valeurs_retournees[0]);
             if ($DB_ROW['user_id_ent'] == $id_ent_LCS) {
                 // Contenu de SACoche à ignorer : id_ent identique
                 $lignes_ras .= '<tr><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td>identifiant du LCS identique</td></tr>' . NL;
             } else {
                 // Contenu de SACoche à modifier : id_ent nouveau
                 DB_STRUCTURE_ADMINISTRATEUR::DB_modifier_user($DB_ROW['user_id'], array(':id_ent' => $id_ent_LCS));
                 $user_info = $DB_ROW['user_profil_type'] == 'eleve' ? $DB_ROW['groupe_nom'] : $DB_ROW['user_profil_nom_court_singulier'];
                 $lignes_modif .= '<tr class="new"><td>' . html($DB_ROW['user_nom'] . ' ' . $DB_ROW['user_prenom'] . ' [' . $DB_ROW['user_id_ent'] . ']') . '</td><td class="b">Id ENT : ' . html($id_ent_LCS) . '</td></tr>' . NL;
             }
         }
     }
 }
 // On affiche le bilan
 echo '<ul class="puce"><li><b>Résultat de l\'analyse et des opérations effectuées :</b></li></ul>' . NL;
 echo '<table>' . NL;
Пример #2
0
      'login'     => '',
      'classe'    => NULL,
      'groupes'   => array(),
    );
  }
}

// Les parents
if(!empty($tab_annuaire['parents']))
{
  foreach($tab_annuaire['parents'] as $tab_infos)
  {
    $user_id         = Clean::entier($tab_infos['user_id']);
    $user_nom        = Clean::nom($tab_infos['nom']) ;
    $user_prenom     = Clean::prenom($tab_infos['prenom']) ;
    $user_id_ent     = Clean::id_ent($tab_infos['id_ent']);
    $tab_parents[$user_id] = array(
      'nom'       => $user_nom,
      'prenom'    => $user_prenom,
      'id_ent'    => $user_id_ent,
      'login'     => '',
      'adresse'   => array(),
      'enfants'   => array(),
    );
  }
}

/****************************************************************************************************
 * Récupérer les informations sur les matières.
 ****************************************************************************************************/
Пример #3
0
/**
 * recuperer_infos_Laclasse
 * 
 * @param string   $UAI
 * @return array|string
 */
function recuperer_infos_Laclasse($UAI)
{
  // Appeler l'annuaire ENT Laclasse.com
  $tab_Laclasse = Laclasse::get_info_from_annuaire( $UAI , '' , FALSE /*exit_if_error*/ , TRUE /*with_details*/ );
  // Enregistrer la réponse pour aider au débuggage si besoin
  FileSystem::ecrire_fichier( CHEMIN_DOSSIER_IMPORT.'Laclasse_'.$UAI.'_recup_IdEnt_'.fabriquer_fin_nom_fichier__date_et_alea().'.txt' , print_r($tab_Laclasse,TRUE) );
  // On examine la réponse
  if(!is_array($tab_Laclasse))
  {
    exit($tab_Laclasse);
  }
  // Pour récupérer les données des utilisateurs
  $tab_users_annuaire              = array();
  $tab_users_annuaire['ordre']     = array();
  $tab_users_annuaire['profil']    = array();
  $tab_users_annuaire['id_ent']    = array();
  $tab_users_annuaire['nom']       = array();
  $tab_users_annuaire['prenom']    = array();
  $tab_users_annuaire['id_sconet'] = array(); // Ne servira que pour les élèves
  if(!empty($tab_Laclasse['personnel']))
  {
    foreach($tab_Laclasse['personnel'] as $tab_infos)
    {
      $user_profil = NULL;
      if( in_array( $tab_infos['profil_id'] , array('DIR','DOC','ENS') ) )
      {
        // Personnels de direction, enseignants y compris professeur documentaliste
        $ordre = 1;
        $user_profil = $tab_infos['profil_id'];
      }
      else if($tab_infos['profil_id']=='ETA')
      {
        if($tab_infos['libelle']=='EDUCATION')
        {
          // CPE
          $ordre = 1;
          $user_profil = 'EDU';
        }
        elseif($tab_infos['description']=='ENCADRE. SUR. DES ELEVES (HORS INTERNAT)')
        {
          // Surveillants
          $ordre = 4;
          $user_profil = 'SUR';
        }
        elseif($tab_infos['libelle']=='ASSISTANT D\'EDUCATION')
        {
          // AED
          $ordre = 4;
          $user_profil = 'AED';
        }
        elseif($tab_infos['libelle']=='ORIENTATION')
        {
          // Co-Psy
          $ordre = 4;
          $user_profil = 'ORI';
        }
        elseif($tab_infos['libelle']=='PERSONNELS ADMINISTRATIFS')
        {
          // Personnels administratifs
          $ordre = 4;
          $user_profil = 'ADF';
        }
      }
      else if($tab_infos['profil_id']=='EVS')
      {
        // Personnels medico-sociaux
        $ordre = 4;
        $user_profil = 'MDS';
      }
      if($user_profil)
      {
        $tab_users_annuaire['ordre'    ][] = $ordre;
        $tab_users_annuaire['profil'   ][] = $user_profil;
        $tab_users_annuaire['id_ent'   ][] = Clean::id_ent($tab_infos['id_ent']);
        $tab_users_annuaire['nom'      ][] = Clean::nom($tab_infos['nom']);
        $tab_users_annuaire['prenom'   ][] = Clean::prenom($tab_infos['prenom']);
        $tab_users_annuaire['id_sconet'][] = NULL;
      }
    }
  }
  // Les élèves
  if(!empty($tab_Laclasse['eleves']))
  {
    foreach($tab_Laclasse['eleves'] as $tab_infos)
    {
      $tab_users_annuaire['ordre'    ][] = 2;
      $tab_users_annuaire['profil'   ][] = 'ELV';
      $tab_users_annuaire['id_ent'   ][] = Clean::id_ent($tab_infos['id_ent']);
      $tab_users_annuaire['nom'      ][] = Clean::nom($tab_infos['nom']);
      $tab_users_annuaire['prenom'   ][] = Clean::prenom($tab_infos['prenom']);
      $tab_users_annuaire['id_sconet'][] = Clean::entier($tab_infos['id_sconet']);
    }
  }
  // Les parents
  if(!empty($tab_Laclasse['parents']))
  {
    foreach($tab_Laclasse['parents'] as $tab_infos)
    {
      $tab_users_annuaire['ordre'    ][] = 3;
      $tab_users_annuaire['profil'   ][] = 'TUT';
      $tab_users_annuaire['id_ent'   ][] = Clean::id_ent($tab_infos['id_ent']);
      $tab_users_annuaire['nom'      ][] = Clean::nom($tab_infos['nom']);
      $tab_users_annuaire['prenom'   ][] = Clean::prenom($tab_infos['prenom']);
      $tab_users_annuaire['id_sconet'][] = NULL;
    }
  }
  // On trie
  array_multisort(
    $tab_users_annuaire['ordre'] , SORT_ASC,SORT_NUMERIC,
    $tab_users_annuaire['profil'], SORT_ASC,SORT_STRING,
    $tab_users_annuaire['nom']   , SORT_ASC,SORT_STRING,
    $tab_users_annuaire['prenom'], SORT_ASC,SORT_STRING,
    $tab_users_annuaire['id_ent'],
    $tab_users_annuaire['id_sconet']
  );
  // On retire l'ordre dont on n'a plus besoin
  unset($tab_users_annuaire['ordre']);
  // On retourne le tableau
  return $tab_users_annuaire;
}