-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetails.php
50 lines (45 loc) · 1.46 KB
/
details.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>IK-Library | Details page</title>
<link rel="stylesheet" href="styles/main.css">
<link rel="stylesheet" href="styles/cards.css">
</head>
<body>
<?php
include 'storage.php';
$bookStorage = new Storage(new JsonIO('data/books.json'));
$books = $bookStorage->findAll();
$book = $bookStorage->findById($_GET['id']);
$title = $book['title'] ?? "";
$author = $book['author'] ?? "";
$description = $book['description'] ?? "";
$image = $book['image'] ?? "";
$year = $book['year'] ?? "";
$planet = $book['planet'] ?? "";
?>
<header>
<h1><a href="index.php">IK-Library</a> > New Book</h1>
</header>
<div id="content">
<a href="index.php" style="width: 100%; display: block;">Return back</a>
<img src="<?php echo $book['image']; ?>" />
<p>
Title: <strong><?php echo $title; ?></strong>
<br>
Author: <strong><?php echo $author; ?></strong>
<br>
Description: <strong><?php echo $description; ?></strong>
<br>
Year of publication: <strong><?php echo $year; ?></strong>
<br>
Source planet: <strong><?php echo $planet; ?></strong>
</p>
</div>
<footer>
<p>IK-Library | ELTE IK Webprogramming</p>
</footer>
</body>
</html>