-
Notifications
You must be signed in to change notification settings - Fork 0
/
Opened.php
28 lines (23 loc) · 946 Bytes
/
Opened.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
<?php
require_once 'vendor/autoload.php';
$osm = new Services_OpenStreetMap();
$oh = new Services_OpenStreetMap_OpeningHours(null);
$node = $osm->getNode(966238869);
$getTags = $node->getTags();
$oh->setValue($getTags["opening_hours"]);
$isopen = $oh->isOpen(time());
$closedtime = $oh->getClosed();
echo $isopen . "\n";
if($isopen)
$inhalt = '<tr><td style="color: green;" colspan="2">• geöffnet <span style="font-size: 15px;">' . $oh->getOpenedStringFormated() . '</span></td></tr>';
else
{
if($closedtime[0] >= 0)
$inhalt = '<tr><td style="color: red;" colspan="2">• geschlossen <span style="font-size: 15px;">' . $oh->getClosedStringFormated() . '</span></td></tr>';
$inhalt = '<tr><td style="color: red;" colspan="2">• geschlossen</td></tr>';
}
echo $inhalt . "\n";
$handle = fopen ("Opened.html", "w");
fwrite ($handle, $inhalt);
fclose ($handle);
?>