2024-06-10 23:23:51 +02:00
|
|
|
<?php
|
|
|
|
header("Cache-Control: no-store, no-cache, must-revalidate, max-age=0");
|
|
|
|
header("Cache-Control: post-check=0, pre-check=0", false);
|
|
|
|
header("Pragma: no-cache");
|
|
|
|
|
|
|
|
require_once $_SERVER['DOCUMENT_ROOT'] . '/tools/dbConnect.php';
|
|
|
|
session_start();
|
|
|
|
|
|
|
|
if (isset($_COOKIE['userData'])) {
|
|
|
|
$userDataEncoded = $_COOKIE['userData'];
|
|
|
|
$userData = json_decode($userDataEncoded, true); // 'true' pour obtenir un tableau associatif
|
|
|
|
|
|
|
|
$email = $userData['email'];
|
|
|
|
$name = $userData['name'];
|
|
|
|
$familyName = $userData['familyName'];
|
|
|
|
$role = $userData['role'];
|
|
|
|
} else {
|
|
|
|
header("Location: /account/login");
|
|
|
|
}
|
|
|
|
?>
|
|
|
|
|
|
|
|
|
2024-06-09 17:07:43 +02:00
|
|
|
<!DOCTYPE html>
|
|
|
|
<html lang="fr">
|
|
|
|
|
|
|
|
<head>
|
|
|
|
<meta charset="UTF-8" />
|
|
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
|
|
<link rel="stylesheet" href="../../styles/main.css" />
|
|
|
|
<link rel="stylesheet" href="../../styles/header.css" />
|
|
|
|
<link rel="stylesheet" href="../../styles/footer.css" />
|
|
|
|
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" rel="stylesheet" />
|
|
|
|
|
|
|
|
<link rel="icon" type="image/png" sizes="32x32"
|
|
|
|
href="https://tickets.paris2024.org/obj/media/FR-Paris2024/specialLogos/favicons/favicon-32x32.png" />
|
2024-06-10 23:23:51 +02:00
|
|
|
<script src="https://kit.fontawesome.com/f16a36bad3.js"
|
|
|
|
crossorigin="anonymous">if (!document.cookie.includes("userData")) { window.location.href = '/account/login'; }</script>
|
|
|
|
|
2024-06-09 17:07:43 +02:00
|
|
|
<title>Mon profil | Jeux Olympiques - Paris 2024</title>
|
|
|
|
</head>
|
|
|
|
|
|
|
|
<body>
|
|
|
|
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/header.php') ?>
|
|
|
|
|
2024-06-10 23:23:51 +02:00
|
|
|
<h1>Mon profil :</h1>
|
|
|
|
|
2024-06-11 10:56:40 +02:00
|
|
|
<div class="login-container" style="margin-top: 1rem;">
|
|
|
|
<img src="https://cdn-icons-png.flaticon.com/512/4139/4139948.png" alt="Avatar">
|
|
|
|
<h2>Mettre à jour mes informations</h2>
|
|
|
|
<p>Modifiez les informations de votre profil.</p>
|
2024-06-11 22:49:01 +02:00
|
|
|
<?php
|
|
|
|
if (isset($_GET['result'])) {
|
|
|
|
if ($_GET['result'] == "updatefailed") {
|
|
|
|
echo "<p class='text' style='color:red; padding-left:0;'>❎ Une erreur est survenue lors de la mise à jour de vos informations.</p>";
|
|
|
|
} else if ($_GET["result"] == "updatesuccess") {
|
|
|
|
echo "<p class='text' style='color:green; padding-left:0;'>✅ Vos informations ont été mises à jour avec succès.</p>";
|
|
|
|
}
|
|
|
|
}
|
|
|
|
?>
|
2024-06-11 10:56:40 +02:00
|
|
|
<form action="/tools/updater.php" method="post">
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="name"><span style="color:red;"><abbr title="Requis">*</abbr></span> Prénom</label>
|
|
|
|
<input type="text" id="name" name="name" value="<?php echo $name ?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="family_name"><span style="color:red;"><abbr title="Requis">*</abbr></span> Nom</label>
|
|
|
|
<input type="text" id="family_name" name="family_name" value="<?php echo $familyName ?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="email"><span style="color:red;"><abbr title="Requis">*</abbr></span> Adresse mail</label>
|
|
|
|
<input type="email" id="email" name="email" value="<?php echo $email ?>">
|
|
|
|
</div>
|
|
|
|
<div class="form-group">
|
|
|
|
<label for="password"><span style="color:red;"><abbr title="Requis">*</abbr></span> Mot de passe</label>
|
|
|
|
<input type="password" id="password" name="password" required placeholder="••••••••" placeholder=" ">
|
|
|
|
</div>
|
2024-06-10 23:23:51 +02:00
|
|
|
|
2024-06-11 23:00:54 +02:00
|
|
|
<div class="form-group">
|
|
|
|
<label for="role">Rôle</label>
|
|
|
|
<input type="text" id="role" name="role" style="cursor: not-allowed;" value="<?php echo $role ?>"
|
|
|
|
disabled>
|
|
|
|
<button type="submit" class="submit-button"><i class="fas fa-sign-in-alt"></i>
|
|
|
|
Mettre à jour mes informations</i></button>
|
|
|
|
</div>
|
2024-06-11 10:56:40 +02:00
|
|
|
</form>
|
|
|
|
|
|
|
|
</div>
|
2024-06-09 17:07:43 +02:00
|
|
|
|
|
|
|
<?php include ($_SERVER['DOCUMENT_ROOT'] . '/views/footer.php') ?>
|
|
|
|
</body>
|
|
|
|
|
|
|
|
</html>
|