Browse Source

first commit

master
Ivan Pomykacz 3 months ago
commit
030454a4e5
  1. 2
      README.md
  2. 3
      include/footer.php
  3. 9
      include/header.php
  4. 9
      include/menu.php
  5. 36
      include/products.php
  6. 29
      index.php
  7. 4
      info.php

2
README.md

@ -0,0 +1,2 @@
# PHP project template

3
include/footer.php

@ -0,0 +1,3 @@
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/js/bootstrap.bundle.min.js" integrity="sha384-YvpcrYf0tY3lHB60NNkmXc5s9fDVZLESaAA55NDzOxhy9GkcIdslK1eN7N6jIeHz" crossorigin="anonymous"></script>
</body>
</html>

9
include/header.php

@ -0,0 +1,9 @@
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title><?php echo "$title"; ?></title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.3/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-QWTKZyjpPEjISv5WaRU9OFeRpok6YctnYmDr5pNlyT2bRjXh0JMhjY6hW+ALEwIH" crossorigin="anonymous">
</head>
<body>

9
include/menu.php

@ -0,0 +1,9 @@
<ul>
<li><a href="index.php">Domů</a></li>
<li><a href="index.php?category=washing">Prací prostředky</a></li>
<li><a href="index.php?category=cleaning">Čisticí prostředky</a></li>
<li><a href="index.php?category=body">Tělová kosmetika</a></li>
<li><a href="index.php?category=teeth">Péče o zuby</a></li>
<li><a href="index.php?category=hygiene">Hygienické potřeby</a></li>
</ul>

36
include/products.php

@ -0,0 +1,36 @@
<?php
$items = [
"washing" => [
"name" => "Prací prostředky",
"products" => [
["name" => "Persil", "price" => 200],
["name" => "Ariel", "price" => 250],
["name" => "Formil", "price" => 150]
]
],
"cleaning" => [
"name" => "Čisticí prostředky",
"products" => [
["name" => "Ajax", "price" => 50],
["name" => "Cif", "price" => 70],
["name" => "Domestos", "price" => 80]
]
],
];
// echo $items["washing"]["name"];
// echo "<br>";
// echo $items["washing"]["products"][1]["name"];
if (isset($_GET["category"])) {
$category = $_GET["category"];
if (isset($items[$category])) {
} else {
echo "Kategorie nenalezena";
}
} else {
echo "Vyberte kategorii";
}

29
index.php

@ -0,0 +1,29 @@
<?php
$title = "E-shop";
include "include/header.php";
?>
<div class="container">
<h1>Drogerie</h1>
<div class="row">
<div class="col-md-4">
<?php include "include/menu.php"; ?>
</div>
<div class="col-md-8">
<?php include "include/products.php"; ?>
</div>
</div>
</div>
<?php
include "include/footer.php";
?>

4
info.php

@ -0,0 +1,4 @@
<?php
phpinfo();
Loading…
Cancel
Save