-
Notifications
You must be signed in to change notification settings - Fork 0
/
admin.php
57 lines (52 loc) · 1.7 KB
/
admin.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
<?php
require_once "util/DBConnection.php";
session_start();
if($_SESSION['login'] !== True) {
header('LOCATION:login.php');
die();
}
?>
<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<title>Admin</title>
</head>
<body>
<table class="table table-striped table-dark table-bordered">
<tr>
<th>id</th>
<th>Vorname</th>
<th>Nachname</th>
<th>username</th>
<th>eMail</th>
<th>Hash</th>
</tr>
<?php
$db = DBConnection::getConnection();
$stmt = $db->prepare("SELECT * FROM user");
$stmt->bindParam(':username', $_SESSION['username']);
$stmt->execute();
$data = $stmt->fetchALL(PDO::FETCH_OBJ);
foreach($data as $user){
echo('
<tr>
<td>'.$user->id.'</td>
<td>'.$user->name.'</td>
<td>'.$user->surname.'</td>
<td>'.$user->username.'</td>
<td>'.$user->eMail.'</td>
<td>'.$user->passwort.'</td>
</tr>
');
}
?>
</table>
<br/><button onclick='window.location.reload(true);'>RELOAD</button></a><br/>
<a href="login.php"><button>LOGOUT</button></a><br/>
</body>
</html>