-
Notifications
You must be signed in to change notification settings - Fork 40
/
index.php
60 lines (53 loc) · 1.9 KB
/
index.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
<?php
require 'users/users.php';
$users = getUsers();
include 'partials/header.php';
?>
<div class="container">
<p>
<a class="btn btn-success" href="create.php">Create new User</a>
</p>
<table class="table">
<thead>
<tr>
<th>Image</th>
<th>Name</th>
<th>Username</th>
<th>Email</th>
<th>Phone</th>
<th>Website</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
<?php foreach ($users as $user): ?>
<tr>
<td>
<?php if (isset($user['extension'])): ?>
<img style="width: 60px" src="<?php echo "users/images/${user['id']}.${user['extension']}" ?>" alt="">
<?php endif; ?>
</td>
<td><?php echo $user['name'] ?></td>
<td><?php echo $user['username'] ?></td>
<td><?php echo $user['email'] ?></td>
<td><?php echo $user['phone'] ?></td>
<td>
<a target="_blank" href="http://<?php echo $user['website'] ?>">
<?php echo $user['website'] ?>
</a>
</td>
<td>
<a href="view.php?id=<?php echo $user['id'] ?>" class="btn btn-sm btn-outline-info">View</a>
<a href="update.php?id=<?php echo $user['id'] ?>"
class="btn btn-sm btn-outline-secondary">Update</a>
<form method="POST" action="delete.php">
<input type="hidden" name="id" value="<?php echo $user['id'] ?>">
<button class="btn btn-sm btn-outline-danger">Delete</button>
</form>
</td>
</tr>
<?php endforeach;; ?>
</tbody>
</table>
</div>
<?php include 'partials/footer.php' ?>