-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathview.php
58 lines (55 loc) · 1.47 KB
/
view.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
<?php
require "layout/header.php";
require "users/users.php";
if (!isset($_GET["id"])) {
require "layout/not_found.php";
exit();
}
$userId = $_GET["id"];
$user = getUserById($userId);
if (!$user) {
require "layout/not_found.php";
exit();
}
?>
<div class="user pt-5 pb-5">
<div class="container">
<div class="card">
<div class="card-header">
<h3 class="h3">View User: <?= $user["username"] ?></h3>
</div>
<div class="table-responsive">
<table class="table m-0">
<tbody>
<tr>
<th>Name:</th>
<td><?= $user['name'] ?></td>
</tr>
<tr>
<th>Username:</th>
<td><?= $user['username'] ?></td>
</tr>
<tr>
<th>Email:</th>
<td><?= $user['email'] ?></td>
</tr>
<tr>
<th>Phone:</th>
<td><?= $user['phone'] ?></td>
</tr>
<tr>
<th>Website:</th>
<td><a href='http://<?= $user['website'] ?>' target='__blank'><?= $user['website'] ?></a></td>
</tr>
</tbody>
</table>
</div>
<div class="card-body">
<a class="btn btn-success" href="update.php?id=<?= $user["id"] ?>" role="button">Update</a>
<a class="btn btn-danger" href="delete.php?id=<?= $user["id"] ?>" role="button">Delete</a>
</div>
</div>
</div>
</div>
<?php
require "layout/footer.php";