Ajout page profil

admin
remi.biette 5 years ago
parent a9dc7b843d
commit a682ee2890

@ -0,0 +1,22 @@
*{
margin: 0;
padding: 0;
font-family: "Arial";
}
#divImgProfil{
width: 100%;
display: flex;
flex-wrap: nowrap;
justify-content: center;
}
#imgProfil{
background-color: white;
margin-top: 2.5em;
width: 60%;
height: 60%;
max-width: 210px;
max-height: 210px;
border-radius: 10px;
}

@ -0,0 +1,78 @@
<?php
require ('connectionBD.php');
include ('tableauBord.php');
if (!$_SESSION){
session_start();
}
if (!isset($_SESSION['mail'])){
header('Location: index.php');
exit();
}
$user = getUser($_SESSION['mail']);
if (!$user){
header('Location: profil.php?error=7');
exit();
}
function getUser($mail){
global $db;
$result = pg_query_params($db,"SELECT * FROM Utilisateur WHERE mail = $1;", array($mail));
return pg_fetch_array($result);
}
?>
<!DOCTYPE html>
<html lang="fr">
<head>
<meta charset="UTF-8">
<link rel="stylesheet" href="style.css">
<title>Profil</title>
<script src="inscription.js"></script>
</head>
<body>
<div id="formulaire">
<h1>Profil</h1>
<form method="post" enctype="multipart/form-data" action="inscription.php">
<div class="line">
<label for="mail_field">Adresse mail : </label>
<input id="mail_field" class="form" type="email" maxlength="100" readonly value="<?php echo $user['mail']; ?>">
</div>
<div class="line">
<label for="login_field">Login : </label>
<input id="login_field" class="form" name="login_field" type="text" maxlength="50" value="<?php echo $user['login'];?>" required>
</div>
<div class="line">
<a href="changePass.php" title="Changer de mot de passe">Changer de mot de passe.</a>
</div>
<div class="line">
<label for="prenom_field">Prénom : </label>
<input id="prenom_field" class="form" name="prenom" type="text" maxlength="50" value="<?php echo $user['prenom'];?>" required>
</div>
<div class="line">
<label for="nom_field">Nom : </label>
<input id="nom_field" class="form" name="nom" type="text" maxlength="50" value="<?php echo $user['nom'];?>" required>
</div>
<div class="line">
<label for="dateN_field">Date de naissance : </label>
<input id="dateN_field" class="form" readonly="readonly" type="date" value="<?php echo $user['datenaissance'];?>" required>
</div>
<div class="line">
<label for="phone_field">Numéro de téléphone : </label>
<input id="phone_field" class="form" name="phone" type="tel" pattern="[0-9]{10}" maxlength="10" value="<?php echo $user['telephone'];?>" required>
</div>
<div class="line">
<label for="avatar">Image du Profil :</label>
<input type="file" id="avatar" class="form" name="avatar" accept="image/png">
</div>
<?php
printError();
?>
<input id="submit" class="button" type="submit" value="S'inscrire">
</form>
<p id="enregistrer">Si vous avez déjà un compte <a href="index.php" title="S'identifier">cliquez ici</a>.</p>
</div>
</body>
</html>
Loading…
Cancel
Save