-
Notifications
You must be signed in to change notification settings - Fork 0
/
movie.php
96 lines (84 loc) · 3.53 KB
/
movie.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
<?php
session_start();
$current = "Movie";
require_once "head.php";
require_once "connectDB.php";
/* Se o login não estiver realizado, manda para tela de login */
$_SESSION['status']=='sucess'? true : header("location:login.php");
if(isset($_GET['id'])){
$id = $_GET['id'];
$query = "SELECT * FROM movies m INNER JOIN genres g ON m.movieGenreId = g.genreId INNER JOIN classifications c ON m.movieClassificationId = c.classificationId WHERE movieId = $id";
$select = mysqli_query($con, $query);
$item = mysqli_fetch_array($select);
}
else {
header("location:index.php");
}
?>
<main class="<?=$current?>">
<header id="pc">
<figure>
<a href="index.php"><img src="img/netflix-text.png" alt="NextFlix"></a>
</figure>
<nav id="menus">
<a href="index.php" <?=$current=='Home' ? "class='mhere'" : false?>><h3>Home</h3></a>
<?=isset($_SESSION['type']) && $_SESSION['type']=='Admin'?
"<a href='create.php' <?=$current=='Create' ? 'class='mhere'' : false?><h3>Create</h3></a>":false;?>
</nav>
<section id="user">
<div>Olá
<?= $_SESSION['user'] ?>
</div>
<div>
<?= "Você é um usuário ".$_SESSION['type'] ?>
</div>
</section>
<button>
<a href="login.php">Logoff</a>
</button>
</header>
<header id="mobile">
<figure>
<a href="index.php"><img src="img/netflix-text.png" alt="NextFlix"></a>
</figure>
<div id="burger">
<div id="burger-btn">
<i class="material-icons md-light">menu</i>
</div>
<nav id="burger-itens">
<div class="user">
<i class="material-icons">person</i>
<span><?= $_SESSION['user'] ?></span>
</div>
<a href="index.php" <?=$current=='Home' ? "class='mhere'": false?>><i class="material-icons md-light <?=$current=='Home' ? 'mhere': false?>">home</i><span class="item <?=$current=='Home' ? 'mhere' : false?>">Home</span></a>
<?=isset($_SESSION['type']) && $_SESSION['type']=='Admin'?
"<a href='create.php'><i class='material-icons md-light'>backup</i><span class='item'>Create</span></a>":false;?>
<a href="login.php" class="logoff"><i class="material-icons md-light logoff">exit_to_app</i><span class="item logoff">Logoff</span></a>
</nav>
</div>
</header>
<section>
<h1>Movie Overview</h1>
<figure><img src="img/<?=$item['movieGenreId']?>.png"></figure>
<section>
<div id="title">
<h2><?=$item['movieName']?></h2>
<img src="img/<?=$item['classificationSimbol']?>.png" width='40px'>
</div>
<div>
<h3>Description:</h3>
<p><?=$item['movieDesc']?></p>
</div>
<div id="DG">
<h3>Duration: <?=$item['movieDuration']?> m</h3>
<h3>Genre: <?=$item['genreName']?></h3>
</div>
</section>
</section>
<footer>
©hireia
</footer>
</main>
<?php
require_once "footer.php"
?>