-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
64 lines (63 loc) · 2.46 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
62
63
64
<!DOCTYPE html>
<html lang="pt-BR">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, height=device-height, initial-scale=1.0">
<title>Emperium Street Wear</title>
<meta name="Author" content="Marcus Vinicius">
<link rel="icon" href="./Logos/Logotipo Escuro.png">
<!-- CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<!-- jQuery -->
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"></script>
<!-- JavaScript -->
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="estilo.css">
</head>
<body>
<?php
session_start();
include 'conexao.php';
include 'nav.php';
include 'cabecalho.html';
$Consulta = $cn -> query('select * from vw_produto');
?>
<div class="container-fluid text-center">
<div class="row">
<?php
while($Exibir = $Consulta -> fetch(PDO::FETCH_ASSOC))
{ ?>
<div class="col-sm-3">
<img src="Produtos/<?php echo $Exibir['ds_img']; ?>" class="img-responsive" style="width:100%">
<div><h4><b><?php echo mb_strimwidth($Exibir['nm_nome'],0,17,'...'); ?></b></h4></div>
<div><h5>R$ <?php echo number_format($Exibir['vl_produto'],2,',','.'); ?></h5></div>
<div class="text-center" style="margin-top:7px;">
<?php
if($Exibir['qtd_estoque'] > 0) { ?>
<a href="carrinho.php?id=<?php echo $Exibir['id_produto'] ?>" style="text-decoration:none;">
<button class="btn btn-block btn-default" style="background:#fdeb00; color:black;">
<span class="glyphicon glyphicon-usd"></span> Comprar
</button>
</a>
<?php }
else { ?>
<button class="btn btn-block btn-danger" disabled>
<span class="glyphicon glyphicon-exclamation-sign"></span> Fora de Estoque
</button>
<?php } ?>
<br>
<a href="detalhes.php?id=<?php echo $Exibir['id_produto'] ?>" style="text-decoration:none;">
<button class="btn btn-block btn-primary">
<span class="glyphicon glyphicon-info-sign"></span> Detalhes
</button>
</a>
</div>
</div>
<?php } ?>
</div><!-- fechamento da class="row" -->
</div><!-- fechamento da class="container-fluid" -->
<br>
<br>
<?php include 'rodape.html' ?>
</body>
</html>