diff --git a/assets/js/2137.js b/assets/js/2137.js index 8b408e7..bcb1ce7 100644 --- a/assets/js/2137.js +++ b/assets/js/2137.js @@ -59,7 +59,7 @@ class Barka extends HTMLElement { console.log("lekko po czasie"); barka.start(); } else if (sekundyDo2137 < 0) { - alert("zaimplementować"); + console.log("zaimplementować"); } } @@ -200,4 +200,4 @@ document.addEventListener("DOMContentLoaded", () => { barka.kontroler(); }); -window.barka = barka; \ No newline at end of file +window.barka = barka; diff --git a/assets/js/nawigacja.js b/assets/js/nawigacja.js index 02c4fef..0f26e69 100644 --- a/assets/js/nawigacja.js +++ b/assets/js/nawigacja.js @@ -3,6 +3,7 @@ const nawigacjaLinki = [ { nazwa: "Grafika", link: "/grafika.html" }, { nazwa: "JS. Zad. Warunkowe", link: "/js-warunkowe.html" }, { nazwa: "JS. Pętle", link: "/js-petle.html" }, + { nazwa: "Witalnia", link: "/witalnia.php" }, ]; const stopkaLinki = [ [ @@ -25,6 +26,10 @@ const stopkaLinki = [ { nazwa: "Tabele", link: "/tabele.html" }, { nazwa: "Grafika", link: "/grafika.html" }, ], + [ + "PHP", + { nazwa: "Witalnia", link: "/witalnia.php" }, + ], [ "Wszystko", { nazwa: "Liczby", link: "/liczby.html" }, @@ -110,4 +115,4 @@ class Footer extends HTMLElement { `; } }; -customElements.define("footer-comp", Footer); \ No newline at end of file +customElements.define("footer-comp", Footer); diff --git a/witalnia.php b/witalnia.php new file mode 100644 index 0000000..fcaf18a --- /dev/null +++ b/witalnia.php @@ -0,0 +1,65 @@ + + + + + + Witalnia - MaszToZadanieDomowe.com + + + + + + + + +
+Witaj, $nazwa
"); + zawartosc($nazwa); + $odwiedziny = isset($_COOKIE["wizyty"]) ? $_COOKIE["wizyty"] : 0; + $odwiedziny++; + setcookie("wizyty", $odwiedziny); + echo(" + Stronę odwiedziłeś/aś/iście $odwiedziny razy +
+ +
+ "); +} + +if (isset($_POST["zapomnij"])) { + echo(" + Zapomniano +

Witaj!


+
+ + +
+ "); + setcookie("nazwa"); + setcookie("wizyty"); +} else if (isset($_POST["nazwa"])) { + $nazwa = htmlspecialchars($_POST["nazwa"]); + setcookie("nazwa", $nazwa); + renderuj($nazwa); +} elseif (strlen($_COOKIE["nazwa"] > 0)) { + $nazwa = htmlspecialchars($_COOKIE["nazwa"]); + renderuj($nazwa); +} else { + echo(" +

Witaj!

+
+ + +
+ "); +} + +?> +
+ + +