<?php 
        $sql = mysql_query("select * from ventas where fecha='$hoy' and estado!='Anulada' and usuario='".$_COOKIE['usuario']."' and total>0  and ticket!='COTIZACION' and estado='Cerrada' order by id_venta desc") or die(mysql_error());

?>
<div class="panel panel-default">
      
        
        
     
      <div class="panel-body">
        <center>
      <span class="panel-title text-primary">Ventas</span>
        </center>
        <hr>
      <a href="../pos/_nueva_venta.php" class="btn btn-success"><i class="bi bi-sticky"></i> Nueva venta</a>

           
<div class="table-responsive borddfer p-3">
					<table class="table table-hover" data-page-length='8' style="width: 100%">
						

			
		
              <th>Cliente</th>
              <th>Monto</th>
         
              <th>Reimprimir</th>
              
						
						<tbody>
            <?php while($r=mysql_fetch_array($sql)){
              $folio = $r["id_venta"];
              $c++;
              $total+=$r["total"];
              $balance+=$r["balance"];
              $costo+=$r["costo"];
              
              ?>
							<tr>
			
             
								<td><i class='bi bi-sticky'></i> <?php echo $r["cliente"]?>
               ,<?php echo $r["ticket"]?>      
                </td>
                 <td><?php echo decimal($r["total"])?></td>
              
               
             
               <td><a class="text-primary" href="javascript:void(0)" onClick="reimprimir('<?php echo $folio?>')" ><i class="bi bi-printer"></i> Reimprimir</a></td>

							</tr>
                                                        <?php }?>
						</tbody>
            <tfoot>
              <br>
             
            </tfoot>
					</table>
				</div>
      </div>

      <div class="panel-footer">
      <span class="label btn-success h3"> 
        <i class="bi bi-cash-coin"></i>       
       Cant. ventas: <?php echo $c?> | 
       Total: <?php echo decimal($total)?>
       </span>       
      </div>
</div>
