-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathuser-show.php
More file actions
29 lines (25 loc) · 817 Bytes
/
user-show.php
File metadata and controls
29 lines (25 loc) · 817 Bytes
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
<?php
include('partials/header.php');
Assets::addStyle();
$db = new Database();
$user = new User($db);
if (isset($_GET['id'])) {
$id = $_GET['id'];
$userData = $user->show($id);
}
?>
<section class="container">
<h1>Detail používateľa</h1>
<?php if ($userData): ?>
<p>Meno: <?= htmlspecialchars($userData['name']) ?></p>
<p>Email: <?= htmlspecialchars($userData['email']) ?></p>
<p>Rola: <?= $userData['role'] == 0 ? 'Admin' : 'User' ?></p>
<button class="button" onclick="window.location.href='admin.php'">Back to Users</button>
<?php else: ?>
<p>Používateľ nebol nájdený.</p>
<button class="button" onclick="window.location.href='admin.php'">Back to Users</button>
<?php endif; ?>
</section>
<?php
include('partials/footer.php');
?>