![](https://forum.imasters.com.br/uploads/set_resources_20/84c1e40ea0e759e3f1505eb1788ddf3c_pattern.png)
![](https://forum.imasters.com.br/uploads/monthly_2019_11/J_member_244332.png)
joaovitor102
Members-
Total de itens
4 -
Registro em
-
Última visita
Reputação
0 ComumSobre joaovitor102
![](https://forum.imasters.com.br/uploads/public/style_extra/team_icons/placa-membro.png)
-
o retorno de saida esta contando undefined e o foreach: Invalid argument supplied
-
$_SESSION['cart'] = MD5('@?#'.$resp['cpfCliente'].'@'.date("d-m-Y H:i:s")); a nota pega esses dados porem não esta armazenando no bdds <?php require_once '../App/auth.php'; require_once '../layout/script.php'; require_once '../App/Models/cliente.class.php'; require_once '../App/Models/vendas.class.php'; echo $head; echo $header; echo $aside; ?> <div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Vendas </h1> <ol class="breadcrumb"> <li><a href="../"><i class="fa fa-dashboard"></i>inicia</a></li> <li class="active">Vendas</li> </ol> </section> <!-- Main content --> <section class="content"> <?php require '../layout/alert.php'; ?> <!-- Small boxes (Stat box) --> <div class="row"> <div class="box box-primary"> <!-- /.box-header --> <div class="box-body"> <div class="row"> <div class="box-body"> <div class="col-xs-12 col-sm-12"> <?php if(isset($_SESSION['msg']) != NULL) { echo $_SESSION['msg']; } ?> </div> </div> <div class="row"> <div class="box-body"> <div class="col-xs-12 col-sm-12"> <div class="table-responsive"> <table id="mytable" class="table table-bordred table-striped" border="2"> <?php $cartvd = $_SESSION['notavd']; $vendas = new vendas; $row = $vendas->notavd($cartvd); $idNota=$row[0]['idvendas']; $cliente = new cliente; $dados = $cliente->dadoscliente($row[0]['cliente_idCliente']); ?> <tr> <h1 style=""><b>Nota de Venda- Dentista do Sorriso</b></h1> <td><b>Numero da Nota: </b><?php echo $idNota; ?> </td> <td colspan="5"> <b>Cliente: </b><?php echo $dados['NomeCliente']; ?> </br><b>CPF:</b> <?php echo connect::format_CPF($dados['cpfCliente']); ?> </td> <tr> <tr> <td><b>Cod.</b></td> <td><b>Produto</b></td> <td><b>Qtde</b></td> <td><b>Valor Produto.</b></td> </tr> <?php $soma = 0; foreach ($row as $key) { $vendas = new vendas; $dadosItem = $vendas->dadosItem($key["iditem"]); $nomeProduto = $dadosItem['NomeProduto']; echo "<tr>"; echo '<td>' .$key["iditem"]. '</td>'; echo '<td>' .$nomeProduto. '</td>'; echo '<td>'. $key["quantitens"] . '</td>'; echo '<td>'; echo connect::format_moeda($key['valor']); echo '</td>'; echo "</tr>"; $soma = $soma + $key["valor"]; } ?> <tr> <td colspan="4">Data: <?php echo date('d M Y'); ?> </td> <td><h4><b>Total:</b></h4> <?php echo connect::format_moeda($soma); ?></td> </tr> </table> </div> </div> </div> </div> </div> </div> </div> <a href="./"><button class="btm btm-success">Voltar</button></a> </section> </div> <?php unset($_SESSION['msg'],$_SESSION['CPF'], $_SESSION['Cliente'], $_POST); echo $footer; echo $javascript; ?> <!-- Fim no codigo --> public function notavd($cart){ $query = "SELECT * FROM `vendas` WHERE `cart` = '$cart'"; if($this->result = mysqli_query($this->SQL, $query) or die (mysqli_error($this->SQL))){ while($row = mysqli_fetch_array($this->result)){ $out[] = $row; } } return $out; }//--notavd Estou com um problema com o foreach
-
<?php require_once '../App/auth.php'; require_once '../layout/script.php'; require_once '../App/Models/vendas.class.php'; require_once '../App/Models/cliente.class.php'; require_once '../App/Models/connect.php'; require '../layout/alert.php'; echo $head; echo $header; echo $aside; echo '<div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Todos os produtos </h1> <ol class="breadcrumb"> <li><a href="../"><i class="fa fa-dashboard"></i> inicio</a></li> <li class="active">Itens</li> </ol> </section> <!-- Main content --> <section class="content"> '; echo " <form action='../App/Database/Vervendas.php' method='post'> <div class='form-group has-feedback'> <input type='number' name='Dia' style='width:50px;' id='dia' placeholder='dia'><b>/</b> <input type='number' name='Mes' style='width:50px;' id='mes' placeholder='mes'><b>/</b> <input type='number' name='Ano' style='width:100px; id='ano''placeholder='ano'> <button type='submit'>Envia</button> </div> </form> "; echo '</div>'; echo '</section>'; echo '</div>'; echo $footer; echo $javascript; ?> public function ListaVendas($dia,$mes,$ano){ $item="SELECT * FROM `itens`,`Vendas`,`produtos` WHERE `iditem`=`idItens` and `Produto_CodRefProduto`=`CodRefProduto` and `datareg`='$ano'-'$mes'-'$dia'"; return $item; } <?php require_once '../../App/auth.php'; require_once '../../App/Models/vendas.class.php'; if(isset($_POST['dia']) && isset($_POST['mes']) && isset($_POST['ano'])) { $dia=$_POST['dia']; $mes=$_POST['mes']; $ano=$_POST['ano']; $vendas=new Vendas; $dados=$vendas->ListaVendas($dia,$mes,$ano); $limite=mysql_query("$dados"); while ($dados =mysql_fetch_array($limite) ) { $valor=$dados['valor']; $data=$dados['datareg']; $produto=$dados['NomeProduto']; echo "<div > <td>valor:' . $valor . '</td> <td>dia:' . $data. '</td> <td>nome produto:' . $produto . '</td>'; </div>"; $valores+=$valores; } echo "<div> <td>'.$valores.'</td> </div>"; } else{exit;} ?> esta dando erro no programa
-
gostaria de lista os produtos vendido no sistema de estoque que estou criando
joaovitor102 postou um tópico no fórum PHP
<?php require_once '../App/auth.php'; require_once '../layout/script.php'; require_once '../App/Models/vendas.class.php'; require_once '../App/Models/cliente.class.php'; require_once '../App/Models/connect.php'; require '../layout/alert.php'; echo $head; echo $header; echo $aside; echo '<div class="content-wrapper"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Todos os produtos </h1> <ol class="breadcrumb"> <li><a href="../"><i class="fa fa-dashboard"></i> inicio</a></li> <li class="active">Itens</li> </ol> </section> <!-- Main content --> <section class="content"> '; echo ' <div class="row"> <div class="box box-primary"> <div class="box-header"> <i class="ion ion-clipboard"></i> <h3 class="box-title">lista de Vendas</h3> <div class="box-tools pull-right"> <ul class="pagination pagination-sm inline"> <li><a href="#">«</a></li> <li><a href="#">1</a></li> <li><a href="#">2</a></li> <li><a href="#">3</a></li> <li><a href="#">»</a></li> </ul> </div> </div> <!-- /.box-header --> <div class="box-body"> <ul class="todo-list">'; echo " <form action='../App/Database/Vervendas.php'> <div class='form-group has-feedback'> <select type='number' name='dia[]' style='width:50px;' id='dia' placeholder='dia'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> <option value='13'>13</option> <option value='14'>14</option> <option value='15'>15</option> <option value='16'>16</option> <option value='17'>17</option> <option value='18'>18</option> <option value='19'>19</option> <option value='20'>20</option> <option value='21'>21</option> <option value='22'>22</option> <option value='23'>23</option> <option value='24'>24</option> <option value='25'>25</option> <option value='26'>26</option> <option value='27'>27</option> <option value='28'>28</option> <option value='29'>29</option> <option value='30'>30</option> <option value='31'>31</option> </select><b>/</b> <select name='mes[]' style='width:50px;' id='mes' placeholder='mes'> <option value='1'>1</option> <option value='2'>2</option> <option value='3'>3</option> <option value='4'>4</option> <option value='5'>5</option> <option value='6'>6</option> <option value='7'>7</option> <option value='8'>8</option> <option value='9'>9</option> <option value='10'>10</option> <option value='11'>11</option> <option value='12'>12</option> </select><b>/</b> <select name='ano[]' style='width:50px;' id='ano' placeholder='ano'> <option value='2019'>2019</option> <option value='2020'>2020</option> <option value='2021'>2021</option> <option value='2022'>2022</option> <option value='2023'>2023</option> <option value='2024'>2024</option> <option value='2025'>2025</option> <option value='2026'>2026</option> <option value='2027'>2027</option> <option value='2028'>2028</option> <option value='2029'>2029</option> <option value='2030'>2030</option> </select> <button type='submit' name='Busca'>Busca</button> </div> </form> "; echo '</div>'; echo '</section>'; echo '</div>'; echo $footer; echo $javascript; ?> <?php require_once '../../App/auth.php'; require_once '../../App/Models/vendas.class.php'; $dia=$_POST['dia']; $mes=$_POST['mes']; $ano=$_POST['ano']; $date=$vendas->ListaVendas($dia,$mes,$ano); header('Location: ../../vendas/suasvendas.php'); ?> Não Estou Conseguindo pega o valor no de dia mes e ano