<?php
ob_start();
session_start();

if (!isset($_SESSION["nombre"]))
{
  header("Location: index.php");
}
else
{
    require '../header.php';

if($_SESSION['finanzas']==1){

?>

            <div class="content-wrapper">
                <!-- Breadcrumb Section -->
                <section class="content-header">
                    <div class="container-fluid">
                        <div class="row">
                            <div class="col-sm-12">
                                <nav aria-label="breadcrumb">
                                    <ol class="breadcrumb">
                                        <li class="breadcrumb-item">
                                            <a href="#"><i class="fas fa-home"></i> Panel</a>
                                        </li>
                                        <li class="breadcrumb-item active" aria-current="page">
                                            <a href="cajas_cerrada.php">
                                                <i class="module-icon"></i> Cajas Cerradas
                                            </a>
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                          
                            <div class="col-sm-12" style="margin-top: 20px;">
                                <div class="card">
                                    <div class="card-header bg-primary">
                                        <h3 class="card-title">
                                            <i class="fas fa-search"></i>
                                            Caja Cerrada
                                        </h3>
                                    </div>
                                    <div class="card-body" style="display: block;">
                                        <div class="container-fluid">
                                            <div class="row">
                                                <div class="col-12 col-sm-12 col-md-1">
                                                </div>
                                                 <div class="col-12 col-sm-12 col-md-2">
                                                    <div class="form-group">
                                                        <br>
                                                        <input name="fecha_inicio" id="fecha_inicio" class="form-control" type="date" required>
                                                    </div>
                                                </div>
                                                <div class="col-12 col-sm-12 col-md-2">
                                                    <div class="form-group">
                                                        <br>
                                                        <input name="fecha_fin" id="fecha_fin" class="form-control" type="date" required>
                                                    </div>
                                                </div>
                                                <div class="col-12 col-sm-12 col-md-2">
                                                        <div class="form-group">
                                                            <br>
                                                               <select class="form-control select2" name="tipopago" id='tipopago' style="width: 100%;">
                                                                        <option value="">Seleccione Tipo Pago</option> 
                                                                        <option value="2">Efectivo</option> 
                                                                        <option value="3">Deposito</option>                    
                                                                </select>
                                                        </div>
                                                </div>
                                                <div class="col-12 col-sm-12 col-md-2">
                                                        <div class="form-group">
                                                            <br>
                                                               <select class="form-control select2" name="tipo_usuario" id='tipo_usuario' style="width: 100%;">
                                                                        <option value="">Seleccione Usuarios</option> 
                                                                        <option value="2">Tecnicos</option> 
                                                                        <option value="3">Caja Cobranza</option>                    
                                                                </select>
                                                        </div>
                                                </div>
                                                 <div class="form-group col-lg-3 col-md-3 col-sm-3 col-xs-12">
                                                        <br>
                                                        <button class="btn btn-success btn-flat " style="margin-bottom:-10px" onclick="listar_caja_total(event)"><i class="fas fa-save"></i> Consultar Caja</button>
                                                        <button class="btn btn-primary btn-flat " style="margin-bottom:-10px" onclick="generarExcelCaja()"><i class="fa fa-table"></i> Excel</button>
                                                        <button class="btn btn-danger btn-flat" style="margin-bottom:-10px" onclick="generarPDF()"><i class="fa fa-file"></i> PDF</button>
                                                </div>
                                                <br>
                                                 </div>  
                                                   <div id="contenedor_movimientos"></div>
                                                   <div id="contenedor_resumen"></div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </section>                
            </div>


               
<?php
}
require '../footer.php';
?>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf/2.5.1/jspdf.umd.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/jspdf-autotable/3.5.25/jspdf.plugin.autotable.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/exceljs/dist/exceljs.min.js"></script>
<script type="text/javascript" src="../../scripts/finanza.js"></script>

<?php 
}
ob_end_flush();
?>