-
Notifications
You must be signed in to change notification settings - Fork 1
/
account.php
65 lines (62 loc) · 3.78 KB
/
account.php
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Baker Classifieds - Your Account</title>
<link href = "lib/bootstrap-3.3.7-dist/css/bootstrap.min.css" rel = "stylesheet">
<link href="css/styles.css" rel="stylesheet">
<script src="https://code.jquery.com/jquery-3.3.1.min.js" integrity="sha256-FgpCb/KJQlLNfOu91ta32o/NMZxltwRo8QtmkMRdAu8=" crossorigin="anonymous"></script>
<script src="lib/bootstrap-3.3.7-dist/js/bootstrap.min.js" type="text/javascript"></script>
</head>
<body>
<?php
include "nav.php";
session_start();
?>
<div class="container">
<?php
if (isset($_SESSION['id'])){
$username = $_SESSION['username'];
$password = $_SESSION['password'];
$avatar = $_SESSION['avatar'];
$email = $_SESSION['email'];
$id = $_SESSION['id'];
echo(
'<form class = "form-account col-sm-6 col-sm-offset-3" role = "form" action = "update.php" method = "post" enctype="multipart/form-data">
<h4 class = "form-account-heading"></h4>
<label for = "username">Username:</label>
<input type = "text" class = "form-control"
name = "username"
required autofocus value=' . $username . '><br />
<label for = "password">Password:</label>
<input type = "text" class = "form-control"
name = "password" required value=' . $password . '><br />
<label for="avatar">Avatar image:</label>');
if ($avatar != ''){
echo('<img src="data:image/jpeg;base64,' . base64_encode($avatar) . '" height="100" width="100" class="img-thumbnail" />
<br />
<p>To change you avatar select a new file from here:</p>
<p>(less than 50kb)</p>
<br />
<input type="file" name="avatar" id="avatar">
<br />');
} else {
echo('<p>You currently have no avatar, you can upload one by clicking the button below.</p>
<p>(less than 50kb)</p>
<br />
<input type="file" name="avatar" id="avatar">
<br />');
}
echo(
'<label for="email">Email address:</label>
<input type="email" class="form-control" name="email" value=' . $email . '><br />
<button class = "btn btn-lg btn-primary btn-block" type = "submit"
name = "update">Update</button>
</form>');
};
?>
</div>
</body>
</html>