-
Notifications
You must be signed in to change notification settings - Fork 0
/
profile_edit.php
175 lines (148 loc) · 6.09 KB
/
profile_edit.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
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
<?php
$pagetitle = 'Profile edit';
include 'header.php';
include 'menu.php';
include 'db.php';
$link = opendb();
include_once 'check_if_logged_in.php';
?>
<?php
$userid = $_SESSION['userid'];
$query = "SELECT * FROM user WHERE user.id = $userid LIMIT 0, 1";
$eredmeny = mysqli_query($link, $query);
$user = mysqli_fetch_array($eredmeny);
if (!$user) {
header("Location: index.php?error=no_user_found");
mysqli_close($link);
}
include 'save_profile_changes.php';
include 'save_password_change.php';
?>
<div class="container">
<div class="row text-black-50">
<div class="col-9">
<form method="POST">
<input type="hidden" name="ezvajonmirejo" value="<?= $userid ?>"/>
<table class="table table-striped table-borderless align-middle text-center">
<tr>
<th class="col-3">
<h2 class="text-white">User data</h2>
</th>
</tr>
<tr>
<th class="bg-white">
Name
</th>
<th>
</th>
<th class="bg-white col-3">
E-mail address
</th>
<th>
</th>
<th class="bg-white">
Discord ID
</th>
<th>
</th>
<th class="bg-white">
Steam ID
</th>
<th>
</th>
<th class="bg-white">
ELO points(non-editable)
</th>
</tr>
<tr>
<div class="form-group">
<td class="bg-white">
<input type="text" class="form-control" id="nev" name="nev" value='<?= $user['nev'] ?>'>
</td>
</div>
<td>
</td>
<div class="form-group">
<td class="bg-white">
<input type="text" class="form-control" id="email" name="email" value='<?= $user['email'] ?>'>
</td>
</div>
<td>
</td>
</td>
<div class="form-group">
<td class="bg-white">
<input required type="text" class="form-control" id="discordid" name="discordid"
value='<?= (isset($user['discordid']) ? $user['discordid'] : '') ?>'>
</td>
</div>
<td>
</td>
</td>
<div class="form-group">
<td class="bg-white">
<input required type="text" class="form-control" id="steamid" name="steamid"
value='<?= isset($user['steamid']) ? $user['steamid'] : '' ?>'>
</td>
</div>
<td>
</td>
<td class="bg-white">
<?php echo $user['elo'];?>
</td>
</tr>
<tr>
<td>
<input type="submit" class="btn btn-success" href='profile.php' value="Save changes" />
</td>
</tr>
<tr>
<td>
<a class="btn btn-danger" href='profile.php'> Cancel </a>
</td>
</tr>
</table>
</form>
</div>
<div class="col-6">
<br>
<h2 class="text-white"><?= (!isset($error)) ? '' : $error ?> </h2>
</div>
</div>
</div>
<br>
<div class="container">
<div class="row text-black-50">
<div class="col-3">
<table class="card table table-borderless">
<tr>
<th>
<h2 class="text-black">Change password</h2>
</th>
</tr>
<td class="bg-white">
<form method="POST">
<input type="hidden" name="ezvajonmirejo" value=<?= $user['id'] ?> />
<label for="inputOldPassword1" class="form-label mt-1">Old password</label>
<input type="password" id="inputOldPassword" name="inputOldPassword" class="form-control mb-2" placeholder="Old password">
<label for="inputNewPassword1" class="form-label mt-1">New password</label>
<input type="password" id="inputNewPassword1" name="inputNewPassword1" class="form-control" placeholder="New password">
<label for="inputNewPassword2" class="form-label mt-2">New password again</label>
<input type="password" id="inputNewPassword2" name="inputNewPassword2" class="form-control mb-2" placeholder="New password again" aria-describedby="passwordHelp">
<div id="passwordHelp" class="form-text m-auto p-1">
The password must contain at least 8 characters, small and capital letters and a number.
</div>
<input type="submit" class="btn btn-danger mt-2" href='profile.php' value="Save changed password" />
</form>
</td>
</table>
</div>
</div>
</div>
<?php
include 'footer.php';
?>