-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
64 lines (54 loc) · 1.44 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
60
61
62
63
64
<?php include_once('elements/top.php'); ?>
<!DOCTYPE html>
<html lang="de" dir="ltr">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Home | Impressum & Datenschutz API</title>
<link rel="stylesheet" href="public/css/style.min.css">
</head>
<body>
<?php
$sql = "SELECT * FROM clients";
$result = $con->query($sql);
if ($result->rowCount() > 0) {
?>
<table>
<thead>
<tr>
<th>id</th>
<th>name</th>
<th>address</th>
<th>createdAt</th>
<th>updatedAt</th>
</tr>
</thead>
<tbody>
<?php
while ($row = $result->fetch(PDO::FETCH_ASSOC)) {
$id = $row['id'];
$name = $row['name'];
$address = $row['address'];
$createdAt = $row['createdAt'];
$updatedAt = $row['updatedAt'];
?>
<tr>
<td><a href="client.php?id=<?=$id?>"><?=$id?></a></td>
<td><a href="client.php?id=<?=$id?>"><?=$name?></a></td>
<td><?=$address?></td>
<td><?=$createdAt?></td>
<td><?=$updatedAt?></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
echo 'no entrys found';
}
?>
</body>
</html>
<?php $con = null; ?>