PHP_DS_Project/www2databaze/jeden-zak.php

51 lines
1.3 KiB
PHP
Raw Permalink Normal View History

2024-09-24 15:48:46 +00:00
<?php
global $connection;
2024-09-30 15:49:39 +00:00
2024-09-25 15:40:03 +00:00
require "assets/database.php";
2024-10-08 16:09:03 +00:00
require "assets/zak.php";
2024-09-24 15:48:46 +00:00
2024-09-30 15:49:39 +00:00
$connection = connectionDB();
2024-09-24 15:48:46 +00:00
if (isset($_GET["id"]) and is_numeric($_GET["id"])) {
2024-10-08 16:09:03 +00:00
$students = getStudent($connection, $_GET["id"]);
} else {
// pokud není nastavené id nastav ho na null
$one_student = null;
2024-09-24 15:48:46 +00:00
}
?>
<!DOCTYPE html>
<html lang="cs">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
2024-09-25 15:40:03 +00:00
<?php require "assets/header.php" ?>
2024-09-24 15:48:46 +00:00
<main>
2024-09-25 15:40:03 +00:00
<section class="main-heading"><h1>Informace o žákovi</h1></section>
2024-09-24 15:48:46 +00:00
<section>
<?php if ($students === null): ?>
<p>Žák nenalezen</p>
<?php else : ?>
<h2><?= htmlspecialchars($students["first_name"]). " " .htmlspecialchars($students["second_name"]) ?></h2>
<p>Věk: <?= htmlspecialchars($students["age"] ) ?></p>
<p>Dodatečné informace: <?= htmlspecialchars($students["life"])?></p>
<p>Kolej: <?= htmlspecialchars($students["college"])?></p>
2024-09-24 15:48:46 +00:00
<?php endif ?>
</section>
<section class="buttons">
<a href="editace-zaka.php?id=<?= $students['id']?>">Editovat</a>
</section>
2024-09-24 15:48:46 +00:00
</main>
2024-09-25 15:40:03 +00:00
<?php require "assets/footer.php" ?>
2024-09-24 15:48:46 +00:00
</body>
</html>