<?php
session_start();
$ges_id = $_SESSION['ges_id'];
$ges_nom = $_SESSION['ges_nom'];
$ges_consu = $_SESSION['ges_consu'];

if($ges_id == '' || $ges_nom == ''):
    ?>
    <script type="text/javascript">
        alert('Usuario inválido');
        cerrar();
    </script>
    <?
endif;

header('Content-type: text/html; charset = utf-8');

require("../funciones/funciones.php");
require("../class/bases.php");

$sqlConfig = "SELECT * FROM configuracion WHERE 1";
$conConfig = $bdConfig->consulta($sqlConfig);
$resConfig = $bdConfig->fetch_array($conConfig);
$vr_arl1_config = $resConfig['vr_arl1_config'];
$vr_arl2_config = $resConfig['vr_arl2_config'];
$vr_arl3_config = $resConfig['vr_arl3_config'];
$vr_arl4_config = $resConfig['vr_arl4_config'];
$vr_arl5_config = $resConfig['vr_arl5_config'];

$vr_eps_config = $resConfig['vr_eps_config'];
$vr_afp_config = $resConfig['vr_afp_config'];
$vr_ccf_config = $resConfig['vr_ccf_config'];
$ano_sistema = $resConfig['ano_sistema'];
$sueldo_actual = $resConfig['sueldo_actual'];

//Inialización de variables
//Alto del div
$height = "400px";
?>

</script>
<script src="../js/validaciones_carcteres.js"></script>
<div id="contenidoLeft">
    <div id="contenido">
        <div id="botonCerrar" class="botonCerrar" onClick="ocultar('#','modal'); ocultar('#','divDer2')">X</div>
        <form name="planilla_pago" id="planilla_pago">
            <div id="conteTitulo" class="conteTitulo">Relacionar usuarios y empresas</div>
            <div id="formulario" class="formulario" style="overflow-y: scroll; scroll-behavior: smooth; height:<?= $height ?>">

                <div id = "formularioSepa">
                    <div id = "formularioText" class = "formularioText">Estado de la empresa </div>
                    <div id = "formularioCamp" class = "formularioCampo">
                        <select name = "estado_empresa" id = "estado_empresa" class = "campo">
                            <option value = "1"> Activas </option>
                            <option value = "0"> Inactivas </option>
                            <option value = "-"> - </option>
                        </select>
                    </div>
                </div>
            
                <div id = "formularioSepa">
                    <div id = "formularioText" class = "formularioText">Seleccione el parametro </div>
                    <div id = "formularioCamp" class = "formularioCampo">
                        <select name = "planilla" id = "planilla" class = "campo">
                            <option value = "1"> Planillas realizadas en el mes </option>
                            <option value = "0"> Planillas sin realizar en el mes </option>
                        </select>
                    </div>
                </div>
            
                <!--<div id="formularioSepa">
                    <div id="formularioText" class="formularioText">Grupos</div>
                    <div id="formularioCamp" class="formularioCampo">
                        <select name="id_cli_pla" id="id_cli_pla" class="campo">
                            <option value = "-"> - </option>
                            <?
                            $sqlGrupo = "SELECT id_cli, nom_cli FROM cliente WHERE 1 ORDER BY nom_cli";
                            $conGrupo = $bdFact->consulta($sqlGrupo);
                            while ($resGrupo = $bdFact->fetch_array($conGrupo)) :
                                $nom_cli = $resGrupo['nom_cli'];
                                $id_cli = $resGrupo['id_cli'];
                            ?>
                                <option value = "<?= $id_cli ?>"> <?= utf8_encode($nom_cli) ?> </option>
                            <?
                            endwhile;
                            ?>
                        </select>
                    </div>
                </div>-->

                <div id = "formularioSepa">
                    <div id = "formularioText" class = "formularioText">Seleccione parametro </div>
                    <div id = "formularioCamp" class = "formularioCampo">
                        <select name = "parametro_empresa" id = "parametro_empresa" class = "campo">
                            <option value = "0"> Grupo empresarial </option>
                            <option value = "1"> Comentario empresarial </option>
                        </select>
                    </div>
                </div>

                <div id="formularioSepa">
                    <div id="formularioText" class="formularioText">Digite el parametro</div>
                    <div id="formularioCamp" class="formularioCampo">
                        <input style="color:#F00" name="text_para" id="text_para" class="campo" value="-" type="text" onClick = "limpiarCampo('#', 'text_para')">
                    </div>
                    <div id="formularioTextError" class="nit"></div>
                </div>

                <div id = "formularioSepa">
                    <div id = "formularioText" class = "formularioText">Mes de la planilla </div>
                    <div id = "formularioCamp" class = "formularioCampo">
                        <select name = "mes_planilla" id = "mes_planilla" class = "campo">
                            <option value = "01"> Enero </option>
                            <option value = "02"> Febrero </option>
                            <option value = "03"> Marzo </option>
                            <option value = "04"> Abril </option>
                            <option value = "05"> Mayo </option>
                            <option value = "06"> Junio </option>
                            <option value = "07"> Julio </option>
                            <option value = "08"> Agosto </option>
                            <option value = "09"> Septiembre </option>
                            <option value = "10"> Octubre </option>
                            <option value = "11"> Noviembre </option>
                            <option value = "12"> Diciembre </option>
                        </select>
                    </div>
                </div>

                <div id = "formularioSepa">
                    <div id = "formularioText" class = "formularioText">Año de la planilla </div>
                    <div id = "formularioCamp" class = "formularioCampo">
                        <input type="text" id="ano_planilla" name="ano_planilla" value="<?=$ano_sistema?>" class="campo">  
                    </div>
                </div>

                <div id = "formularioSepa">
                    <div id = "formularioBoton" class = "formularioText">
                        <div id = "boton" class = "boton" onClick = "guardar('dep_planilla_pago2.php','planilla_pago','divDer2','cargando')">Buscar</div>
                    </div>
                </div>
                <div id = "modal"></div>
            </div>
        </form>

    </div>
</div>