<?
session_start();
if ($_SESSION['estado'] != "ON")
		{
		?>
		<script>
			parent.location.href = '../index.php';
		</script>
		<? 
		exit();
		}
$id_empresa = $_SESSION['ss_empresa'];
$id_user = $_SESSION['ss_user'];
$id_autoriza=10;

/*Sesiones*/
include("../conex.php");
include("../autoriza.php");

$txtfecha = date('d')."/".date('m')."/".date('Y');
$txtfecha1 = "01/01/".date('Y');
?>
<!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=iso-8859-1" />
<title>filtro</title>
<script language="JavaScript" src="../css/cal.js" type="text/JavaScript"></script>
<style type="text/css">
<!--
body {
	background-color: #CCCCCC;
	margin-left: 0px;
	margin-top: 3px;
	margin-right: 0px;
	margin-bottom: 0px;
}
select {
	clear: right;
	float: left;
	height: auto;
	width: 267px;
}
.Estilo1 {font-family: Arial, Helvetica, sans-serif}
-->
</style></head>
</head>
<body>
<div align="center">

<form id="form1" name="form1" method="post" action="muestra.php" target="mainFrame">
<div align="center">
  <table width="363" border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td width="100%" align="center"><span class="Estilo1">Estadistica Vendedor-Cliente-Productos</span></td>
    </tr>
    <tr>
      <td width="100%" align="center"><a  href="javascript:show_calendar('form1.txtfecha');">
        <input name="txtfecha" id="txtfecha" type="text" style="border-width:0; background-color:#CCCCCC; text-align:right" align="right" value="<?=$txtfecha1?>" size="7" readonly="1" /> 
        </a><a  href="javascript:show_calendar('form1.txtfecha');"><img name="foto" id="foto" align="top" border="0" src="../Images/CALENDAR.gif" style="cursor:pointer" title="Presione aqui y seleccione la fecha" /> </a><a  href="javascript:show_calendar('form1.txtfecha1');">
        <input name="txtfecha1" id="txtfecha1" type="text" style="border-width:0; background-color:#CCCCCC; text-align:right" align="right" value="<?=$txtfecha?>" size="7" readonly="1" />
      </a><a  href="javascript:show_calendar('form1.txtfecha1');"><img src="../Images/CALENDAR.gif" alt="foto2" name="foto" border="0" align="top" id="foto1" style="cursor:pointer" title="Presione aqui y seleccione la fecha" /></a></td>
      <td width="0%" align="center"> </td>
    </tr>
  </table>
  <table width="250" border="0" align="center" cellpadding="0" cellspacing="0">
 <tr>
		<td width="8%">&nbsp;</td>
		<td width="92%" align="right">
		  <?
			$sql_umed ="SELECT id , nombres AS descripcion FROM vendedor ORDER BY nombres ASC";
			$res_umed = mysql_query($sql_umed,$enlace);
			$contb=0;
			?>
		  <div align="center">
		    <select name="lstvendedor" id="lstvendedor" style="width:300px">
		      <option value="0" selected="selected">Vendedor(Todos)</option>
		      <?
			  while (mysql_fetch_object ($res_umed))
				{
				$sql_umed_cod = mysql_result($res_umed, $contb, "id");
				$sql_umed_nom = mysql_result($res_umed, $contb, "descripcion");
			?>
		      <option value="<?=$sql_umed_cod?>"><? echo $sql_umed_nom.' '.$sql_umed_cod;?></option>
		      <?
				$contb = $contb+1;
			}
			?>
		      </select>
		          </div>
		</td>
	</tr>
  <tr>
	<td width="5%">&nbsp;</td>
		
		<td width="30%" align="right"><?
			$sql_umed ="SELECT rut, razon_social  FROM nombres where cliente='True' ORDER BY razon_social ASC";
			$res_umed = mysql_query($sql_umed,$enlace);
			$contb=0;
			?>
              <select name="lstcliente" id="lstcliente" style="width:300px">
			  <option value="0" selected="selected">Cliente(Todos)</option>
			  <?
			  while (mysql_fetch_object ($res_umed))
				{
				$sql_umed_cod = mysql_result($res_umed, $contb, "rut");
				$sql_umed_nom = mysql_result($res_umed, $contb, "razon_social");
			?>
                <option value="<?=$sql_umed_cod?>"><? echo $sql_umed_nom.' '.$sql_umed_cod;?></option>
			<?
				$contb = $contb+1;
			}
			?>
              </select>		</td>
			  </tr>
 
</table>
<table width="150" height="32" border="0" align="center">
	<tr>
		<td width="65%" align="right"><input type="submit" name="Submit2" value="Ver "/></td>
      
		<td width="35%" align="left">
			<input type="submit" name="Submit" value="Salir" onClick="fun_salir();"/>		</td>
	</tr>
</table>

<script language="javascript">
function fun_salir()
	{
	window.top.open('','_parent','');window.top.close();
	}
</script>
			

	</div>
</form>
  </div>
</body>
</html>