sandraKh /
weather-module
| 1 | <?php |
||
| 2 | namespace Anax\View; |
||
| 3 | |||
| 4 | ?> |
||
| 5 | |||
| 6 | |||
| 7 | <h1>Kommande 7 Dagar</h1> |
||
| 8 | <?php if ($list) : |
||
| 9 | echo "<table id='weather-table'> |
||
| 10 | |||
| 11 | <tr> |
||
| 12 | |||
| 13 | <th>Day</th> |
||
| 14 | |||
| 15 | <th>Main Weather</th> |
||
| 16 | |||
| 17 | <th>Temperature</th> |
||
| 18 | |||
| 19 | <th>What it feels like</th> |
||
| 20 | |||
| 21 | <th>Icon</th> |
||
| 22 | |||
| 23 | </tr>"; |
||
| 24 | |||
| 25 | ?> |
||
| 26 | |||
| 27 | <?php foreach ($list as $key => $row) : |
||
| 28 | ?> |
||
| 29 | <?php |
||
| 30 | echo "<tr>"; |
||
| 31 | echo "<td>" .json_encode($key + 1). "</td>"; |
||
| 32 | echo "<td>" . trim(json_encode($row["weather"][0]["main"]), '"') . "</td>"; |
||
| 33 | echo "<td>" . round(json_encode($row["main"]["temp"]-273.15), 1). " C°" . "</td>"; |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 34 | echo "<td>" . round(json_encode($row["main"]["feels_like"]-273.15), 1) . "</td>"; |
||
| 35 | echo "<td><img src=\"http://openweathermap.org/img/wn/" . trim(json_encode($row["weather"][0]["icon"]), '"') . "@2x.png\"></td>"; |
||
| 36 | endforeach; |
||
| 37 | echo "</tr>"; |
||
| 38 | echo "</table>"; |
||
| 39 | ?> |
||
| 40 | <?php endif; ?> |
||
| 41 |