-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnoticias.php
133 lines (118 loc) · 5 KB
/
noticias.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
123
124
125
126
127
128
129
130
131
132
133
<!DOCTYPE html>
<html lang="pt-br">
<head>
<title>Vote Bem - Notícias</title>
<link rel="icon" href="imgs/favicon.ico">
<meta charset="UTF-8">
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<link type="text/css" rel="stylesheet" href="css/materialize.min.css" media="screen,projection" />
<link type="text/css" rel="stylesheet" href="css/estilo.css" media="screen,projection" />
<link type="text/css" rel="stylesheet" href="css/cards.css" media="screen,projection" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
</head>
<?PHP
$sql = "SELECT * FROM tb_noticias ORDER BY id_noticia DESC ";
include "PaginasProcessamento/conexao.php";
$vb = $banco -> prepare($sql);
$vb -> execute();
?>
<style>
.justify{
text-align: justify;
}
.corpo{
font-size: 20px;
}
</style>
<body>
<main>
<?php include "PaginasProcessamento/nav.php"; ?>
<nav class="hide-on-small-only">
<div class="nav-wrapper blue espacamento-lateral">
<div class="col s12">
<a href="index.php" class="breadcrumb">Home</a>
<a href="noticias.php" class="breadcrumb">Notícias</a>
</div>
</div>
</nav>
<div class="center">
<h1>Notícias</h1>
</div>
<div class="container">
<div class="row">
<div class="cards-container center">
<?php
foreach($vb as $noticias){
$id = $noticias['id_noticia'];
$titulo = $noticias["titulo_noticia"];
$img = $noticias["imagem"];
$texto = $noticias["texto"];
$resumo = $noticias["resumo"];
$imagem = $noticias["imagem"];
$modal = "#modal".$id;
$modalid = "modal".$id;
echo "
<div class='card'>
<div class='card-image'>
<img src='imgs/noticias/$img'>
<a href='$modal' class='btn-floating halfway-fab waves-effect waves-light red modal-trigger'><i class='material-icons'>add</i></a>
</div>
<div id='$modalid' class='modal modal-fixed-footer'>
<div class='modal-content'>
<h4>$titulo</h4>
<p class='justify corpo'>$texto</p>
</div>
<div class='modal-footer'>
<a href='#!' class='modal-action modal-close waves-effect waves-blue btn-flat'>Sair</a>
</div>
</div>
<div class='card-content'>
<span class='card-title'>$titulo</span>
<p>$resumo</p>
</div>
</div>";
}
?>
</div>
</div>
</div>
<!-- BASE MODAL
<a class="waves-effect waves-light btn modal-trigger" href="#modal1">Modal</a>
<div id="modal1" class="modal">
<div class="modal-content">
<h4>Modal Header</h4>
<p>A bunch of text</p>
</div>
<div class="modal-footer">
<a href="#!" class="modal-action modal-close waves-effect waves-green btn-flat">Agree</a>
</div>
</div>
-->
</main>
<footer class="page-footer blue">
<div class="container">
<div class="row">
<div class="col l6 s12">
<p><a href="index.php"><img src="imgs/footer-logo.png" alt="Logo do Vote bem"></a></p>
</div>
<div class="col l4 offset-l2 s12">
<h5 class="white-text">Compartilhe</h5>
<ul>
<li><a class="grey-text text-lighten-3" href="#!">Twitter</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Facebook</a></li>
<li><a class="grey-text text-lighten-3" href="#!">Instagram</a></li>
</ul>
</div>
</div>
</div>
<div class="footer-copyright">
<div class="container">
© 2017 Copyright - Todos os direitos reservados
</div>
</div>
</footer>
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/materialize.min.js"></script>
<script type="text/javascript" src="js/custom.js"></script>
</body>
</html>