@@ -6,7 +6,8 @@ discard block |
||
| 6 | 6 | <h1> Weather data based on IP-address</h1> |
| 7 | 7 | <?php if ($resTwo["type"] == null) : ?> |
| 8 | 8 | <p>This isn't a valid IP-address</p> |
| 9 | -<?php else : ?> |
|
| 9 | +<?php else { |
|
| 10 | + : ?> |
|
| 10 | 11 | <p>IP-address: <?= $resTwo["ip"] ?></p> |
| 11 | 12 | <p>Continent: <?= $resTwo["continent_name"] ?></p> |
| 12 | 13 | <p>Country: <?= $resTwo["country_name"] ?></p> |
@@ -14,10 +15,13 @@ discard block |
||
| 14 | 15 | <p>City: <?= $resTwo["city"] ?></p> |
| 15 | 16 | <p>Latitude: <?= $resTwo["latitude"] ?></p> |
| 16 | 17 | <p>Longitude: <?= $resTwo["longitude"] ?></p> |
| 17 | -<?php endif; ?> |
|
| 18 | +<?php endif; |
|
| 19 | +} |
|
| 20 | +?> |
|
| 18 | 21 | <?php if (sizeOf($resOne) == 2) : ?> |
| 19 | 22 | <p><?= $resOne["error"] ?></p> |
| 20 | -<?php else : ?> |
|
| 23 | +<?php else { |
|
| 24 | + : ?> |
|
| 21 | 25 | <h2>Weather for day/time</h2> |
| 22 | 26 | <?php foreach ($resOne["daily"]["data"] as $value) : ?> |
| 23 | 27 | <h3><?= gmdate("Y-m-d/H:i:s", $value["time"]) ?></h3> |
@@ -27,4 +31,6 @@ discard block |
||
| 27 | 31 | <?php if (!$resTwo["type"] == null) : ?> |
| 28 | 32 | <h2>Karta över platsen</h2> |
| 29 | 33 | <iframe width="75%" height="550" src="http://www.openstreetmap.org/export/embed.html?bbox=<?= $resTwo["longitude"] ?>%2C<?= $resTwo["latitude"] ?>%2C<?= $resTwo["longitude"] ?>%2C<?= $resTwo["latitude"] ?>&marker=<?= $resTwo["latitude"] ?>%2C<?= $resTwo["longitude"] ?>&layers=ND"></iframe> |
| 30 | -<?php endif; ?> |
|
| 34 | +<?php endif; |
|
| 35 | +} |
|
| 36 | +?> |
|