<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Planilla de Sueldos y Salarios</title>
<link href="../../maincss.css" rel="stylesheet" type="text/css" />
<link href="../../tcal.css" rel="stylesheet" type="text/css" />
<link href="../../chosen/chosen.css" rel="stylesheet" />

<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>

</head>
<?php
include "../../conn.php";
include "../../general.php";
include "../../token.php";

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

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

//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 = 1 and 
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 sucursal
$result5 = 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;");

//lista contexto
$result7 = mysqli_query($link, "select pkyContext as cod_contexto, fldName as contexto, codCostCenter as cod_cc 
from srvContext
where 
sysEnabled = 1 and sysAuthorized = 1;");

?>
<body>

<?php 
//Inicio reporte sueldos y salarios

?>
<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 Planilla de Sueldos y Salarios</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=9&tipo=1" onsubmit="return Validar4()">
<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>Planilla: </b></td><td> 
<br/><input type="radio" name="planilla" checked="checked" value="0" class="formulario"> Mensual (Tama&ntilde;o Oficio)
<br/><input type="radio" name="planilla" value="1" class="formulario"> Mensual Ampliada (Tama&ntilde;o Oficio)<!--Mensual Ampliada (Solo Reporte)-->
<br/><input type="radio" name="planilla" value="2" class="formulario"> Tributaria
<br/><input type="radio" name="planilla" value="8" class="formulario"> Tributaria v2
<br/><input type="radio" name="planilla" value="3" class="formulario"> Boletas de Pago (Solo Formato Impresi&oacute;n)
<br/><input type="radio" name="planilla" value="4" class="formulario"> Fondo Solidario (Solo Reporte)
<br/><input type="radio" name="planilla" value="5" class="formulario"> Caja de Salud (Solo Reporte)
<br/><input type="radio" name="planilla" value="6" class="formulario"> AFP (Solo Reporte)
<!--<br/><input type="radio" name="planilla" value="7" class="formulario"> Retroactivo (Tama&ntilde;o Oficio)-->
<!--<br/><input type="radio" name="planilla" value="2" class="formulario"> Aguinaldo
<br/><input type="radio" name="planilla" value="3" class="formulario"> Segundo Aguinaldo
-->
</td></tr><tr><td>

<br/><b>Mostrar: </b></td><td> <br/><input type="radio" name="mostrar" checked="checked" value="0" class="formulario"> Formato Presentaci&oacute;n
<br/><input type="radio" name="mostrar" value="1" class="formulario"> Reporte
</td></tr><tr><td>

<br/><b>Empleado: </b></td><td><br/><!--<SELECT NAME="cliente" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="empleado">
	<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['empleado']?></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<br/>de la(s) sucursal(s): </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>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($result5)) {   
	?> 
	<option value="<?php echo $row['cod_suc']?>"><?php echo $row['suc']?> - <?php echo $row['id']?> - <?php echo $row['ciudad']?></option> 
	<?php 
	}  
	mysqli_free_result($result5);
	?>
    </select>    
</td></tr><tr><td>

<br/><b>Contexto: </b></td><td> <br/><!--<SELECT NAME="concepto_pago" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="contexto">
    <option value="-1">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result7)) {   
	?> 
	<option value="<?php echo $row['cod_contexto']?>"><?php echo $row['cod_contexto']?> - <?php echo $row['contexto']?></option> 
	<?php 
	}  
	mysqli_free_result($result7);
	?> 
    </select>
</td></tr><tr><td>
<br/><b>AFP: </b></td><td> <br/><input type="radio" name="afp" checked="checked" value="-1" class="formulario"> Todos
<br/><input type="radio" name="afp" value="0" class="formulario"> No Asignado
<br/><input type="radio" name="afp" value="1" class="formulario"> Previsi&oacute;n
<br/><input type="radio" name="afp" value="2" class="formulario"> Futuro

</td></tr><tr><td>
<br/><b>Mes A&ntilde;o Inicial: </b></td><td> <br/><div>
<select id="mesini" name="mesini" class="formulario">
  <?php
      //$mes=date("n"); 
	  $mes=$mes_ini;
      $rango=11; 
      for ($i=1;$i<=12;$i++){ 
         if($mes>12) { $mes=1; }
		 $meses=nombreMes($mes);
		 echo "<option value='$mes'>$meses</option>";
		 $mes++; 
      } 
  ?> 
</select>
<input type="text" id="anoini" name="anoini" value="<?php echo $ano_ini; ?>" size="4" length="4" maxlength="4" title="aaaa"> </div>&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;
aaaa
</td></tr><tr><td>

<br/><b>Mes A&ntilde;o Final: </b></td><td> <br/><div>
<select id="mesfin" name="mesfin" class="formulario">
  <?php
      //$mes=date("n"); 
	  $mes=$mes_ini;
      $rango=11; 
      for ($i=1;$i<=12;$i++){ 
         if($mes>12) { $mes=1; }
		 $meses=nombreMes($mes);
		 echo "<option value='$mes'>$meses</option>";
		 $mes++; 
      } 
  ?> 
</select>
<input type="text" id="anofin" name="anofin" value="<?php echo $ano_ini; ?>" size="4" length="4" maxlength="4" title="aaaa"> </div>&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;
aaaa
<!--
</td></tr><tr><td>
<br/><b>De Fecha: </b></td><td> <br/><div><input type="text" name="fechaini" value="<?php echo $fechaini_gest; ?>" length="10" maxlength="10" class="tcal" title="aaaa-mm-dd"> </div>aaaa-mm-dd
</td></tr><tr><td>
<br/><b>A Fecha: </b></td><td> <br/><div><input type="text" name="fechafin" value="<?php echo $fecha_hoy; ?>" 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"> Nombre
<br/><input type="radio" name="orden" value="1" class="formulario"> Fecha Nacimiento
<br/><input type="radio" name="orden" value="2" class="formulario"> Sexo
<br/><input type="radio" name="orden" value="3" class="formulario"> Cargo
<br/><input type="radio" name="orden" value="4" class="formulario"> Fecha Contrataci&oacute;n
<br/><input type="radio" name="orden" value="5" class="formulario"> AFP (Siempre usa AFP Todos)
<br/><input type="radio" name="orden" value="6" class="formulario"> AFP y Fecha Contrataci&oacute;n (Siempre usa AFP Todos)
<br/><input type="radio" name="orden" value="7" class="formulario"> C&oacute;digo

</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>
