-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
123 lines (108 loc) · 4.31 KB
/
index.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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<!DOCTYPE html>
<html>
<head>
<title>Biblioteca de Filmes</title>
</head>
<body>
<header>
<h1>Biblioteca de Filmes</h1>
</header>
<?php $arrayFilmes = require("index-movies.php"); ?>
<?php if(array_key_exists('filme', $_GET)):
$filme_id = $_GET['filme'];
?>
<section>
<table>
<tr>
<td>
Nome:
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['name'] ?>
</td>
</tr>
<?php if(array_key_exists('name_english', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Nome em inglês:
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['name_english'] ?>
</td>
</tr>
<?php endif; ?>
<?php if(array_key_exists('distribution', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Distribuição
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['distribution'] ?>
</td>
</tr>
<?php endif; ?>
<?php if(array_key_exists('sinopse', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Sinopse
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['sinopse'] ?>
</td>
</tr>
<?php endif ?>
<?php if(array_key_exists('cast_support', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Elenco de Suporte
</td>
<td>
<?php foreach($arrayFilmes[$filme_id]['cast_support'] as $support): ?>
<?php echo $support . "<br/>" ?>
<?php endforeach ?>
</td>
</tr>
<?php endif ?>
<?php if(array_key_exists('year', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Ano
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['year'] ?>
</td>
</tr>
<?php endif; ?>
<?php if(array_key_exists('direction', $arrayFilmes[$filme_id])): ?>
<tr>
<td>
Direção
</td>
<td>
<?php echo $arrayFilmes[$filme_id]['direction'] ?>
</td>
</tr>
<?php endif; ?>
<?php if(array_key_exists('genre', $arrayFilmes[$filme_id])): ?>
<tr>
<td>Gênero</td>
<td><?php echo $arrayFilmes[$filme_id]['genre'] ?></td>
</tr>
<?php endif; ?>
</table>
</section>
<?php endif ?>
<h3>Lista de filmes</h3>
<section>
<?php foreach($arrayFilmes as $key => $filme): ?>
<?php if(array_key_exists('name', $filme)): ?>
<ul>
<li>
<a href="?filme=<?php echo $key ?>"><?php echo $filme['name'] ?></a>
</li>
</ul>
<?php endif ?>
<?php endforeach ?>
</section>
</body>
</html>