<?php
include("header.php");
if (!empty($_GET)) {
    $fi = $_GET['fi'];
    $ff = $_GET['ff'];
    $sql = "SELECT COUNT(age_agendadopor) as total, age_agendadopor FROM `agenda` where `age_fecha` >= '$fi' and `age_fecha` <= '$ff'  GROUP BY `age_agendadopor`";

    $resultado = mysqli_query($mysqli, $sql);
}
?>

<div class="content-wrapper">
    <!-- START PAGE CONTENT-->
    <div class="page-heading">
        <h1 class="page-title">Gestiones</h1>
        <ol class="breadcrumb">
            <li class="breadcrumb-item">
                <button onclick="location.href='iinformes.php'" type="button" class="btn btn-primary">Regresar</button>
            </li>

        </ol>
    </div>
    <div class="col-sm-6 form-group">
    <div class="page-content fade-in-up">
        <div class="ibox">
            <div class="ibox-head">
                <div class="ibox-title">Listado</div>
            </div>
            
            <div class="ibox-body">
                
                    <table class="table table-striped table-bordered table-hover display dataTable_width_auto" id="dataTablePacientes" cellspacing="0" width="100%">
                        <thead>
                            <tr>
                                <th> NOMBRE DE TRABAJADOR </th>
                                <th> TOTAL DE GESTIONES</th>



                            </tr>
                        </thead>
                        <tbody>
                            <?php $NUM = 0;
                            while ($row = mysqli_fetch_array($resultado)) {
                                $NUM = $NUM + 1 ?>
                                <tr>

                                    <td><?php echo $row['age_agendadopor']; ?></td>
                                    <td><?php echo $row['total']; ?></td>

                                </tr>
                            <?php } ?>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        <?php
        include('footer.php');
        ?>