-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsettings.page.php
More file actions
97 lines (87 loc) · 2.67 KB
/
settings.page.php
File metadata and controls
97 lines (87 loc) · 2.67 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
91
92
93
94
95
96
97
<?php
require __DIR__.'/autoload.php';
if (!checkLogin($db)) {
header('Location: /');
}
$pageTitle = 'Linkify - Settings';
$posts = null;
require __DIR__.'/views/partials/header.php';
?>
<div class="content">
<div class="settingsWrap">
<div class="displayUserProfile displayUserSettings">
<figure>
<?php if ($user['avatar'] !== null) {
?>
<img src="/assets/images/users/<?=$user['id']?>/<?=$user['avatar']?>" alt="users profile avatar" />
<?php
} else {
?>
<img src="/assets/images/profileicon.png" alt="users profile avatar" />
<?php
} ?>
</figure>
<h4><?=$user['name']?></h4>
<h5>@<?=$user['username']?></h5>
<p><?=$user['about']?></p>
</div>
<div class="settings">
<h2 class="settingsHeading">Account settings</h2>
<form action="app/settings.php" method="post" class="settingsForm" enctype="multipart/form-data">
<?php if ($error) {
?>
<div class="settingsError">
<?= $error; ?>
</div>
<?php unset($_SESSION['error']);
} ?>
<div class="change">
<h3>Change username:</h3>
<input type="text" name="editUsername" value="<?=$user['username']?>">
</div>
<div class="change">
<h3>Change email:</h3>
<input type="text" name="editEmail" value="<?=$user['email']?>">
</div>
<div class="change">
<h3>Change name:</h3>
<input type="text" name="editFullName" value="<?=$user['name']?>">
</div>
<div class="change">
<h3>Change password:</h3>
<input type="password" name="editPassword" placeholder="Write new password..."></br>
<input type="password" name="repeatPassword" placeholder="Repeat new password...">
</div>
<div class="change">
<h3>About me:</h3>
<textarea name="about"><?= $user['about']?></textarea>
</div>
<div class="change">
<h3>Upload profile picture:</h3>
<input type="file" name="avatar" accept="image/png, image/jpeg">
<div class="placeholderAvatar">
<?php if ($user['avatar'] !== null) {
?>
<img src="/assets/images/users/<?=$user['id']?>/<?=$user['avatar']?>" alt="users current profile avatar" />
<?php
} else {
?>
<img src="/assets/images/profileicon.png" alt="avatar placeholder" />
<?php
} ?>
</div>
</div>
<div class="change saveChanges">
<h3>Save changes:</h3>
<input type="password" name="saveWithPassword" placeholder="Type in your password...">
<input type="submit" name="saveChanges" value="Save">
</div>
</form>
</div>
</div>
</div>
</div> <!-- end page -->
<?php
require __DIR__.'/views/partials/navigation.php';
require __DIR__.'/views/partials/footer.php';
?>