You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 

111 lines
3.8 KiB

<!doctype html>
<html lang="en">
<head>
<?php include 'includes/head.php' ?>
</head>
<body>
<header id="intro">
<!-- Section added for "Getting Started as a Web Developer" (GSWD) -->
<div id="reservations">
<form action="reserve.php" method="POST">
<ul>
<li style="font-weight:500">Reserve now</style></li>
<li>
<label for="nameres">Last name</label>
<input type="text" id="nameres" name="nameres">
</li>
<li>
<label for="startres">Start date</label>
<input type="date" id="startres" name="startres">
</li>
<li>
<label for="endres">End date</label>
<input type="date" id="endres" name="endres">
</li>
<li>
<input type="submit" value="Reserve">
</li>
</ul>
</form>
</div>
<!-- End GSWD section -->
<article class="fullheight">
<div class="hgroup">
<h1>Landon Hotel</h1>
<h2>West London</h2>
<p><a href="#welcome"><img src="images/misc/arrow.png" alt="down arrow"></a></p>
</div>
</article>
<nav id="nav">
<div class="navbar">
<div class="brand"><a href="#welcome">Landon <span>Hotel</span></a></div>
<ul>
<li><a class="icon info" href="#hotelinfo"><span>info</span></a></li>
<li><a class="icon rooms" href="#rooms"><span>rooms</span></a></li>
<li><a class="icon dining" href="#dining"><span>dining</span></a></li>
<li><a class="icon events" href="#events"><span>events</span></a></li>
<li><a class="icon attractions" href="#attractions"><span>attractions</span></a></li>
</ul>
</div><!-- navbar -->
</nav>
</header>
<main id="wrapper">
&lt;?php
function show_forecast() {
// Get the openweathermap.org API key and other constants
include 'constants.php';
// Call the API with the options we want
$forecastRaw = file_get_contents(
'https://api.openweathermap.org/data/2.5/onecall?' .
'lat=' . LONDON_LAT .
'&amp;lon=' . LONDON_LONG .
'&amp;exclude=current,hourly,minutely,alerts' .
'&amp;units=metric' .
'&amp;appid=' . WEATHER_API_KEY
);
// Convert the response from a text string to an object
$forecast = json_decode($forecastRaw);
// Present the results on the web page
// Create a header
echo '&lt;h3&gt;Weather report for the week starting ';
echo(date('l, j F', $forecast-&gt;daily[0]-&gt;dt));
echo "&lt;/h3&gt;";
// Put the weather into its own &lt;div&gt; for CSS styling
echo '&lt;div id="weatherforecast"&gt;';
// Present each day's simplified forecast
for ($i=0; $i &lt;= 7 ; $i++) {
echo ('&lt;weatherday&gt;');
echo ('&lt;h3&gt;' . date('D', $forecast-&gt;daily[$i]-&gt;dt) . '&lt;/h3&gt;');
echo (round($forecast-&gt;daily[$i]-&gt;temp-&gt;day) . 'c&lt;br&gt;');
echo ($forecast-&gt;daily[$i]-&gt;weather[0]-&gt;description);
echo '&lt;/weatherday&gt;';
}
// Close out the #weatherforecast section
echo '&lt;/div&gt;';
}
</main>
<footer class="scene">
<article class="content">
<div id="socialmedia">
<ul class="group">
<li><a href="https://twitter.com"><img class="icon" src="images/socialmedia/twitter.png" alt="icon for twitter" /></a></li>
<li><a href="http://www.facebook.com"><img class="icon" src="images/socialmedia/facebook.png" alt="icon for facebook" /></a></li>
<li><a href="http://www.youtube.com"><img class="icon" src="images/socialmedia/youtube.png" alt="icon for youtube" /></a></li>
</ul>
</div>
</article>
</footer>
<script src="js/script.js"></script>
<script src="js/today.js"></script>
</body>
</html>