-
Notifications
You must be signed in to change notification settings - Fork 0
/
overview_appointments.php
65 lines (58 loc) · 1.61 KB
/
overview_appointments.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 "include/db_connection.php";
include_once "include/need_login.php";
$sql = "SELECT * FROM appointments";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
// output data of each row
while($row = $result->fetch_assoc()) {
$appointments[] = $row;
}
} else {
echo "0 results";
}
?>
<!doctype html>
<html lang="en">
<head>
<title>Mijn afspraken</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<h1>Mijn afspraken</h1>
<a href="logout.php">Uitloggen</a>
<table>
<thead>
<tr>
<th></th>
<th>Voornaam</th>
<th>Achternaam</th>
<th>Telefoonnummer</th>
<th>Emailadres</th>
<th>Nieuwe klant</th>
<th>Behandeling</th>
<th>Datum</th>
<th>Tijd</th>
</tr>
</thead>
<tbody>
<?php
foreach ($appointments as $i => $appointment){ ?>
<tr class="<?= $rowClass;?>">
<td><?= $i +1; ?></td>
<td><?= $appointment['firstname']; ?></td>
<td><?= $appointment['lastname']; ?></td>
<td><?= $appointment['phonenumber']; ?></td>
<td><?= $appointment['email']; ?></td>
<td><?= $appointment['newclient']; ?></td>
<td><?= $appointment['treatment']; ?></td>
<td><?= $appointment['date_x']; ?></td>
<td><?= $appointment['time_x']; ?></td>
<td><a href="edit.php?id=<?= $appointment['id']; ?>">Bewerk</a></td>
<td><a href="delete.php?id=<?= $appointment['id']; ?>">Verwijder afspraak</a></td>
</tr>
<?php }?>
</tbody>
</table>
</body>
</html>