<?php require_once "Views/templates/header.php";?>
<!-- Begin Page Content -->
    <div class="container-fluid">

<!-- Page Heading -->
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h1 class="h3 mb-0 text-gray-800">Opciones Avanzadas</h1>
    
</div>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <h2 class="h4 mb-0 text-gray-800">Validar Facturas</h2>    
</div>
<div class="d-sm-flex align-items-center justify-content-between mb-4">
    <form method="POST" id="frmEventosTerminados">
    <div class="form-group">
        <label for="id_evento" class="col-form-label">Cufd Evento:</label>
        <select name="id_evento" id="id_evento" class="form-control">
            <?php foreach($data['eventos'] as $r){ ?>
                <option value="<?=$r['id_evento']?>"><?=$r['cufd'] ?> (<?=$r['descripcion_evento'] ?>) <?=$r['codigoRecepcion'] ?></option>
            <?php } ?>
            
        </select>
        <div class="input-group-append">
        <button class="btn btn-outline-secondary" type="button" onclick="buscarFaturasSC()"><i class="fas fa-search"></i></button>
            
        </div>
    </div>
        
        
    </form>
    
</div>
<?php
if($data['eventos']){?>
<br>
<table class="table" id="tblPedidosSC">
    <thead class="thead-dark">
        <tr>
            <th>Nro.</th>
            <th>Fecha</th>
            <th>Razon social</th>
            <th>NIT/CI</th>
            <th>Email</th>
            <th>Total</th>
            <th>Descuento</th>
            <th>Estado</th>
            <th></th>
        </tr>
    </thead>
</table>


</div>
<!-- /.container-fluid -->

<div class="modal-footer">
        <button type="submit" class="btn btn-primary" onclick="validarFacturas(event);" id="btnAccion">Validar Facturas</button>
      </div>
</div>

<?php }else{
    echo ("No existen registros");
}
?>


<?php require_once "Views/templates/footer.php";?>
<script src="<?= base_url?>Assets/js/facturacion.js"></script>