MarioDB/php/bryla/brala.php
2025-01-22 20:53:37 +01:00

69 lines
2.6 KiB
PHP

<!DOCTYPE html>
<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="brala.css">
</head>
<body>
<div id="figura">
<table>
<tr>
<th><img src="./walec.jpg" alt="walec" title="walec"></th>
<th><img src="./stozek.jpg" alt="stożek" title="stożek"></th>
<th><img src="./graniastoslup.jpg" alt="granistosłup" title="granistosłup"></th>
<th><img src="./ostroslup.jpg" alt="ostrosłup" title="ostrosłup"></th>
</tr>
<form action="oblicz.php" method="post">
<tr>
<th><input type="submit" value="walec" name="walec"></th>
<th><input type="submit" value="stożek" name="stozek"></th>
<th><input type="submit" value="graniastosłup" name="graniastoslup"></th>
<th><input type="submit" value="ostrosłup" name="ostroslup"></th>
</tr>
</form>
</table>
</div>
<div id="wynik">
<?php
echo "<div class='wynik'>";
if(isSet($_COOKIE['poleW'])) {
echo "H = ",$_COOKIE['hw'],"<br>";
echo "r = ",$_COOKIE['rw'],"<br>";
echo "pole walca = ",number_format($_COOKIE['poleW'],3),"<br>";
echo "objętość walca = ",number_format($_COOKIE['obW'],3),"<br>";
//setcookie("poleW","",time()-50,"/");
}
echo "</div>";
echo "<div class='wynik'>";
if(isSet($_COOKIE['poleS'])) {
echo "H = ",$_COOKIE['hs'],"<br>";
echo "r = ",$_COOKIE['rs'],"<br>";
echo "l = ",$_COOKIE['ls'],"<br>";
echo "pole stożka = ",number_format($_COOKIE['poleS'],3),"<br>";
echo "objętość stożka = ",number_format($_COOKIE['obS'],3),"<br>";
//setcookie("poleS","",time()-60,"/");
}
echo "</div>";
echo "<div class='wynik'>";
if(isSet($_COOKIE['poleG'])) {
echo "H = ",$_COOKIE['hg'],"<br>";
echo "a = ",$_COOKIE['ag'],"<br>";
echo "pole graniastosłupa = ",number_format($_COOKIE['poleG'],3),"<br>";
echo "objętość graniastosłupa = ",number_format($_COOKIE['obG'],3),"<br>";
}
echo "</div>";
echo "<div class='wynik'>";
if(isSet($_COOKIE['poleO'])) {
echo "H = ",$_COOKIE['ho'],"<br>";
echo "a = ",$_COOKIE['ao'],"<br>";
echo "pole ostrosłupa = ",number_format($_COOKIE['poleO'],3),"<br>";
echo "objętość ostrosłupa = ",number_format($_COOKIE['obO'],3),"<br>";
}
echo "</div>";
?>
</div>
</body>
</html>