-
Notifications
You must be signed in to change notification settings - Fork 0
/
ver_noticia.php
88 lines (62 loc) · 2.04 KB
/
ver_noticia.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
<!DOCTYPE html>
<html>
<head>
<?php
include ("sessao.php");
include("conexao.php");
?>
<meta charset="UTF-8">
<title>Gerenciamento do museu virtual</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
</head>
<body class="">
<?php
include("conexao.php");
if (isset( $_GET['id'])) {
$id=(int)$_GET['id'];
$dados_noticia=mysql_query("Select * from noticia where id=$id");
while($listar_noticia=mysql_fetch_array($dados_noticia)){
$id_noticia=$listar_noticia['id'];
$titulo_noticia=$listar_noticia['titulo'];
$descricao_noticia=$listar_noticia['descricao'];
$data_noticia=$listar_noticia['data_publicacao'];
}
if(!isset($id_noticia)){
header("Location:listar_noticia.php");
}
$dados_imagem=mysql_query("Select * from imagem_noticia where noticia=$id");
while($listar_imagem=mysql_fetch_array($dados_imagem)){
$caminho_imagem="cadastrar/".$listar_imagem['caminho'];
}
}else{
header("Location:listar_noticia.php");
}
?>
<!-- Blog Post Content Column -->
<div class="col-lg-8">
<!-- Blog Post -->
<!-- Title -->
<h1><?php echo $titulo_noticia;?></h1>
<hr>
<!-- Date/Time -->
<p><span class="glyphicon glyphicon-time"></span><?php echo $data_noticia;?></p>
<hr>
<?php
if(isset($caminho_imagem)){
echo '<img src="'.$caminho_imagem.'" class="img-rounded img-responsive" >';
}
?>
<!-- Preview Image -->
<hr>
<!-- Post Content -->
<p class="lead text-justify">
<?php
echo $descricao_noticia;
?>
</p>
<hr>
</hr>
<a href="listar_noticia.php">Voltar</a>
</body>
</html>