<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Personas</title>
<link href="../../maincss.css" rel="stylesheet" type="text/css" />
<link href="../../chosen/chosen.css" rel="stylesheet" />
<link href="../../tcal.css" rel="stylesheet" type="text/css" />
<!--
<script language="javascript" src="js/jquery-1.3.min.js"></script>
-->
<script language="javascript" src="../../js/tcal.js" type="text/javascript"></script>
<script language="javascript" src="../../js/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../chosen/chosen.jquery.js"></script>
<script language="javascript" src="../../js/validar.js"></script>
<!--
<script language="JavaScript"> 
 
function oculta(id){
	 var elDiv = document.getElementById(id); //se define la variable "elDiv" igual a nuestro div
	 elDiv.style.display='none'; //damos un atributo display:none que oculta el div	 
	}
 
function muestra(id){
	 var elDiv = document.getElementById(id); //se define la variable "elDiv" igual a nuestro div
	 elDiv.style.display='block';//damos un atributo display:block que  el div	 
	}
 
window.onload = function(){/*hace que se cargue la función */
/* "Mandamos como parametro el nombre de la Div para ocultar" */
/*muestra('Pitem');*/
oculta('Psucursal'); /*Ocultamos Pmoral*/
}
</script>
-->
</head>
<body>
<?php
include "../../conn.php";
include "../../general.php";
include "../../token.php";

//$usuario = $_GET["user"];

//listado de personas
$result1 = mysqli_query($link, "select pkyPerson as codigo, case when fldMiddleName is NULL then concat(fldLastName,', ',fldFirstName) else concat(fldLastName,' ',fldMiddleName,', ',fldFirstName) end as persona
from agnPerson
where
sysEnabled = 1 and sysAuthorized = 1
order by persona;");

//listado de genero
$result2 = mysqli_query($link, "select pkyGender as cod_gen, fldName as genero
from
agnGender 
where
sysEnabled = 1 and sysAuthorized = 1 
order by fldName;");

//listado de ciudad
$result3 = mysqli_query($link, "select a.pkyCity as cod_ciu, a.fldName as ciudad, b.fldName as pais
from 
regCity a, regCountry b
where 
a.codCountry = b.pkyCountry and 
a.sysEnabled = 1 and a.sysAuthorized = 1 
order by ciudad, pais;");

//listado de cargo
$result4 = mysqli_query($link, "select pkyJob as cod_cargo, fldName as cargo
from 
hrsJob 
where
sysEnabled = 1 and sysAuthorized = 1 
order by fldName;");

//listado de ciudad
$result5 = mysqli_query($link, "select a.pkyCity as cod_ciu, a.fldName as ciudad, b.fldName as pais
from 
regCity a, regCountry b
where 
a.codCountry = b.pkyCountry and 
a.sysEnabled = 1 and a.sysAuthorized = 1 
order by ciudad, pais;");

//listado de sucursal
$result6 = mysqli_query($link, "select a.pkyCompanyBranch as cod_suc, a.fldName as suc, a.fldID as id, b.fldName as ciudad
from 
agnCompanyBranch a, regCity b 
where 
a.codCompany = 2 and 
a.codCity = b.pkyCity and 
a.sysEnabled = 1 and a.sysAuthorized = 1 
order by a.fldName;");

?>
<table border="0" align="left" width="100%" cellpadding="5">
<tr><td><b>Empresa: <?php echo $nombre_empresa; ?><br/>NIT: <?php echo $mi_nit; ?></b>
</td><td align="right"><b>Fecha: <?php echo date("Y-m-d"); ?><br/>Hora: <?php echo date("H:i:s"); ?><br/>Usuario: <?php echo $usuario; ?><br/>F</b>
</td></tr></table><br/>
<table border="0" align="center" cellpadding="5"><tr><td colspan="2" align="center">
<b>Par&aacute;metros Reporte Personas</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=13&tipo=1" onsubmit="return Validar3()">

<br/><b>Usuario: </b></td><td> <br/><input type="text" name="usuario" value="<?php echo $usuario; ?>" size="20" readonly="readonly" class="formulario" style="color:#999;">
<input type="hidden" name="token" value="<?php echo $token; ?>">
</td></tr><tr><td>
<br/><b>Persona: </b></td><td> <br/><!--<SELECT NAME="item" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="persona">
    <option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result1)) {   
	?> 
	<option value="<?php echo $row['codigo']?>"><?php echo $row['codigo']?> - <?php echo $row['persona'] ?></option> 
	<?php 
	}  
	mysqli_free_result($result1);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>G&eacute;nero: </b></td><td> <br/><!--<SELECT NAME="item" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="genero">
    <option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result2)) {   
	?> 
	<option value="<?php echo $row['cod_gen']?>"><?php echo $row['genero']?></option> 
	<?php 
	}  
	mysqli_free_result($result2);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>Ciudad: </b></td><td> <br/><!--<SELECT NAME="tipoi" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="ciudad">
	<option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result3)) {   
	?> 
	<option value="<?php echo $row['cod_ciu']?>"><?php echo $row['cod_ciu']?> - <?php echo $row['ciudad']?> - <?php echo $row['pais']?></option> 
	<?php 
	}  
	mysqli_free_result($result3);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>Cargo: </b></td><td> <br/><!--<SELECT NAME="tipoi" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="cargo">
	<option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result4)) {   
	?> 
	<option value="<?php echo $row['cod_cargo']?>"><?php echo $row['cod_cargo']?> - <?php echo $row['cargo']?></option> 
	<?php 
	}  
	mysqli_free_result($result4);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>Empleado: </b></td><td> <br/><input type="radio" name="empleado" checked="checked" value="-1" class="formulario"> Todos
<br/><input type="radio" name="empleado" value="1" class="formulario"> Si
<br/><input type="radio" name="empleado" value="0" class="formulario"> No

</td></tr><tr><td>

<br/><b>Autorizado a vender: </b></td><td> <br/><input type="radio" name="vende" checked="checked" value="-1" class="formulario"> Todos
<br/><input type="radio" name="vende" value="1" class="formulario"> Si
<br/><input type="radio" name="vende" value="0" class="formulario"> No

</td></tr><tr><td>

<br/><b>Activo: </b></td><td> <br/><input type="radio" name="activo" checked="checked" value="-1" class="formulario"> Todos
<br/><input type="radio" name="activo" value="1" class="formulario"> Si
<br/><input type="radio" name="activo" value="0" class="formulario"> No

</td></tr><tr><td>

<br/><b>Sucursal: </b></td><td> <br/><!--<SELECT NAME="tipoi" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="sucursal">
	<option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result6)) {   
	?> 
	<option value="<?php echo $row['cod_suc']?>"><?php echo $row['suc']?> - <?php echo $row['id']?> - <?php echo $row['ciudad']?></option> 
	<?php 
	}  
	mysqli_free_result($result6);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>Lugar de Nacimiento: </b></td><td> <br/><!--<SELECT NAME="tipoi" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="nacimiento">
	<option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result5)) {   
	?> 
	<option value="<?php echo $row['cod_ciu']?>"><?php echo $row['cod_ciu']?> - <?php echo $row['ciudad']?> - <?php echo $row['pais']?></option> 
	<?php 
	}  
	mysqli_free_result($result5);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>De Fecha de nacimiento: </b></td><td> <br/><div><input type="text" id="fechaini_nac" name="fechaini_nac" value="0000-00-00" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>
<br/><b>A Fecha de nacimiento: </b></td><td> <br/><div><input type="text" id="fechafin_nac" name="fechafin_nac" value="0000-00-00" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>

<br/><b>De Fecha de contrataci&oacute;n: </b></td><td> <br/><div><input type="text" id="fechaini_cont" name="fechaini_cont" value="0000-00-00" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>
<br/><b>A Fecha de contrataci&oacute;n: </b></td><td> <br/><div><input type="text" id="fechafin_cont" name="fechafin_cont" value="0000-00-00" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>

<br/><b>Ordenado por: </b></td><td> <br/><input type="radio" name="orden" checked="checked" value="0" class="formulario"> Apellido
<br/><input type="radio" name="orden" value="1" class="formulario"> G&eacute;nero
<br/><input type="radio" name="orden" value="2" class="formulario"> Fecha de nacimiento
<br/><input type="radio" name="orden" value="3" class="formulario"> Fecha de contrataci&oacute;n
 
</td></tr><tr><td>

<br/><b>Mostrar: </b></td><td> <br/><input type="checkbox" name="ciudad_ver" value="1" checked="checked" class="formulario"> Ciudad
<br/><input type="checkbox" name="cod_alt_ver" value="1" class="formulario"> C&oacute;digo Alternativo
<br/><input type="checkbox" name="genero_ver" value="1" class="formulario"> G&eacute;nero
<br/><input type="checkbox" name="web_ver" value="1" class="formulario"> Sitio Web
<br/><input type="checkbox" name="casilla_ver" value="1" class="formulario"> Casilla
<br/><input type="checkbox" name="nacimiento_ver" value="1" class="formulario"> Lugar de Nacimiento
<br/><input type="checkbox" name="fechanac_ver" value="1" class="formulario"> Fecha de Nacimiento
<br/><input type="checkbox" name="estcivil_ver" value="1" class="formulario"> Estado Civil
<br/><input type="checkbox" name="fechacont_ver" value="1" class="formulario"> Fecha de Contrataci&oacute;n
<br/><input type="checkbox" name="contrato_ver" value="1" class="formulario"> Cod. Alta, Nro. Contrato
<br/><input type="checkbox" name="tipoemp_ver" value="1" class="formulario"> Tipo de Empleado
<br/><input type="checkbox" name="salario_ver" value="1" class="formulario"> Salario B&aacute;sico
<br/><input type="checkbox" name="tiempotrab_ver" value="1" class="formulario"> Medida de Tiempo de Trabajo
<br/><input type="checkbox" name="codcaja_ver" value="1" class="formulario"> C&oacute;digo Caja de Salud
<br/><input type="checkbox" name="nua_ver" value="1" class="formulario"> C&oacute;digo Fondo de Pensiones (NUA)
<br/><input type="checkbox" name="edadjub_ver" value="1" class="formulario"> Edad de Jubilaci&oacute;n
<br/><input type="checkbox" name="descuentos_ver" value="1" class="formulario"> Descuentos Fijos AFP
<br/><input type="checkbox" name="cursos_ver" value="1" class="formulario"> Cursos
<br/><input type="checkbox" name="dependientes_ver" value="1" class="formulario"> Dependientes
<br/><input type="checkbox" name="documentos_ver" value="1" class="formulario"> Documentos
<br/><input type="checkbox" name="idiomas_ver" value="1" class="formulario"> Idiomas
<br/><input type="checkbox" name="direccion_ver" value="1" class="formulario"> Direcci&oacute;n
<br/><input type="checkbox" name="email_ver" value="1" class="formulario"> E-mail
<br/><input type="checkbox" name="telefono_ver" value="1" class="formulario"> Tel&eacute;fono
<br/><input type="checkbox" name="comisiones_ver" value="1" class="formulario"> Comisiones
<br/><input type="checkbox" name="conceptos_ver" value="1" class="formulario"> Conceptos Gasto
 
</td></tr>
<tr><td colspan="2" align="center">
<br/><br/><INPUT TYPE="submit" VALUE="Generar Reporte" class="boton_generar"></td></tr>

<script type="text/javascript"> $(".chzn-select").chosen({no_results_text: "No se encontraron resultados con "}); $(".chzn-select-deselect").chosen({allow_single_deselect:true}); </script>
</form>
</table>
</body>
</html>
