-
Notifications
You must be signed in to change notification settings - Fork 41
/
Copy pathview.php
62 lines (57 loc) · 1.7 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
59
60
61
62
<?php
include 'partials/header.php';
require __DIR__ . '/users/users.php';
if (!isset($_GET['id'])) {
include "partials/not_found.php";
exit;
}
$userId = $_GET['id'];
$user = getUserById($userId);
if (!$user) {
include "partials/not_found.php";
exit;
}
?>
<div class="container">
<div class="card">
<div class="card-header">
<h3>View User: <b><?php echo $user['name'] ?></b></h3>
</div>
<div class="card-body">
<a class="btn btn-secondary" href="update.php?id=<?php echo $user['id'] ?>">Update</a>
<form style="display: inline-block" method="POST" action="delete.php">
<input type="hidden" name="id" value="<?php echo $user['id'] ?>">
<button class="btn btn-danger">Delete</button>
</form>
</div>
<table class="table">
<tbody>
<tr>
<th>Name:</th>
<td><?php echo $user['name'] ?></td>
</tr>
<tr>
<th>Username:</th>
<td><?php echo $user['username'] ?></td>
</tr>
<tr>
<th>Email:</th>
<td><?php echo $user['email'] ?></td>
</tr>
<tr>
<th>Phone:</th>
<td><?php echo $user['phone'] ?></td>
</tr>
<tr>
<th>Website:</th>
<td>
<a target="_blank" href="http://<?php echo $user['website'] ?>">
<?php echo $user['website'] ?>
</a>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<?php include 'partials/footer.php' ?>