forked from gymdb/speechday
-
Notifications
You must be signed in to change notification settings - Fork 1
/
profile.php
71 lines (64 loc) · 2.53 KB
/
profile.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
<?php include_once 'inc/header.php'; ?>
<script type='text/javascript' src='js/profile.js'></script>
<script type='text/javascript' src='js/validation.min.js'></script>
<?php
$user = AuthenticationManager::getAuthenticatedUser();
function getRoleInGerman($role){
switch ($role) {
case 'admin':
return 'Administrator';
break;
case 'student':
return 'Schüler';
break;
case 'teacher':
return 'Lehrer';
break;
default:
return 'Unbekannt';
}
}
?>
<div class='container'>
<h1>Benutzerprofil</h1>
<table class='table table-striped'>
<tr>
<th>Benutzername</th>
<td><?php echo escape($user->getUserName()); ?></td>
</tr>
<tr>
<th>Vorname</th>
<td><?php echo escape($user->getFirstName()); ?></td>
</tr>
<tr>
<th>Nachname</th>
<td><?php echo escape($user->getLastName()); ?></td>
</tr>
<tr>
<th>Klasse</th>
<td><?php echo escape($user->getClass()); ?></td>
</tr>
<tr>
<th>Rolle</th>
<td><?php echo escape(getRoleInGerman($user->getRole())); ?></td>
</tr>
</table>
</div>
<div class='container'>
<h1>Passwort ändern</h1>
<form id='changeUsersForm'>
<div class='form-group'>
<!--<label for='inputPassword'>Passwort</label>-->
<input type='password' class='form-control' id='inputPassword' name='password' placeholder='Passwort'>
<input type='hidden' id='inputUserName' name='userName' value='<?php echo escape($user->getUserName()); ?>'>
<input type='hidden' id='inputUserId' name='userId' value='<?php echo escape($user->getId()); ?>'>
<input type='hidden' id='inputFirstName' name='firstName' value='<?php echo escape($user->getFirstName()); ?>'>
<input type='hidden' id='inputLastName' name='lastName' value='<?php echo escape($user->getLastName()); ?>'>
<input type='hidden' id='inputClass' name='class' value='<?php echo escape($user->getClass()); ?>'>
<input type='hidden' id='inputType' name='type' value='<?php echo escape($user->getRole()); ?>'>
</div>
<button type='submit' class='btn btn-primary' id='btn-edit-user-pwd'>Passwort ändern</button>
</form>
<div id='changePasswortChangeMessage'></div>
</div>
<?php include_once 'inc/footer.php'; ?>