<?php
if ($return =="mdp-modif-error"){
    echo "<p style='color:red;'>Les mots de passe ne correspondent pas</p>";
}
elseif($return == 'email-modif-error'){
    echo "<p style='color:red;'>Ce mail est déja associé à un compte.</p>";
}
echo "<a class='retour' href='index.php?action=affiche-profil&id=". $_SESSION['id_utilisateur']."";
echo "'>< Retour</a><br><br>";
echo "<h1>Modifier votre profil : </h1><br><br><br>";
echo '<form action="index.php?action=traite-modif-profil" enctype="multipart/form-data" class="form-inscription" method="post">';
echo "<span class='form-preview-pp'>
        <label for='photo'> <img class='pp-preview' id='img-preview' src='img/img";
        if (file_exists('img/img'.$_SESSION['id_utilisateur'].'.png')){
            echo $_SESSION['id_utilisateur'].".png'";
        }
        elseif(file_exists('img/img'.$_SESSION['id_utilisateur'].'.jpg')){
            echo $_SESSION['id_utilisateur'].".jpg'";
        }
        else{
            echo "0.png'";
        }
echo " alt=''></label>
        <input type='file' name='fichier' id='photo' class='input-file' accept='image/png, image/jpeg' >
        <div class='reset-pp'> Réinitialiser </div>
</span>";
echo '<span<<label for="prenom">Prénom</label><br>';
echo '<input type="text" id="prenom" name="prenom" value="'.$_SESSION['prenom'].'"><br><br>';
echo '<label for="nom">Nom</label><br>';
echo '<input type="text" id="nom" name="nom" value="'.$_SESSION['nom'].'"><br><br>';
echo '<label for="email">Email</label><br>';
echo '<input type="email" id="email" name="email" value="'.$_SESSION['email'].'"><br><br>';
echo '<label for="mdp">Mot de passe</label><br>';
echo '<input type="password" id="mdp" name="mdp"><br><br>';
echo '<label for="mdp2">Confirmer le mot de passe</label><br>';
echo '<input type="password" id="mdp2" name="mdp_verif"><br><br>';
echo '<input type="submit" value="Modifier"></span>';
echo '</form>';
?>