vytvoření .htaccess + úklid

This commit is contained in:
kankys 2024-09-25 17:40:03 +02:00
parent 5721707bda
commit de25923e3e
6 changed files with 52 additions and 41 deletions

View File

@ -0,0 +1 @@
Require all denied

View File

@ -0,0 +1,3 @@
<header>
<h1>Hlavička</h1>
</header>

View File

@ -3,26 +3,27 @@
?> ?>
<!DOCTYPE html> <!DOCTYPE html>
<html lang="cs"> <html lang="cs">
<head> <head>
<meta charset="UTF-8"> <meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
<header> <?php require "assets/header.php" ?>
<main>
<section class="main-heading">
<h1>Škola čar a kouzel v Bradavicích</h1> <h1>Škola čar a kouzel v Bradavicích</h1>
</header> </section>
<section>
<a href="zaci.php">Seznam všech žáků</a>
</section>
</main>
<main> <?php require "assets/footer.php" ?>
<section>
<a href="zaci.php">Seznam všech žáků</a>
</section>
</main>
</body>
<footer></footer> </html>
</body>
</html>

View File

@ -1,6 +1,6 @@
<?php <?php
global $connection; global $connection;
require "database.php"; require "assets/database.php";
if (isset($_GET["id"]) and is_numeric($_GET["id"])) { if (isset($_GET["id"]) and is_numeric($_GET["id"])) {
$sql = "SELECT * FROM student WHERE id = ". $_GET["id"]; $sql = "SELECT * FROM student WHERE id = ". $_GET["id"];
@ -25,11 +25,12 @@ if (isset($_GET["id"]) and is_numeric($_GET["id"])) {
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
<header> <?php require "assets/header.php" ?>
<h1>Informace o žákovi</h1>
</header>
<main> <main>
<section class="main-heading"><h1>Informace o žákovi</h1></section>
<section> <section>
<?php if ($students === null): ?> <?php if ($students === null): ?>
<p>Žák nenalezen</p> <p>Žák nenalezen</p>
@ -42,8 +43,6 @@ if (isset($_GET["id"]) and is_numeric($_GET["id"])) {
</section> </section>
</main> </main>
<footer> <?php require "assets/footer.php" ?>
</footer>
</body> </body>
</html> </html>

View File

@ -1,6 +1,6 @@
<?php <?php
global $connection; global $connection;
require "database.php"; require "assets/database.php";
$sql = "SELECT * FROM student"; $sql = "SELECT * FROM student";
@ -27,21 +27,28 @@ if ($result === false) {
<title>Document</title> <title>Document</title>
</head> </head>
<body> <body>
<h1>Seznam žáků školy</h1> <?php require "assets/header.php" ?>
<?php
if(empty($students)):
?>
<p>Žádní žáci nebyli nalezeni</p>
<?php else: ?> <main>
<ul> <section class="main-heading"><h1>Seznam žáků školy</h1></section>
<?php foreach ($students as $one_student): ?> <section class="students-list">
<li><?php echo $one_student["first_name"]. " " .$one_student["second_name"] ?></li> <?php
<a href="jeden-zak.php?id=<?= $one_student['id'] ?>">Více informací</a> if(empty($students)):
<?php endforeach; ?> ?>
<p>Žádní žáci nebyli nalezeni</p>
<?php else: ?>
<ul>
<?php foreach ($students as $one_student): ?>
<li><?php echo $one_student["first_name"]. " " .$one_student["second_name"] ?></li>
<a href="jeden-zak.php?id=<?= $one_student['id'] ?>">Více informací</a>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<a href="index.php">Zpět na hlavní stranu</a>
</section>
</main>
<?php require "assets/footer.php" ?>
</ul>
<?php endif; ?>
<a href="index.php">Zpět na hlavní stranu</a>
</body> </body>
</html> </html>