-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdetalhe-pedido.php
197 lines (177 loc) · 7.6 KB
/
detalhe-pedido.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
<?php
require_once 'wcm/config.php';
require_once 'wcm/model/bancodedados.class.php';
require_once 'wcm/model/produto.class.php';
require_once 'wcm/model/venda.class.php';
require_once 'wcm/model/carrinhoproduto.class.php';
include_once 'wcm/model/files.class.php';
require_once 'wcm/model/data.class.php';
require_once 'calculo_carrinho.ajax.php';
if(!isset($_SESSION['brw_idLogin'])) {
$_SESSION['fechamento']['redirecionamento'] = 'fechamento-pedido.php';
header('Location: login-conta.php');
exit();
}
$objBd = new BancodeDados();
$objProduto = new Produto();
$objVenda = new Venda();
$objCarrinhoProduto = new Carrinhoproduto();
if (isset($_GET['vendaId'])) {
$objVenda->obterVenda($_GET['vendaId']);
$sql_in = "select mProdutoId from carrinhoproduto where mCarrinhoId = " . $objVenda->getCarrinhoId()->getCarrinhoId();
$sql_produtos_carrinho = "select * from produto where produtoId in ($sql_in)";
$result_produto_carrinho = $objBd->executarSQL($sql_produtos_carrinho);
}
?>
<!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>
<?php
/*** print the javasript ***/
$xajax->printJavascript();
?>
<script src="js/jquery.js"></script>
</head>
<body>
<!-- Header Start -->
<?php include("header.inc.php");?>
<!-- Header Ends -->
<!--Content starts-->
<div id="maincontainer">
<section id="checkout">
<div class="container">
<ul class="breadcrumb">
<li><a href="#">Home</a><span class="divider">/</span></li>
<li class="active">Pedido</li>
</ul>
<h1 class="productname">Detalhe do Pedido <?=$objVenda->getReferencia()?></h1>
<div class="cart-info">
<table class="table table-striped table-bordered">
<tbody><tr>
<th width="14%" class="image">Imagem</th>
<th width="21%" class="name">Produto</th>
<th width="14%" class="model">Código</th>
<th width="12%" class="quantity">Quantidade</th>
<th width="15%" class="price">Preço Unitário</th>
<th width="13%" class="total">Total</th>
</tr>
<?php
if (isset($result_produto_carrinho)) {
$valor_total_carrinho = 0;
$valor_total_itam = 0;
foreach($objProduto->listarCategoriaComFiltro( $result_produto_carrinho ) as $produto) {
$objFile = new Files();
$objFile->obtemImagemPrincipal($produto->getProdutoId());
$sql_qtd = "select quantidade from carrinhoproduto where mCarrinhoId = ".$objVenda->getCarrinhoId()->getCarrinhoId().
" and mProdutoId = " . $produto->getProdutoId();
$result_qtd = $objBd->executarSQL($sql_qtd);
$row = $result_qtd->fetch_array();
$valor_total_item = $produto->getValor() * $row['quantidade'];
$valor_total_carrinho = $valor_total_carrinho + $valor_total_item;
?>
<tr>
<td class="image"><a href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>"><img width="50" height="50" src="produtos/fotos/<?php echo $produto->getProdutoId();?>/thumbnail/<?php echo $objFile->getName();?>"></a></td>
<td class="name"><a href="produto.php?produtoId=<?php echo $produto->getProdutoId();?>"><?php echo $produto->getTitulo();?></a></td>
<td class="model"><?php echo $produto->getCodigoProduto();?></td>
<td class="quantity"><?=$row['quantidade'];?></td>
<td class="price">R$<?php echo Data::formataMoeda($produto->getValor());?></td>
<td class="total" id="valorTotalProduto<?php echo $produto->getProdutoId();?>">R$<?php echo Data::formataMoeda($valor_total_item);?></td>
</tr>
<?php
}
?>
</tbody></table>
</div>
<div class="row">
<div class="pull-right">
<div class="span4 pull-right">
<table class="table table-striped table-bordered ">
<tbody>
<tr>
<td><span class="extra bold totalamout">Total :</span></td>
<td><span class="bold totalamout" id="valorTotalCarrinho">R$ <?php echo Data::formataMoeda($valor_total_carrinho);?></span></td>
</tr>
</tbody></table><br>
</div>
</div>
</div>
<br><br>
<?php
}
?>
</div>
</section>
</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/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 type="text/javascript" src="js/jquery.maskedinput-1.3.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>