<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Bonos y Descuentos</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 bonos y descuentos
$result3 = mysqli_query($link, "select pkyBonusDiscountConcept as cod_bondes, fldName as nombre, fldIsDiscount as cod_bod, case when fldIsDiscount = 0 then 'Bono' else 'Descuento' end as bod
from hrsBonusDiscountConcept 
where 
sysEnabled = 1 and sysAuthorized = 1
order by bod, nombre;");

//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 Bonos y Descuentos</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>Agrupado por Concepto: </b></td><td> <br/><input type="radio" name="agrupado" checked="checked" value="0" class="formulario"> No
<br/><input type="radio" name="agrupado" value="1" class="formulario"> Si

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

<br/><b>Bono / Descuento: </b></td><td> <br/><!--<SELECT NAME="tipoi" class="formulario">-->
<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="bod">
	<option value="0">Todos</option>
    <option value="-1">Bonos</option>
    <option value="-2">Descuentos</option>
	<?php 
	while ($row = mysqli_fetch_array($result3)) {   
	?> 
	<option value="<?php echo $row['cod_bondes']?>"><?php echo $row['cod_bondes']?> - <?php echo $row['nombre']?> (<?php echo $row['bod']?>)</option> 
	<?php 
	}  
	mysqli_free_result($result3);
	?>
    </select>    

</td></tr><tr><td>
<br/><b>Modalidad: </b></td><td> <br/><input type="radio" name="modalidad" checked="checked" value="-1" class="formulario"> Todos
<br/><input type="radio" name="modalidad" value="0" class="formulario"> Fijo
<br/><input type="radio" name="modalidad" value="1" class="formulario"> Variable

</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>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 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>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"> Modalidad
<br/><input type="radio" name="orden" value="2" class="formulario"> Empleado
<br/><input type="radio" name="orden" value="3" class="formulario"> G&eacute;nero
<!--<br/><input type="radio" name="orden" value="4" class="formulario"> Cargo-->

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