-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathclients.php
39 lines (39 loc) · 1.17 KB
/
clients.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
<?php
$page_title = "Client Listing";
$query = true;
require 'header.php';
$query = "SELECT * FROM `client_details`";
$stmt = $db->query($query);
$results = $stmt->fetchAll(PDO::FETCH_ASSOC);
?>
<div class="page-header">
<h1>Client listing</h1>
</div>
<a class="btn btn-primary" href="new_client.php">Create Client</a>
<hr>
<table class="table table-striped table-bordered table-hover">
<thead>
<tr><th>Client ID</th><th>First Name</th><th>Last Name</th><th>Username</th><th>Created</th><th>Last edited</th><th>Edit</th></tr>
</thead>
<?php
foreach ($results as $value) {
?>
<tr>
<th><?php echo $value['client_id'];?></th>
<th><?php echo $value['first_name'];?></th>
<th><?php echo $value['last_name'];?></th>
<th><?php echo $value['username'];?></th>
<th><?php echo (date('Y-m-d - H:i:s', $value['created_time']));?></th>
<th><?php if($value['updated_time'] == $value['created_time']) {echo "Never edited";} else {echo (date('Y-m-d - H:i:s', $value['updated_time']));}?></th>
<th><a href="clientdetails.php?id=<?php echo $value['client_id']; ?>"><i class="icon-edit"></i></a></th>
</tr>
<?php
}
?>
</table>
<?php
$script = "
<script type='text/javascript'>
</script>";
require 'footer.php';
?>