From 029f672277f7f7db8c6e7761e812fe90e58c4585 Mon Sep 17 00:00:00 2001 From: Sebastian Ranoszek Date: Wed, 22 Jan 2025 19:24:52 +0000 Subject: [PATCH] Upload files to "php" --- php/brala.css | 39 +++++++++++++++++++ php/brala.php | 69 +++++++++++++++++++++++++++++++++ php/oblicz.php | 101 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 209 insertions(+) create mode 100644 php/brala.css create mode 100644 php/brala.php create mode 100644 php/oblicz.php diff --git a/php/brala.css b/php/brala.css new file mode 100644 index 0000000..d21b22b --- /dev/null +++ b/php/brala.css @@ -0,0 +1,39 @@ +#figura { + width: fit-content; + margin-left:auto; + margin-right: auto; + margin-top: 3%; +} +#figura input { + width: 200px; + font-size: 140%; + height: 50px; + font-weight: bold; + border-radius: 20px; +} +.wynik { + float: left; + font-size: 150%; + color:navy; + margin: 40px 50px; + font-weight: bold; +} +fieldset { + margin-top:8%; + margin-left:10%; + width: fit-content; + padding: 20px 60px; + line-height: 2em; + font-size:200%; + background: linear-gradient(to left,red,gold); +} +fieldset input { + width: 4em; +} +legend { + font-weight: bold; +} +fieldset input[type="submit"] { + width: 6em; + font-size: 0.6em; +} \ No newline at end of file diff --git a/php/brala.php b/php/brala.php new file mode 100644 index 0000000..545a341 --- /dev/null +++ b/php/brala.php @@ -0,0 +1,69 @@ + + + + + + Document + + + +
+ + + + + + + + + + + + + + + +
walecstożekgranistosłupostrosłup
+
+
+ + "; + if(isSet($_COOKIE['poleW'])) { + echo "H = ",$_COOKIE['hw'],"
"; + echo "r = ",$_COOKIE['rw'],"
"; + echo "pole walca = ",number_format($_COOKIE['poleW'],3),"
"; + echo "objętość walca = ",number_format($_COOKIE['obW'],3),"
"; + //setcookie("poleW","",time()-50,"/"); + } + echo "
"; + echo "
"; + if(isSet($_COOKIE['poleS'])) { + echo "H = ",$_COOKIE['hs'],"
"; + echo "r = ",$_COOKIE['rs'],"
"; + echo "l = ",$_COOKIE['ls'],"
"; + echo "pole stożka = ",number_format($_COOKIE['poleS'],3),"
"; + echo "objętość stożka = ",number_format($_COOKIE['obS'],3),"
"; + //setcookie("poleS","",time()-60,"/"); + } + echo "
"; + echo "
"; + if(isSet($_COOKIE['poleG'])) { + echo "H = ",$_COOKIE['hg'],"
"; + echo "a = ",$_COOKIE['ag'],"
"; + echo "pole graniastosłupa = ",number_format($_COOKIE['poleG'],3),"
"; + echo "objętość graniastosłupa = ",number_format($_COOKIE['obG'],3),"
"; + } + echo "
"; + echo "
"; + if(isSet($_COOKIE['poleO'])) { + echo "H = ",$_COOKIE['ho'],"
"; + echo "a = ",$_COOKIE['ao'],"
"; + echo "pole ostrosłupa = ",number_format($_COOKIE['poleO'],3),"
"; + echo "objętość ostrosłupa = ",number_format($_COOKIE['obO'],3),"
"; + } + echo "
"; + ?> + + + \ No newline at end of file diff --git a/php/oblicz.php b/php/oblicz.php new file mode 100644 index 0000000..0f15707 --- /dev/null +++ b/php/oblicz.php @@ -0,0 +1,101 @@ + + + + + + Document + + + + +
+ dane do walca + wysokość H =
+ promień r =
+ +
+ "; +} +if(isSet($_POST['w'])) { + $h = $_POST['h']; + $r = $_POST['r']; + $poleW = 2*M_PI*$r*$r+2*M_PI*$r*$h; + $obW = M_PI*$r*$r*$h; + setcookie("poleW",$poleW,time()+60,"/"); + setcookie("obW",$obW,time()+60,"/"); + setcookie("hw",$h,time()+60,"/"); + setcookie("rw",$r,time()+60,"/"); + header("Location: brala.php"); +} + +if(isSet($_POST['stozek'])) { + echo "
+
+ dane do stożka + wysokość H =
+ promień r =
+ bok l =
+ +
+
"; +} +if(isSet($_POST['s'])) { + $h = $_POST['h']; + $r = $_POST['r']; + $l = $_POST['l']; + $poleS = M_PI*$r*$r+M_PI*$r*$l; + $obS = 1/3*M_PI*$r*$r*$h; + setcookie("poleS",$poleS,time()+60,"/"); + setcookie("obS",$obS,time()+60,"/"); + setcookie("hs",$h,time()+60,"/"); + setcookie("rs",$r,time()+60,"/"); + setcookie("ls",$r,time()+60,"/"); + header("Location: brala.php"); +} +if(isSet($_POST['graniastoslup'])) { + echo "
+
+ dane do graniastosłupa + wysokość H =
+ bok a =
+ +
+
"; +} +if(isSet($_POST['g'])) { + $h = $_POST['h']; + $a = $_POST['a']; + $poleG = 2*$a*$a+4*$a*$h; + $obG = $a*$a*$h; + setcookie("poleG",$poleG,time()+60,"/"); + setcookie("obG",$obG,time()+60,"/"); + setcookie("hg",$h,time()+60,"/"); + setcookie("ag",$a,time()+60,"/"); + header("Location: brala.php"); +} +if(isSet($_POST['ostroslup'])) { + echo "
+
+ dane do ostrosłupa + wysokość H =
+ bok a =
+ +
+
"; +} +if(isSet($_POST['o'])) { + $h = $_POST['h']; + $a = $_POST['a']; + $poleO = $a*$a+2*$a*$a*$h; + $obO = 1/3*$a*$a*$h; + setcookie("poleO",$poleO,time()+60,"/"); + setcookie("obO",$obO,time()+60,"/"); + setcookie("ho",$h,time()+60,"/"); + setcookie("ao",$a,time()+60,"/"); + header("Location: brala.php"); +} +?> + + \ No newline at end of file