-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpmb_cms_ver_marca_detalhe.php
executable file
·64 lines (55 loc) · 1.88 KB
/
pmb_cms_ver_marca_detalhe.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
<?php session_start();
require_once ('pmb_conecta.php');
require_once ('pmb_cabecalho_ver.php');
$idmarca = anti_injection($_GET['idmarca']);
?>
<table border=0 width=650>
<tr>
<td colspan='6' align='center' class='td-titulo1'>Marca</td>
</tr>
<tr><td></td></tr>
<?php
$sql = "select l.localidade, p.nome, m.numero, m.caminho, m.data_cadastro
from cms_marcas m
left join cms_localidades l on l.idlocalidade = m.idlocalidade
left join cms_produtores p on p.idprodutor = m.idprodutor
where idmarca = ".$idmarca;
//pg_query($conect, "set datestyle to 'sql, dmy'");
//$result = pg_query($conect, $sql)
// or die("Nao foi possivel conectar no banco de dados!");
$sql = $db->query($sql);
// $linha = pg_fetch_array ( $result );
$linha = $db->fetchArray($sql);
$localidade = $linha['localidade'];
$produtor = $linha['nome'];
$numero = $linha['numero'];
$caminho = $linha['caminho'];
$data_cadastro = $linha['data_cadastro'];
$tamanho = getimagesize($caminho);
if ($tamanho[0] > 630)
$largura = 630;
else
$largura = $tamanho[0];
echo "
<tr>
<td align='center'><img src='" . $caminho . "' width='" . $largura . "' border='1'></td></tr>
<tr>
<td>Número: " . $numero . "</td></tr>
<tr>
<td>Produtor: " . $produtor . "</td></tr>
<tr>
<td>Localidade: " . $localidade . "</td></tr>
<tr>
<td>Data cadastro: ".date("d/m/Y",strtotime($data_cadastro))."</td></tr>
<tr><td><br></td></tr>";
?>
<tr>
<td align="center">
<input type="reset" value="Voltar" onClick="location.href='pmb_cms_ver_marca.php'">
</td>
</tr>
<tr><td><br></td></tr>
</table>
<?php
require_once ('pmb_rodape.php');
?>