$result['icon'] = $simpleforecast[$DayNumber]->{'icon_url'}; // "icon_url": "http://icons-ak.wxug.com/i/c/k/partlycloudy.gif”, $result['forecast_high'] = "High: " . $simpleforecast[$DayNumber]->{'high'}->{'fahrenheit'} . "°F"; $result['forecast_low'] = "Low: " . $simpleforecast[$DayNumber]->{'low'}->{'fahrenheit'} . "°F"; //$result['forecast_humidity'] = "Humidity: ".$simpleforecast[$DayNumber]->{'title'}."%"; $result['forecast_wind'] = "" . $simpleforecast[$DayNumber]->{'avewind'}->{'mph'} . "mph"; $result['forecast_winddirection'] = $simpleforecast[$DayNumber]->{'avewind'}->{'dir'}; // Südwest $result['forecast_rainrisk'] = "Rain: " . $simpleforecast[$DayNumber]->{'pop'} . "%"; // probability of precipitation = regenwahrscheinlichkeit return $result; } function printDay($day, $title) { return "<p id='hr'>\n<div id='main'>\n<img src='" . $day['icon'] . "'/> \n</div>\n\n<b>" . $day['dayofweek'] . ":</b>\n\n{$title}\n" . $day['forecast_weather'] . "\n\n<br/>\n" . $day['forecast_high'] . "\n<br/>\n" . $day['forecast_low'] . "\n</br>\n" . $day['forecast_rainrisk'] . "\n</br>\nWind: " . $day['forecast_winddirection'] . "\n@\n" . $day['forecast_wind'] . "\n</p>"; } $day0 = printDay(getDay(0), ""); $day1 = printDay(getDay(1), ""); $day2 = printDay(getDay(2), ""); $day3 = printDay(getDay(3), ""); echo '<body>'; //echo "<h1>$location</h1>"; echo ' <div id="wrap">'; echo "<p><div id='main'><img src='{$icon_url}'/> </div><b>Current:</b> {$weather} <br /> Temperature: {$temp_f}\n °F <br/> Wind: {$wind_direction}\n @ " . $wind_speed . "</p>"; echo "<p>{$day0}</p>"; echo "<p>{$day1}</p>"; echo "<p>{$day2}</p>"; echo "<p>{$day3}</p>"; //echo '<br />test' . $alert_message; echo '</div>'; echo "</body></html>";
</thead> <tbody> <tr> <?php for ($i = 1; $i <= $cal_daysOfMonth; $i++) { // Wenn der 1. des Monats kein Montag ist, wird mit den Tagen des letzten Monats aufgefüllt. if ($i == 1 && $cal_firstDayWeekday != 1) { for ($j = $cal_daysOfLastMonth - ($cal_firstDayWeekday - 2); $j <= $cal_daysOfLastMonth; $j++) { echo "<td class='otherMonth'>" . $j . "</td>"; } } // Wenn das Ende der Woche und das Ende des Monats nicht erreicht sind, einfach weiterschreiben if (($i + ($cal_firstDayWeekday - 1)) % 7 != 0) { printDay($i, $eventDaysArray); } else { printDay($i, $eventDaysArray); echo "</tr><tr>"; // Ende der Woche -> neue Reihe } if ($i == $cal_daysOfMonth && $cal_endDayWeekday != 7) { for ($k = 1; $k <= 7 - $cal_endDayWeekday; $k++) { echo "<td class='otherMonth'>" . $k . "</td>"; } } } //end of for ?> </tr> </tbody> </table>