<!DOCTYPE html>
<html lang="es-ES">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Almacenes</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/jquery-3.4.1.js"></script>
<script type="text/javascript" src="../../chosen/chosen.jquery.js"></script>

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

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

//listado de almacenes
$result4 = mysqli_query($link, "select a.pkyWarehouse as cod_alm, a.fldName as almacen, a.codCity as cod_ciu, b.fldName as ciudad, a.codAccount as cod_cta, c.fldName as cuenta, a.txtDescription as descripcion 
from 
invWarehouse a, regCity b, actAccount c
where
a.codCity = b.pkyCity and 
a.codAccount = c.pkyAccount and 
a.sysEnabled = 1 and a.sysAuthorized = 1 
order by a.fldName;");

//listado de ciudad
$result5 = mysqli_query($link, "select a.pkyCity as cod_ciu, a.fldName as ciudad, a.codCountry as cod_pais, b.fldName as pais
from
regCity a, regCountry b
where
a.codCountry = b.pkyCountry 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 Almacenes</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=13&tipo=1">

<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>Almac&eacute;n:</b></td><td> <br/><!--<SELECT NAME="item" class="formulario">-->
	<select data-placeholder="Seleccione..." class="chzn-select" style="width:300px;" NAME="almacen">
    <option value="0">Todos</option>
	<?php 
	while ($row = mysqli_fetch_array($result4)) {   
	?> 
	<option value="<?php echo $row['cod_alm']?>"><?php echo $row['cod_alm']?> - <?php echo $row['almacen']?></option> 
	<?php 
	}  
	mysqli_free_result($result4);
	?>
    </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($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);
	?>
        
</td></tr><tr><td>

<br/><b>Ordenado por: </b></td><td> <br/><input type="radio" name="orden" checked="checked" value="0" class="formulario"> Almac&eacute;n
<br/><input type="radio" name="orden" value="1" class="formulario"> Ciudad
 
</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>
