forked from thomashackl/nurest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-html.php
78 lines (72 loc) · 2.45 KB
/
test-html.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?php
require_once(__DIR__ . '/nuliga_config.php');
require_once(__DIR__ . '/nuLigaClient.php');
$client = new nuLigaClient($nuLigaConfig);
$clubs = $client->getClubs('BDV');
?>
<html lang="de">
<head>
<title>Vereine im BDV</title>
<style>
table {
border-collapse: collapse;
}
th {
padding: 5px;
text-align: left;
}
tbody tr:nth-child(odd) {
background: #005ea8;
color: #ffffff
}
td {
padding: 5px;
vertical-align: top;
}
</style>
</head>
<body>
<h1 style="color: limegreen">Vereine im BDV</h1>
<?php if (count($clubs) == 0) : ?>
<h2>Es wurden keine Spieler gefunden.</h2>
<?php else : ?>
<table>
<colgroup>
<col width="25">
<col width="25%">
<col width="15%">
<col>
</colgroup>
<thead>
<tr>
<th>#</th>
<th>Name</th>
<th>Nummer</th>
<th>Kontaktadresse</th>
</tr>
</thead>
<tbody>
<?php $i = 1; foreach ($clubs as $club) : ?>
<tr>
<td><?php echo $i ?>.</td>
<td><?php echo $club['name'] ?></td>
<td><?php echo $club['clubNr'] ?></td>
<td>
<?php if ($club['contactAddress']['contactPerson']) : ?>
<?php echo $club['contactAddress']['contactPerson'] ?>
<br>
<?php echo $club['contactAddress']['street'] ?>
<br>
<?php echo $club['contactAddress']['zip'] ?>
<?php echo $club['contactAddress']['city'] ?>
<?php else : ?>
-
<?php endif ?>
</td>
</tr>
<?php $i++; endforeach ?>
</tbody>
</table>
<?php endif ?>
</body>
</html>