This repository was archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcompte.php
More file actions
90 lines (74 loc) · 2.06 KB
/
compte.php
File metadata and controls
90 lines (74 loc) · 2.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
<script text="javascript">
function switchDiv()
{
divInfo = document.getElementById('divprincipal');
if (divInfo.style.display == 'none')
divInfo.style.display = 'block';
else
divInfo.style.display = 'none';
}
</script>
<?php
error_reporting(E_ALL);
session_start();
include("includes/config.php");
include("includes/functions.php");
include("header.php");
include ("menu.php");
// --- Si deja connecte
//
if (isset($_SESSION['id']) && isset($_SESSION['username'])) {
$sqlavatar = $bdd->prepare('SELECT * FROM users WHERE id = :id');
$sqlavatar->execute(array(':id' => $_SESSION['id']));
$sqlav = $sqlavatar->fetch();
// echo $sqlav['avatar'];
// <input type="submit" name="submit" value="Envoyer">
echo '
<center>
<div id="profilborder">
<form action="validprofil.php" method="post" enctype="multipart/form-data">
<h2>Aperçu du compte</h2>
</br>
<img src="img/avatar/'.$sqlav['avatar'].'">
</br>
</br>
<p>Utilisateur: '.$sqlav['username'].'</p>
<p>Mail: '.$sqlav['email'].'</p>
<div id="titre">
<button type="button" onclick="switchDiv()">éditer informations personnelles</button>
<div id="divprincipal" >
</br>
<div id="modif_avatar">
<p id="titrecompte">Modifier avatar</p>
<label for="file"></label>
<input type="file" name="file" id="file"/></br>
</div>
</br>
<div id="modif_password" >
<p id="titrecompte">Modifier mot de passe</p>
<p id="label">Ancien mot de passe:</p>
<input type="password" name="oldp">
</br>
<p id="label">Nouveau mot de passe:</p>
<input type="password" name="newp1">
</br>
<p id="label">Répéter nouveau mot de passe:</p>
<input type="password" name="newp2">
</div>
</br>
<div id="modif_mail">
<p id="titrecompte">Modifier Mail</p>
<p id="label">Nouveau mail:</p>
<input type="text" name="newm"><br>
</div>
</br>
<input type="submit" name="submit" value="Enregistrer les modifications">
</div>
</div>
</br>
</form>
</div>
</center>
';
}
?>