<?php include "Views/templates/header.php"; ?>
<?php if ($_SESSION['permisos']['anular Factura']) { ?>
    <button type="button" class="btn btn-danger mb-2 btn-toolbar-status btn-anular" disabled onclick="btnAnular(active_row);"><i class="fas fa-ban"></i></button>
<?php  }  ?>
<?php if ($_SESSION['permisos']['facturar fel']) { ?>
    <button type="button" class="btn btn-success mb-2 btn-toolbar-status btn-firmar" disabled onclick="btnFacturarFel(active_row);"><i class="fas fa-file-invoice-dollar"></i></button>
<?php  }  ?>
<?php if ($_SESSION['permisos']['ver factura']) { ?>
    <button type='button' class="btn btn-outline-warning mb-2 btn-toolbar-status" disabled onclick="open_link(base_url +'ventas/generarPdf/'+active_row)"><i class="fas fa-file-pdf"></i></button>
<?php  }  ?>
<!-- <a class="btn btn-primary mb-2" href="<?php echo base_url; ?>ventas"><i class="fas fa-plus"></i></a> -->
<!--
<button type="button" class="btn btn-danger mb-2 btn-toolbar-status btn-anular" disabled onclick="btnAnular(active_row);" style='display:none;'><i class="fas fa-ban"></i></button>
<button type="button" class="btn btn-success mb-2 btn-toolbar-status btn-autorizar" disabled onclick="btnFacturarFel(active_row);" style='display:none;'><i class="fas fa-file-invoice-dollar"></i></button>
-->

<div class="card">
    <div class="card-body">
        <div class="row">
            <div class="col-md-3">
                <label for="">Desde</label>
                <input class="form-control" id="min" type="date" name="venta_desde">
            </div>
            <div class="col-md-3">
                <label for="">Hasta</label>
                <input class="form-control" id="max" type="date" name="venta_hasta">
            </div>
            <div class="col-md-3">
                <label for="estados">Estado</label>                
                <select class="form-control" id="estados" name="estados">
                    <option selected value=''>Selecciona una opción</option>
                    <option value="E">Emitido</option>
                    <option value="F">Firmado</option>
                    <option value="A">Anulado</option>
                    <option value="C">Cancelado</option>
                    <option value="P">Pendiente de Anular</option>
                </select>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                    <label for="my-input">Registros</label><br>
                    <button class="btn btn-outline-primary btn-block" type="button" name="historial_ventas" onclick="limpiar_busqueda()">Mostrar Todo</button>
                </div>
            </div>
        </div>
        <div class="table-responsive">
            <table class="table table-striped table-hover display responsive nowrap" id="t_ventas" style="width: 100%;">
                <thead>
                    <tr>
                        <th>Factura</th>
                        <th>Cliente</th>
                        <th>Nombre</th>
                        <th>Fecha</th>
                        <th>Total</th>
                        <th>Estado</th>
                        <th>Vendedor</th>
                        <th>Autorizacion SAT</th>
                    </tr>
                </thead>
                <tbody></tbody>
            </table>
        </div>
    </div>
</div>

<?php include "Views/templates/footer.php"; ?>