-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
61 lines (59 loc) · 2.03 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
<!DOCTYPE html>
<html lang="pt-br">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<title>Game News</title>
<link rel="stylesheet" href="css/style.css">
</head>
<body>
<div id="interface"> <!-- bug no xampp? -->
<div id="top">
<img id="icon" src="img/icon.png" alt="Icon">
<h1>Game News</h1>
</div>
<div id="menu">
<a href="index.php">Home</a>
<a href="index.php#noticias">Notícias</a>
<a href="form.php#formulario">Nova Notícia</a>
</div>
<div id="banner">
<img src="img/banner_img_1.png" alt="Place Hold">
</div>
<button onclick="topFunction()" id="botao" title="top">^</button>
<div id="noticias">
<h2>Noticias</h2>
<div class="box">
<?php
include 'connection.php';
$sql = "SELECT * FROM News";
$data = $conn->query($sql);
if ($data->num_rows > 0) {
while($item = $data->fetch_assoc()){
echo '<div class="noticia">';
if($item['nome_imagem']==''){
echo ' <div class="foto"><img src="img/no-image.jpg" alt="Image"></div>';
}else{
echo ' <div class="foto"><img src=fotos/'.$item['nome_imagem'].' alt="Image"></div>';
}
echo ' <div class="conteudo">';
echo ' <h3 class="titulo">' . $item['titulo'] . '</h3>';
echo ' <p class="resumo">' . $item['resumo'] . '</p>';
echo '<a href="item.php?id=' . $item['id'] . '">Saiba Mais...</a>';
echo ' </div>';
echo '</div>';
}
}
else{
echo 'Nenhuma notícia encontrada . <br />';
}
?>
</div>
</div>
<div id="footer">
<p>Criado por TEC. SENAI</p>
</div>
</div>
<script src="js/botao.js"></script>
</body>
</html>