|
|
|
<!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">
|
|
|
|
<?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 .
|
|
|
|
'&lon=' . LONDON_LONG .
|
|
|
|
'&exclude=current,hourly,minutely,alerts' .
|
|
|
|
'&units=metric' .
|
|
|
|
'&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 '<h3>Weather report for the week starting ';
|
|
|
|
echo(date('l, j F', $forecast->daily[0]->dt));
|
|
|
|
echo "</h3>";
|
|
|
|
|
|
|
|
// Put the weather into its own <div> for CSS styling
|
|
|
|
echo '<div id="weatherforecast">';
|
|
|
|
|
|
|
|
// Present each day's simplified forecast
|
|
|
|
for ($i=0; $i <= 7 ; $i++) {
|
|
|
|
echo ('<weatherday>');
|
|
|
|
echo ('<h3>' . date('D', $forecast->daily[$i]->dt) . '</h3>');
|
|
|
|
echo (round($forecast->daily[$i]->temp->day) . 'c<br>');
|
|
|
|
echo ($forecast->daily[$i]->weather[0]->description);
|
|
|
|
echo '</weatherday>';
|
|
|
|
}
|
|
|
|
|
|
|
|
// Close out the #weatherforecast section
|
|
|
|
echo '</div>';
|
|
|
|
}
|
|
|
|
|
|
|
|
</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>
|