<?php
ob_start();
ini_set('session.gc_maxlifetime', 14400);
session_set_cookie_params(14400);
session_start();

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

if($_SESSION['adicional']==1 or $_SESSION['ingreso']==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="list.php">
                                                <i class="module-icon"></i> Egreso
                                            </a>
                                        </li>
                                    </ol>
                                </nav>
                            </div>
                          
                            <div class="col-sm-12" style="margin-top: 20px;">
                                <form class="form" method="post"  id="frmForm" autocomplete="off">
                                    <div class="card">
                                        <div class="card-header">
                                            <h3 class="card-title" id="idtitle" >
                                                <i class="fas fa-plus"></i> <!-- Icono para agregar -->
                                                Pagar Egreso<!-- Título del formulario -->
                                            </h3>
                                        </div>
                                        <div class="card-body" style="display: block;">
                                            <div class="container-fluid">
                                                <input type="hidden" name="idegreso" id="idegreso">
                                                <input type="hidden" name="iddetalle_egreso" id="iddetalle_egreso">
                                                <div class="row">
                                                    <!-- Primera columna -->
                                                    <div class="col-12 col-sm-12 col-md-3">
                                                        <div class="form-group">
                                                            <label for="tipo" >Tipo:</label>
                                                            <select  name="tipo" id="tipo" class="form-control"  data-live-search="true" data-style="btn-default" required>
                                                                <option value="">Seleccione Tipo</option>
                                                                <option value="1">Fijo</option>
                                                                <option value="2">Variable</option>      
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-12 col-md-4">
                                                        <div class="form-group">
                                                            <label >Categoria Egreso:</label>
                                                            <select  name="idcategoria_egreso" id="idcategoria_egreso" class="form-control select2"  data-live-search="true" data-style="btn-default" required>
                                                            <option value="">Seleccione una Categoria</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-12 col-md-3">
                                                        <div class="form-group">
                                                            <label >Tipo Egreso:</label>
                                                            <select  name="idconcepto_egreso" id="idconcepto_egreso" class="form-control select2"  data-live-search="true" data-style="btn-default" required>
                                                            <option value="">Seleccione una Concepto</option>
                                                            </select>
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-2">
                                                        <div class="form-group">
                                                            <label for="fechavencimiento">Fecha Vencimiento:</label>
                                                            <input type="date" class="form-control" name="fechavencimiento" id="fechavencimiento">
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="mes_anterior" >Mes Anterior 💡:</label>
                                                            <input type="number" step="0.01" class="form-control" name="mes_anterior" id="mes_anterior"  placeholder="Mes Anterior" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="mes_actual" >Mes Actual 💡:</label>
                                                            <input type="number" step="0.01" class="form-control" name="mes_actual" id="mes_actual"  placeholder="Mes Actual" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="precio_luz" >Precio  💡:</label>
                                                            <input type="number" step="0.01" class="form-control" name="precio_luz" id="precio_luz"  placeholder="Precio Luz" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label for="monto" >Monto Egreso:</label>
                                                            <input type="number" step="0.01" class="form-control" name="monto_concepto" id="monto_concepto"  placeholder="Monto" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-6">
                                                        <div class="form-group">
                                                            <label for="descripcion" >Descripcion:</label>
                                                            <input type="text" class="form-control" name="descripcion_concepto" id="descripcion_concepto"  placeholder="Descripcion" >
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-12 col-sm-6 col-md-1">
                                                        <div class="form-group">
                                                            <label for="cuota" >Cuota:</label>
                                                            <input type="text" class="form-control" name="cuota" id="cuota"  placeholder="Cuota" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-1">
                                                        <div class="form-group">
                                                            <label for="archivador" >Archivador:</label>
                                                            <input type="text" class="form-control" name="archivador" id="archivador"  placeholder="Archivador" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-1">
                                                        <div class="form-group">
                                                            <label for="folio" >Folio:</label>
                                                            <input type="text" class="form-control" name="folio" id="folio"  placeholder="Folio" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label>Nombre:</label>
                                                            <input type="text" class="form-control" name="nombre_pago" id="nombre_pago"  placeholder="Nombre" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-6">
                                                        <div class="form-group">
                                                            <label>Descripcion Metodo de Pago:</label>
                                                            <input type="text" class="form-control" name="descripcion_pago" id="descripcion_pago"  placeholder="Desripcion Metodo de Pago" >
                                                        </div>
                                                    </div>
                                                    
                                                    <div class="col-12 col-sm-12 col-md-12">
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-4">
                                                    </div>
                                                    <div class="form-group col-lg-6 col-md-12 col-sm-12 col-xs-12">
                                                        <br>
                                                        <label>Forma de Pago:</label>&nbsp;&nbsp;&nbsp;
                                                        <input  type="radio" checked  name="tipopago" id="radioEfectivo" onclick="mostrarOcultarCampos()" value="2"><label>&nbsp;EFECTIVO</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;             
                                                        <input  type="radio"  name="tipopago" id="radioDeposito" onclick="mostrarOcultarCampos()" value="3"><label>&nbsp;DEPOSITO</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                                                    </div> 
                                                    <div class="col-12 col-sm-12 col-md-6" id="campoBanco" style="display: none;">
                                                        <div class="form-group">
                                                            <label>Banco:</label>
                                                            <select name="idbanco" id="idbanco" class="form-control select2" data-live-search="true" data-style="btn-default" >
                                                            </select>
                                                        </div>
                                                    </div>

                                                    <div class="col-12 col-sm-6 col-md-6" id="campoOperacion" style="display: none;">
                                                        <div class="form-group">
                                                            <label>Numero Operacion:</label>
                                                            <input type="text" class="form-control" name="nro_operacion" id="nro_operacion" placeholder="Nro Operacion">
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-6">
                                                        <div class="form-group">
                                                            <label>Descripcion:</label>
                                                            <input type="text" class="form-control" name="descripcion" id="descripcion"  placeholder="Descripcion" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-2">
                                                        <div class="form-group">
                                                            <label>Monto:</label>
                                                            <input type="number" step="0.01" class="form-control" name="monto" id="monto"  placeholder="Monto" >
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-2">
                                                        <div class="form-group">
                                                            <label>Hora:</label>
                                                            <input  type="time" name="hora" id="hora" class="form-control" value="<?php echo date("H:i")?>" > </input> 
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-2">
                                                        <div class="form-group">
                                                            <label>Fecha Pago:</label>
                                                            <input  type="date" name="fechapago" id="fechapago" class="form-control" value="<?php echo date("Y-m-d")?>" > </input> 
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label>Comprobante:</label>
                                                            <select class="form-control" name="comprobante" id="comprobante">
                                                                <option value="">Seleccione Comprobante</option>
                                                                <option value="1">Recibo Egreso </option>
                                                                <option value="2">Boleta </option>
                                                                <option value="3">Factura </option>
                                                            </select> 
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-6 col-md-3">
                                                        <div class="form-group">
                                                            <label>Nro Recibo:</label>
                                                            <input  type="text" name="nrorecibo" id="nrorecibo" class="form-control" placeholder="Nro recibo"> </input> 
                                                        </div>
                                                    </div>
                                                    <div class="col-12 col-sm-12 col-md-2">
                                                        <div class="form-group">
                                                            <label >Responsable:</label>
                                                            <select  name="idresponsable" id="idresponsable" class="form-control select2"  data-live-search="true" data-style="btn-default" required>
                                                            </select>
                                                        </div>
                                                    </div>
                                                </div>  
                                            </div>
                                        </div>
                                        <div class="card-footer">
                                            <!-- Botones de acción -->
                                            <button type="submit" id="btnGuardar" class="btn btn-primary btn-flat">
                                                <i class="fas fa-save"></i> Guardar registro
                                            </button>
                                            <a href="list.php" class="btn btn-danger btn-flat">
                                                <i class="fas fa-times"></i> Cancelar
                                            </a>
                                        </div>
                                    </div>
                                </form>
                            </div>
                        </div>
                    </div>
                </section>                
            </div>


               
<?php
}
require '../footer.php';
?>
<script type="text/javascript" src="../../scripts/pagaregreso.js"></script>
<?php 
}
ob_end_flush();
?>