<?php if($propina>0){
    $sqlp=mysqli_query($con,"SELECT sum(ven_propina) as ven_propina FROM ventas where empresa='$empresa' and apertura='$apertura'") or die(mysqli_error($con));
    $regp=mysqli_fetch_array($sqlp);
    $ven_propina=$regp["ven_propina"];   
?>
<div class="col-md-12"><label><strong>PROPINAS:</strong></label></div>
<?php
$banc=mysqli_query($con,"SELECT * from banco where empresa='$empresa' order by ban_nombre asc") or die(mysqli_error($con));
while ($banc1=mysqli_fetch_array($banc))
{
    $ban_id=$banc1["ban_id"];        
    $ban_nombre=$banc1["ban_nombre"];

$prop=mysqli_query($con,"SELECT *, sum(ven_propina) as total_propina from ventas  where ven_pago_propina='$ban_nombre' and ven_estado<>'anulada' and apertura='$apertura' and usuario='$usu_id' ");
$dato_pro=mysqli_fetch_array($prop);
$total_propina=$dato_pro['total_propina'];

?>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-info"><?php echo $ban_nombre; ?></strong></pre>
    </div>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-danger">$<?php echo number_format($total_propina,0); ?></strong></pre>
    </div>

<?php   }  ?>


<?php   
$prop_e=mysqli_query($con,"SELECT *, sum(ven_propina) as total_propina from ventas  where ven_pago_propina='Efectivo' and ven_estado<>'anulada' and apertura='$apertura' and usuario='$usu_id' ");
$dato_pro_e=mysqli_fetch_array($prop_e);
$total_propina_efe=$dato_pro_e['total_propina'];

$prop_c=mysqli_query($con,"SELECT *, sum(ven_propina) as total_propina from ventas  where ven_pago_propina='Combinado' and ven_estado<>'anulada' and apertura='$apertura' and usuario='$usu_id' ");
$dato_pro_c=mysqli_fetch_array($prop_c);
$total_propina_com=$dato_pro_c['total_propina'];
?>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-info">Combinado</strong></pre>
    </div>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-danger">$<?php echo number_format($total_propina_com,0); ?></strong></pre>
    </div>

    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-info">Efectivo</strong></pre>
    </div>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-danger">$<?php echo number_format($total_propina_efe,0); ?></strong></pre>
    </div>


    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center;c"><strong class="text-info" style="color:green">TOTAL</strong></pre>
    </div>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-danger" style="color:green">$<?php echo number_format($ven_propina,0); ?></strong></pre>
    </div>
<?php }?>
<div class="col-md-12"><label>*Las propinas no se sumara en los totales de caja</label></div>

</br>

<div class="col-md-12"><label>TOTAL EN CAJA</label></div>

<?php
$banc=mysqli_query($con,"SELECT * from banco where empresa='$empresa' order by ban_nombre asc") or die(mysqli_error($con));
while ($banc1=mysqli_fetch_array($banc))
{
    $ban_id=$banc1["ban_id"];        
    $ban_nombre=$banc1["ban_nombre"];
    include('totales_bancos.php');
?>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-info"><?php echo $ban_nombre; ?></strong></pre>
    </div>
    <div class="col-md-6">
        <pre style="font-size:18px;text-align:center"><strong class="text-danger">$<?php echo number_format($total_medio_pago,0); ?></strong></pre>
    </div>
<?php   }   ?>




