<?php
include ("header.php");
setlocale(LC_MONETARY, 'en_US');
$sql="SELECT count(*) as activos FROM pacientes WHERE pac_activo=1";
$result = $mysqli->query($sql); 
$row = $result->fetch_assoc();
$activos=$row['activos'];
$sql="SELECT sum(ven_total) as ingresos FROM `venta` WHERE `ven_fecha` = CURDATE()";
$result = $mysqli->query($sql); 
$row = $result->fetch_assoc();
$ingresos=$row['ingresos'];
?>
        <div class="content-wrapper">
            <!-- START PAGE CONTENT-->
            <div class="page-content fade-in-up">
                <div class="row">
                    <div class="col-lg-3 col-md-6">
                        <div class="ibox bg-success color-white widget-stat">
                            <div class="ibox-body">
                                <h2 class="m-b-5 font-strong"><?echo $activos;?></h2>
                                <div class="m-b-5">PACIENTES ACTIVOS</div><i class="ti-user widget-stat-icon"></i>
                                <div><i class="fa fa-level-up m-r-5"></i><small><?echo $citados;?> citados hoy</small></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="ibox bg-info color-white widget-stat">
                            <div class="ibox-body">
                                <h2 class="m-b-5 font-strong">1250</h2>
                                <div class="m-b-5">UNIQUE VIEWS</div><i class="ti-bar-chart widget-stat-icon"></i>
                                <div><i class="fa fa-level-up m-r-5"></i><small>17% higher</small></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="ibox bg-warning color-white widget-stat">
                            <div class="ibox-body">
                                <h2 class="m-b-5 font-strong"><?echo money_format('%(#7.2n', $ingresos);?></h2>
                                <div class="m-b-5">INGRESOS DEL DIA</div><i class="fa fa-money widget-stat-icon"></i>
                                <div><i class="fa fa-level-up m-r-5"></i><small>22% higher</small></div>
                            </div>
                        </div>
                    </div>
                    <div class="col-lg-3 col-md-6">
                        <div class="ibox bg-danger color-white widget-stat">
                            <div class="ibox-body">
                                <h2 class="m-b-5 font-strong">108</h2>
                                <div class="m-b-5">NEW USERS</div><i class="ti-user widget-stat-icon"></i>
                                <div><i class="fa fa-level-down m-r-5"></i><small>-12% Lower</small></div>
                            </div>
                        </div>
                    </div>
                </div>
                
                <div class="row justify-content-md-center">
                        <center><img src="img/logo.png" alt="Audilogica" width="800" height="400"></center>
                </div> 
                
                
                

<?php 
    include ('footer.php');
?>