public function getById($id) { $prod = new produtoDAO(); $vo = $prod->getById($id); //regra de negócio $value->setPreco("R\$ " . number_format($vo->getPreco(), 2, ',', '.')); return $vo; }
public function TelaCarrinho() { session_start(); echo '<html>'; echo '<head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <link href="css/carrinho.css" type="text/css" rel="stylesheet" /> <link href="css/style1.css" rel="stylesheet"> <link rel="stylesheet" type="text/css" href="css/login.css"/> <link rel="stylesheet" type="text/css" href="css/cadastro.css"/> <title>Carrinho</title> <link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css"> <script src ="js/jquery.js"></script> <script src="js/exibir.js"></script> <script src ="js/jquery.js"></script> </head>'; '<body>'; $cat = new controladorCat(); $cat->insereMenu(); include_once "Pedacos/cadastro.php"; include_once "Pedacos/login.php"; echo '<table class="carrinho"> <caption></caption> <thead> <tr> <!-- <th width="244">Produto</th> --> <!-- <th width="79">Quantidade</th> --> <!-- <th width="89">Preço</th> --> <!-- <th width="100">SubTotal</th> --> <!-- <th width="64">Remover</th> --> </tr> </thead> <tfoot> <td colspan="5"> <form action="index.php"> <br> <button type="submit" class="btn btn-danger">Continuar Comprando</button> </form> <form action="index.php?acao=FinalizarCompra" method="POST"> <br> <button type="submit" class="btn btn-danger">FinalizarCompra</button> </form> </td> </tfoot> <tbody>'; //<?php if (count($_SESSION['carrinho']) == 0) { echo "<br>"; echo "<p id='nada'>Não a produtos no carrinho</p>"; $total = 0; } else { $total = number_format(00, 2, ',', '.'); foreach ($_SESSION['carrinho'] as $id => $qtd) { $ob = new produtoDAO(); $ln = $ob->ColsultaProduto($id); $nome = $ln['nome']; $preco = number_format($ln['preco'], 2, ',', '.'); //$sub=number_format($ln['preco']*$qtd, 2, ',', '.'); $total += $ln['preco'] * $qtd; echo '<tr> <td>' . $nome . '</td> <td> <form action="pagina.php?acao=alterar&id=' . $id_produto . '" method="POST" id = "BotaoQTD"> <!--<input type="submit" name="decremento" value="-">--> <button type="submit" class="btn btn-primary operacao" id="soma">+</button> ' . (double) $qtd . ' <!--<input type="submit" name="incremento" value="+">--> <button type="submit" class="btn btn-success operacao" id="subtrai">-</button> </form> </td> <td>R$ ' . $preco . '</td> <td>Subtotal R$ ' . $this->CalcularSub($id, $qtd) . '</td> <td><a href="paginas.php?acao=rm&id=' . $id . '" id="remove">Remove</a></td> <br> </tr>'; } $total = number_format($total, 2, ',', '.'); $frete = $_POST['Valor_1']; } //$total = number_format($total, 2, ',', '.'); //print_r($_POST); echo '<tr> <td>Total : R$ ' . $total . '</td> <td>Frete : R$ ' . $frete . '</td> <td colspan=4> </td> </tr> <tr> </tr> <tr> <td><br>'; echo '<label>CEP</label>'; echo "<form action='paginas.php?acao=frete' method='POST'>"; echo '<input type="text" name="cep"/> <input type="submit" value="CalcularFrete" name="calculaFrete"> </form>'; echo '</td> </tr>'; echo '</tbody> </table> </body> </html>'; //print_r($_POST); }
public function GaleriaSubcat2() { echo '<h6 id="titulos">Subcategorias Mais Buscadas</h6>'; echo '<ul id="screen">'; echo '<li id="viewS">'; echo '<ul id="imagesS">'; $ob0 = new subcategoriaDAO(); $ob1 = new produtoDAO(); $m = $ob0->ListarSubcategoriaMaisBuscada(); $num = count($m); for ($i = 0; $i < $num; $i++) { //$ids[]=$m[$i][0]; //$nomes[]=$m[$i][1]; $prod[$m[$i][0]] = $m[$i][1]; } foreach ($prod as $id => $nome) { echo '<h5 style="clear:both;">' . $nome . '</h5>'; $n = $ob1->ListaProdutoSub($id); $num1 = count($n); for ($i = 0; $i < $num1; $i++) { echo '<li id="' . $i . '">'; echo '<div class="jq-ss-crop" style="overflow: hidden; height: 300px; width: 212.5px;">'; echo '<a target="_blank" class="jq-ss-link">'; echo '<br>'; echo '<p class="preco"> R$' . number_format($n[$i]['preco'], 2, ',', '.') . '</p>'; echo '<br>'; echo '<img src="miniaturas/' . $n[$i]['id_produto'] . '" class="imgMiniatura"/>'; echo '<br>'; echo $n[$i]['nome']; echo '</div>'; echo '</li>'; echo '</li>'; } } echo '</ul>'; echo '</li>'; echo '</ul>'; }
<!-- Start WOWSlider.com HEAD section --> <!-- add to the <head> of your page --> <link rel="stylesheet" type="text/css" href="wowslider/engine1/style.css" /> <script type="text/javascript" src="wowslider/engine1/jquery.js"></script> <!-- End WOWSlider.com HEAD section --> </head> <body style="background-color:white;margin:auto"> <!-- Start WOWSlider.com BODY section --> <!-- add to the <body> of your page --> <div id="wowslider-container1"> <div class="ws_images"><ul> <?php //listando os produtos mais vendidos include_once "DAOs/produtoDAO.php"; $ob = new produtoDAO(); $m = $ob->ListarProdutosMaisVendidos(); $num = count($m); for ($i = 0; $i < $num; $i++) { $preco = '<p class="preco"> R$' . number_format($m[$i]['preco'], 2, ',', '.') . '</p>'; echo '<li id="imgPrincipal">'; echo '<a href="paginas.php?acao=telaProd&id=' . $m[$i]['id_produto'] . '&nome=' . $m[$i]['nome'] . '"">'; echo '<img src="principal/' . $m[$i]['id_produto'] . '" alt="tn_10" title="R$' . number_format($m[$i]['preco'], 2, ',', '.') . '<br>' . $m[$i]['nome'] . '" id="wows1_' . $i . '" class="imgPrincipal"/>'; echo '</a>'; echo '</li>'; } ?> <!-- <li><img src="wowslider/data1/images/tn_1.jpg" alt="tn_1" title="tn_1" id="wows1_0"/></li> <li><img src="wowslider/data1/images/tn_10.jpg" alt="tn_10" title="tn_10" id="wows1_1"/></li> <li><img src="wowslider/data1/images/tn_11.jpg" alt="tn_11" title="tn_11" id="wows1_2"/></li>