-
Notifications
You must be signed in to change notification settings - Fork 0
/
details.php
100 lines (84 loc) · 2.86 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
<?php
include("inc/data.php");
include("inc/functions.php");
if (isset($_GET["id"])) {
$id = $_GET["id"];
if (isset($catalog[$id])) {
$item = $catalog[$id];
}
}
if (!isset($item)) {
header("location:catalog.php");
exit;
}
$pageTitle = $item["title"];
$section = null;
include("inc/header.php"); ?>
<div class="section page">
<div class="wrapper">
<div class="breadcrumbs">
<a href="catalog.php">Full Catalog</a>
> <a href="catalog.php?cat=<?php echo strtolower($item["category"]); ?>">
<?php echo $item["category"]; ?></a>
> <?php echo $item["title"]; ?>
</div>
<div class="media-picture">
<span>
<img src="<?php echo $item["img"]; ?>" alt="<?php echo $item["title"]; ?>" />
</span>
</div>
<div class="media-details">
<h1><?php echo $item["title"]; ?></h1>
<table>
<tr>
<th>Category</th>
<td><?php echo $item["category"]; ?></td>
</tr>
<tr>
<th>Genre</th>
<td><?php echo $item["genre"]; ?></td>
</tr>
<tr>
<th>Format</th>
<td><?php echo $item["format"]; ?></td>
</tr>
<tr>
<th>Year</th>
<td><?php echo $item["year"]; ?></td>
</tr>
<?php if (strtolower($item["category"]) == "books") { ?>
<tr>
<th>Authors</th>
<td><?php echo implode(", ",$item["authors"]); ?></td>
</tr>
<tr>
<th>Publisher</th>
<td><?php echo $item["publisher"]; ?></td>
</tr>
<tr>
<th>ISBN</th>
<td><?php echo $item["isbn"]; ?></td>
</tr>
<?php } else if (strtolower($item["category"]) == "movies") { ?>
<tr>
<th>Director</th>
<td><?php echo $item["director"]; ?></td>
</tr>
<tr>
<th>Writers</th>
<td><?php echo implode(", ",$item["writers"]); ?></td>
</tr>
<tr>
<th>Stars</th>
<td><?php echo implode(", ",$item["stars"]); ?></td>
</tr>
<?php } else if (strtolower($item["category"]) == "music") { ?>
<tr>
<th>Artist</th>
<td><?php echo $item["artist"]; ?></td>
</tr>
<?php } ?>
</table>
</div>
</div>
</div>