-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathitem.php
69 lines (61 loc) · 2.24 KB
/
item.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
<!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">
<link rel="stylesheet" href="css/item.css">
<link href="https://fonts.googleapis.com/css?family=Merriweather+Sans" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Acme" rel="stylesheet">
<link href="https://fonts.googleapis.com/css?family=Signika" rel="stylesheet">
</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_2.png" alt="Place Hold">
</div>
<button onclick="topFunction()" id="botao" title="top">^</button>
<div id="noticia">
<?php
include 'connection.php';
$id = $_GET['id'];
$sql = "SELECT * FROM News WHERE id=" . $id;
$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_noticia"><img src=fotos/'.$item['nome_imagem'].' alt="Image"></div>';
}
echo ' <div class="conteudo">';
echo ' <h2 class="titulo">' . $item['titulo'] . '</h2>';
echo ' <p class="box">' . $item['noticia'] . '</p>';
echo ' <p class="autor">' ."Por: " . $item['autor'] . '</p>';
echo ' <p class="dia_post">' ."Postado em: " . $item['data'] . '</p>';
echo ' </div>';
echo '</div>';
}
}
else{
echo 'Nenhum registro encontrado . <br />';
}
?>
</div>
<div id="bot">
</div>
<div id="footer">
</div>
</div>
<script src="js/botao.js"></script>
</body>
</html>