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.
57 lines
1.5 KiB
57 lines
1.5 KiB
<?php
|
|
session_start();
|
|
|
|
if(!isset($_SESSION["pocasi"])){
|
|
header("Location: index.php");
|
|
exit;
|
|
}
|
|
|
|
$pocasi = $_SESSION["pocasi"];
|
|
//vyčtíme $_SESSION pamět po načtení do proměnné
|
|
unset($_SESSION["pocasi"]);
|
|
function formatCas($timestamp, $timezone){
|
|
return date("H:i", $timestamp + $timezone);
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Počasí - <?php echo(htmlspecialchars($pocasi["name"]));?></title>
|
|
</head>
|
|
<body>
|
|
<h1>Počasí</h1>
|
|
<h3>
|
|
<?php echo(htmlspecialchars($pocasi["name"]));?> -
|
|
<?= htmlspecialchars($pocasi["sys"]["country"])?>
|
|
</h3>
|
|
<div>
|
|
<?= htmlspecialchars($pocasi["weather"][0]["description"])?>
|
|
</div>
|
|
<div>
|
|
Teplota - <?= htmlspecialchars($pocasi["main"]["temp"])?>°C
|
|
</div>
|
|
<div>
|
|
Pocitová - <?= htmlspecialchars($pocasi["main"]["feels_like"])?>°C
|
|
</div>
|
|
<div>
|
|
Vlhkost - <?= htmlspecialchars($pocasi["main"]["humidity"])?>%
|
|
</div>
|
|
<div>
|
|
Vítr - <?= htmlspecialchars($pocasi["wind"]["speed"]*3.6)?> km/h
|
|
</div>
|
|
<div>
|
|
Tlak - <?= htmlspecialchars($pocasi["main"]["pressure"])?> hPa
|
|
</div>
|
|
<div>
|
|
Východ slunce - <?= formatCas($pocasi["sys"]["sunrise"],$pocasi["timezone"])?>
|
|
</div>
|
|
<div>
|
|
Západ slunce - <?= formatCas($pocasi["sys"]["sunset"],$pocasi["timezone"])?>
|
|
</div>
|
|
|
|
<br>
|
|
<a href="index.php"><button>ZPĚT</button></a>
|
|
</body>
|
|
</html>
|