-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.php
53 lines (44 loc) · 1.7 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
<?php
require_once("templates/header.php");
require_once("dao/MovieDAO.php");
// Dao dos Filmes
$movieDao = new MovieDAO($conn, $BASE_URL);
$lastestMovies = $movieDao->getLatestMovies();
$actionMovies = $movieDao->getMoviesByCategory("Ação");
$comedyMovies = $movieDao->getMoviesByCategory("Comédia");
?>
<div id="main-container" class="container-fluid">
<h2 class="section-title">Filmes novos</h2>
<p class="section-description">Veja as críticas dos últimos filmes adicionados no MovieStar</p>
<div class="movies-container">
<?php foreach($lastestMovies as $movie): ?>
<?php require("templates/movie_card.php"); ?>
<?php endforeach; ?>
<?php if(count($lastestMovies) === 0): ?>
<p class="empty-list">Ainda não há filmes cadastrados!</p>
<?php endif; ?>
</div>
<h2 class="section-title">Ação</h2>
<p class="section-description">Veja os melhores filmes de ação</p>
<div class="movies-container">
<?php foreach($actionMovies as $movie): ?>
<?php require("templates/movie_card.php"); ?>
<?php endforeach; ?>
<?php if(count($actionMovies) === 0): ?>
<p class="empty-list">Ainda não há filmes de ação cadastrados!</p>
<?php endif; ?>
</div>
<h2 class="section-title">Comédia</h2>
<p class="section-description">Veja os melhores filmes de comédia</p>
<div class="movies-container">
<?php foreach($comedyMovies as $movie): ?>
<?php require("templates/movie_card.php"); ?>
<?php endforeach; ?>
<?php if(count($comedyMovies) === 0): ?>
<p class="empty-list">Ainda não há filmes de ação cadastrados!</p>
<?php endif; ?>
</div>
</div>
<?php
include_once("templates/footer.php");
?>