-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathlancamento.php
249 lines (233 loc) · 10.2 KB
/
lancamento.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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
<?php
require_once 'wcm/config.php';
require_once 'wcm/model/bancodedados.class.php';
require_once 'wcm/model/produto.class.php';
include_once 'wcm/model/files.class.php';
require_once 'wcm/model/data.class.php';
require_once 'wcm/model/paginacao.class.php';
$objBd = new BancodeDados();
$objProduto = new Produto();
$quantidadePorPagina = 30;
$orderBy = 'p.dtCadastro desc';
if (isset($_GET['pag'])) {
$quantidadePorPagina = $_GET['pag'];
}
if (isset($_GET['order_by'])) {
if ($_GET['order_by'] == 'preco_asc') {
$orderBy = 'p.valor, p.dtCadastro asc';
} else if ($_GET['order_by'] == 'preco_desc') {
$orderBy = 'p.valor, p.dtCadastro desc';
} else if ($_GET['order_by'] == 'nome_asc') {
$orderBy = 'p.titulo, p.dtCadastro asc';
} else if ($_GET['order_by'] == 'nome_desc') {
$orderBy = 'p.titulo, p.dtCadastro desc';
} else if ($_GET['order_by'] == 'nome_desc') {
$orderBy = 'm.descricao, p.dtCadastro asc';
} else {
$orderBy = 'p.dtCadastro desc';
}
}
$objPaginacao = new Paginacao($objProduto->listarProdutoLancamento(), $quantidadePorPagina);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title><?php echo NOME_DO_SITE;?></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Fonts -->
<link href='http://fonts.googleapis.com/css?family=Droid+Serif' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Ubuntu' rel='stylesheet' type='text/css' />
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,400,800,700,300' rel='stylesheet' type='text/css'>
<!-- styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<link href="css/docs.css" rel="stylesheet">
<link href="js/google-code-prettify/prettify.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<!-- Slider -->
<link rel="stylesheet" href="css/default.css" type="text/css" media="screen" />
<link rel="stylesheet" href="css/nivo-slider.css" type="text/css" media="screen" />
<!-- Icon -->
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css" />
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<!-- fav and touch icons -->
<link rel="shortcut icon" href="images/favicon.png">
<!-- Inline CSS
================================================== -->
<style>
.thumbnails{
margin-left:6px;
}
.thumbnails > li {
float: left;
margin-bottom: 20px;
margin-right: 4px;
margin-left:4px;
}
</style>
<script type="text/javascript">
function submit() {
document.getElementById('formRelevancia').submit();
}
</script>
<?php require_once 'headxajax.inc.php';?>
<script src="js/jquery.js"></script>
</head>
<body>
<!-- Header Start -->
<?php include("header.inc.php");?>
<!-- Header Ends -->
<!--Content starts-->
<div id="maincontainer">
<div class="container">
<ul class="breadcrumb">
<li><a href="index.php">Home</a><span class="divider">/</span></li>
<li><a href="lancamento.php">Lançamento</a><span class="divider">/</span></li>
</ul>
<div class="row">
<!--Sidebar Starts-->
<div class="span3">
<aside>
<?php require_once 'menu_lateral.inc.php'; ?>
</aside>
<aside>
<?php include_once 'mais_vendidos.inc.php'; ?>
</aside>
<aside>
<h1 class="headingfull"><span></span> </h1>
<div class="sidewidt">
<?php include_once 'banner_lateral.inc.php'; ?>
</div>
</aside>
</div>
<!--sidebar Ends-->
<div class="span9">
<h1 class="productname">Lançamentos</h1>
<section id="latest">
<div class="row">
<div class="span9">
<div class="sorting well">
<form class="form-inline pull-left" action="<?php echo $_SERVER['PHP_SELF'];?>" method="GET" id="formRelevancia">
Classificar por :
<select class="span2" name="order_by" id="relevancia" onChange="submit()">
<option value="preco_asc">Menor Preço</option>
<option value="preco_desc">Maior Preço</option>
<option value="nome_asc">Nome Crescente</option>
<option value="nome_desc">Nome Decrescente</option>
<option value="marca_asc">Marca</option>
</select>
Visualizar:
<select class="span1" name="pag" id="pag" onChange="submit()">
<option value="10" <?php echo (isset($_GET['pag']) && $_GET['pag'] == '10') ? 'selected' : '';?>>10</option>
<option value="15" <?php echo (isset($_GET['pag']) && $_GET['pag'] == '15') ? 'selected' : '';?>>15</option>
<option value="20" <?php echo (isset($_GET['pag']) && $_GET['pag'] == '20') ? 'selected' : '';?>>20</option>
<option value="25" <?php echo (isset($_GET['pag']) && $_GET['pag'] == '25') ? 'selected' : '';?>>25</option>
<option value="30" <?php echo (isset($_GET['pag']) && $_GET['pag'] == '30') ? 'selected' : '';?>>30</option>
</select>
</form>
<!-- <div class="btn-group pull-right">
<button id="list" class="btn"><i class="icon-th-list"></i>
</button>
<button id="grid" class="btn btn-success"><i class="icon-th icon-white"></i></button>
</div>-->
</div>
<section id="thumbnails">
<ul class="thumbnails grid" style="display: block;">
<?php
//foreach( $objProduto->listarProdutoComFiltro( $result_produto_promocao ) as $produto ) {
foreach( $objProduto->listarProdutoLancamento($objPaginacao, $orderBy) as $produto ) {
$objFile = new Files();
$objFile->obtemImagemPrincipal($produto->getProdutoId());
?>
<li class="span3">
<a class="prdocutname" href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>"><?php echo $produto->getTitulo();?></a>
<div class="thumbnail">
<!--<span class="sale tooltip-test" data-original-title=""></span>-->
<a href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>"><span><span><img alt="" src="produtos/fotos/<?php echo $produto->getProdutoId();?>/<?php echo $objFile->getName();?>" width="240"></span></span> </a>
<div class="caption">
<p> <?php echo $produto->getDescricao() . ' - ' . $produto->getCodigoProduto();?></p>
<?php
if ($produto->getQuantidade() == 0) {?>
Indisponível
<?php
} else {?>
<div class="price pull-left">
<span class="oldprice"><?php echo ($produto->getDesconto() != '' && $produto->getDesconto() != 0) ? 'R$ ' . Data::formataMoeda($produto->getValorOriginal()) : ' ';?></span>
<span class="newprice">R$ <?php echo Data::formataMoeda($produto->getValor());?></span>
</div>
<a class="btn pull-right" href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>">Comprar</a>
<div class="clearfix"></div>
<table class="table table-striped">
<tbody>
<tr>
<td>
<span class="links pull-left">
<a href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>" class="info">Saiba mais</a>
<a href="addcarrinho.php?produtoId=<?php echo $produto->getProdutoId();?>" class="wishlist">Add Carrinho</a>
<a href="compare.html" class="compare">Compare</a>
</span>
</td>
</tr>
</tbody>
</table>
<?php
}?>
</div>
</div>
</li>
<?php
}
?>
</ul>
<div class="pagination pull-right">
<?php echo $objPaginacao->drawPaginacao();?>
</div>
</section>
</div>
</div>
</section>
</div>
</div>
</div>
</div>
<!-- Footer Starts-->
<?php require_once 'footer.inc.php';?>
<!-- Footer Starts-->
<?php require_once 'carrinho_modal.php';?>
<!-- /maincontainer -->
<!-- javascript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="js/jquery.js"></script>
<script src="js/google-code-prettify/prettify.js"></script>
<script src="js/bootstrap-transition.js"></script>
<script src="js/bootstrap-alert.js"></script>
<script src="js/bootstrap-modal.js"></script>
<script src="js/bootstrap-dropdown.js"></script>
<script src="js/bootstrap-scrollspy.js"></script>
<script src="js/bootstrap-tab.js"></script>
<script src="js/bootstrap-tooltip.js"></script>
<script src="js/bootstrap-popover.js"></script>
<script src="js/bootstrap-button.js"></script>
<script src="js/bootstrap-collapse.js"></script>
<script src="js/bootstrap-carousel.js"></script>
<script src="js/bootstrap-typeahead.js"></script>
<script src="js/bootstrap-affix.js"></script>
<script src="js/application.js"></script>
<script src="js/respond.min.js"></script>
<script src="js/cloud-zoom.1.0.2.js"></script>
<script type="text/javascript" src="js/jquery.nivo.slider.js"></script>
<script defer src="js/custom.js"></script><script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'UA-56982537-1', 'auto'); ga('send', 'pageview');</script>
<script type="text/javascript">
$(window).load(function () {
$('#slider').nivoSlider();
});
</script>
</body>
</html>