45 lines
1.1 KiB
PHP
45 lines
1.1 KiB
PHP
<?php
|
|
require "assets/database.php";
|
|
require "assets/zak.php";
|
|
|
|
$connection = connectionDB();
|
|
|
|
if (isset($_GET["id"])){
|
|
$one_student = getStudent($connection, $_GET["id"]);
|
|
|
|
// pokud se $one_student rovná true (jsou tam data) udělej co je v {} a pokud je false (nejsou data) vypíše chybu student nenaleze a umře proces
|
|
if ($one_student) {
|
|
// Zobrazí mi v políčkách formůláře data z databáze
|
|
$first_name = $one_student["first_name"];
|
|
$second_name = $one_student["second_name"];
|
|
$age = $one_student["age"];
|
|
$life = $one_student["life"];
|
|
$college = $one_student["college"];
|
|
} else {
|
|
die("Student nenalezen");
|
|
}
|
|
|
|
} else {
|
|
// pokud není zadané ID vypiš (navazuje na první if)
|
|
die("ID není zadáno, student nebyl nalezen");
|
|
}
|
|
?>
|
|
|
|
|
|
<!DOCTYPE html>
|
|
<html lang="cs">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Document</title>
|
|
</head>
|
|
<body>
|
|
<?php require "assets/header.php"?>
|
|
|
|
|
|
<?php require "assets/formular-zak.php"; ?>
|
|
|
|
|
|
<?php require "assets/footer.php"?>
|
|
</body>
|
|
</html>
|