[x] Modifier l'affichage du profil

This commit is contained in:
xdrm-brackets 2016-01-07 21:51:25 +01:00
parent 5bf45d32d1
commit b588868ed7
1 changed files with 15 additions and 5 deletions

View File

@ -40,20 +40,30 @@ require_once __ROOT__.'/manager/security.php';
/***************/
/*** PROFILE ***/
/***************/
/**************/
/*** PROFIL ***/
/**************/
if( connected() ){ // si l'utilisateur est connecté
$infos = userRepo::info($_SESSION['identifiant']);
$droits = explode(',', $infos['droits']);
echo "<section name='myprofile' data-title='Profil'>";
echo '<p>';
echo 'Nom : '.ucfirst($infos['nom']).'<br><br>';
echo 'Prénom : '.ucfirst($infos['prenom']).'<br><br>';
echo 'Statut : ';
$count = 0;
foreach ($droits as $droit) {
echo "<span class='link'>".$droit.'</span>';
echo '&nbsp&nbsp&nbsp';
if( $count > 0 ) echo ', ';
switch($droit){
case 'admin' : echo '<span>administrateur</span>'; break;
case 'master' : echo '<span>référent</span>'; break;
case 'teacher': echo '<span>enseignant</span>'; break;
case 'student': echo '<span>étudiant</span>'; break;
default: echo '<span>inconnu</span>'; break;
}
$count++;
}
echo '<br><br>';
echo 'Mail : '.$infos['mail'];