Exemplo n.º 1
0
 public function GerarTela($id)
 {
     $ob = new produtoDAO();
     $k = $ob->ColsultaProduto($id);
     //echo '<title>'.´$k['nome'].'</title>';
     echo '<meta charset="utf-8">';
     echo '<head>';
     echo '<link rel="stylesheet" type="text/css" href="css/telaProd.css">';
     echo '<link href="css/style1.css" rel="stylesheet">';
     echo '<link href="http://fonts.googleapis.com/css?family=Oswald" rel="stylesheet" type="text/css">';
     echo '<script type="text/javascript" src="http://code.jquery.com/jquery-latest.min.js"></script>';
     echo '<script type="text/javascript" src="https://sites.google.com/site/seututorial/seututorial/smoothmenu.js"></script>';
     echo '<link rel="stylesheet" type="text/css" href="css/menuCategorias.css">';
     echo "<script type='text/javascript'>\n    })\n\t</script>\n\t<script type='text/javascript'>\n\t    ddsmoothmenu.init({\n\n\t        mainmenuid: 'smoothmenu2',\n\t        //Menu DIV id\n\t        orientation: 'v',\n\t        //Horizontal ou vertical menu: 'h' ou 'v'\n\t        classname: 'ddsmoothmenu-v',\n\t        //class added to menu's outer DIV\n\n\t        //customtheme: ['#804000', '#482400'],\n\t        contentsource: 'markup' //'markup' or ['container_id', 'path_to_menu_file']\n\t    })\n\t</script>";
     echo '</head>';
     echo '<div id="telaProd">';
     include_once "Control/controladorCategorias.php";
     $cat = new controladorCat();
     $cat->insereMenu();
     echo '<img src="produtos/' . $k['id_produto'] . '" id="imgProduto"/>';
     echo '<p id="nomeTela">' . $k['nome'] . '</p>';
     //include_once("Pedacos/menuCategorias.php");
     echo '<p id="precoTela"> R$' . number_format($k['preco'], 2, ',', '.') . '</p>';
     echo '<a class="a" id="compTela" href="paginas.php?acao=add&id=' . $k['id_produto'] . '">Comprar</a>';
     echo '<p id="descricao">' . $k['descricao'] . '</p>';
     echo '<div>';
 }
Exemplo n.º 2
0
    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&ccedil;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);
    }
Exemplo n.º 3
0
<?php

session_start();
include_once "Pedacos/cadastro.php";
include_once "Control/controladorCategorias.php";
include_once "Pedacos/login.php";
$cat = new controladorCat();
$cat->insereMenu();
?>
	
 		<div id="loja">
			<div id="propagandas">
				<h6 id="titulos">Produtos Mais Vendidos</h6>
				<br/>
				<?php 
require_once "wowslider/index.php";
?>
			</div>
			<div id="produtos">
			<fieldset>
				<br>
				<h6 id="titulos">Produtos Mais Buscados</h6>
				<?php 
include "Control/controladorProdutos.php";
$ob = new controladorProdutos();
$ob->GerarLista();
?>

				<?php 
include "Control/carrinho.php";
$cat = new Carrinho();