<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Parametros Reporte Libro de Ventas</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/jquery-1.3.min.js"></script>
-->
<script language="javascript" src="../../js/tcal.js" type="text/javascript"></script>
<script language="javascript" src="../../js/jquery-1.9.0.js"></script>
<script type="text/javascript" src="../../chosen/chosen.jquery.js"></script>

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

$usuario = $_GET["user"];
/*
//calculo de inicio de gestion
$ano_det = substr($fecha_hoy,0,4);
$resultano = mysqli_query($link, "select codStartMonth as mes_ini
from actFiscalYear 
where
pkyFiscalYear = '$ano_det';");
while ($row = mysqli_fetch_array($resultano)) {
	$mes_ini = $row['mes_ini'];
}
mysqli_free_result($resultano);

if($mes_ini < 10) { $mes_ini = '0'.$mes_ini; }

$fechaini_gest = $ano_det.'-'.$mes_ini.'-01';
*/

$resultsuc = mysqli_query($link, "select a.pkyCompanyBranch as cod_suc, a.codCompany as cod_emp, a.fldName as sucursal, a.fldID as nro_suc, a.codCity as cod_ciu, b.fldName as ciudad, a.fldPhone as tel, a.fldAddress as direccion
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.fldID;");

//listado de clientes
$result2 = mysqli_query($link, "select pkyCompany as codigo, fldName as cliente
from agnCompany
where
fldIsClient = 1 and
sysEnabled = 1 and sysAuthorized = 1
order by cliente;");

?>

<body>

<?php 
//Inicio reporte Libro de Ventas

?>
<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/>C</b>
</td></tr></table><br/>
<table border="0" align="center" cellpadding="5"><tr><td colspan="2" align="center">
<b>Par&aacute;metros Reporte Libro de Ventas</b></td></tr><tr><td>
<form id="miform" name="miform" method="post" action="report.php?rep=9&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;">
</td></tr><tr><td>
<br/><b>Mostrar: </b></td><td> <br/><input type="radio" name="mostrar" checked="checked" value="0" class="formulario"> Formato Libro de Ventas
<br/><input type="radio" name="mostrar" value="1" class="formulario"> Facturas con Detalle

</td></tr><tr><td>
<br/><b>Sucursal: </b></td><td> <br/><SELECT NAME="cod_sucursal" class="formulario">
	<!--<option value="0">Todos</option>-->
    <?php 
	while ($row = mysqli_fetch_array($resultsuc)) {   
	?> 
    
	<option value="<?php echo $row['cod_suc']?>"><?php echo $row['nro_suc']?> - <?php echo $row['sucursal']?> (<?php echo $row['ciudad']?>)</option> 
	<?php 
	}  
	mysqli_free_result($result3);
	?> 
    </SELECT>

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

</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"> Fecha
<br/><input type="radio" name="orden" value="1" class="formulario"> Cliente

</td></tr><tr><td>
<br/><b>Mostrar Anuladas: </b></td><td> <br/><input type="radio" name="mostrar" checked="checked" value="0" class="formulario"> No
<br/><input type="radio" name="mostrar" value="1" class="formulario"> Si
-->
</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>
