<?
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=22;
?>
<?
/*Sesiones*/
include("../conex.php");
include("../autoriza.php");
//if ($txtfecha=='')
 $txtfecha = date('d')."/".date('m')."/".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=windows-1252">
<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"><div align="center"><span class="Estilo1">Lista Clientes por Segmento&nbsp;&nbsp;</span></div></td>
    </tr>
  </table>
  <table width="250" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
  	  <td width="10%" align="center"></td>
	<td width="90%" align="center"><?
			$sql_umed ="SELECT Id , descripcion FROM segmentacion ORDER BY descripcion ASC";
			$res_umed = mysql_query($sql_umed,$enlace);
			$contb=0;
			?>
              <select name="lstvendedor" id="lstvendedor" style="width:192px">
			  <option value="0" selected="selected"> SEGMENTO (Todos)</option>
			  <?
			  while (mysql_fetch_object ($res_umed))
				{
				$sql_umed_cod = mysql_result($res_umed, $contb, "id");
				$id_vendedor = $sql_umed_cod;
				$sql_umed_nom = mysql_result($res_umed, $contb, "descripcion");
			?>
                <option value="<?=$sql_umed_cod?>"><? echo $sql_umed_nom;?></option>
			<?
				$contb = $contb+1;
			}
			?>
              </select>		
		</td>
	</tr>
	  <tr>
	  <td width="10%" align="center"></td>
	<td width="90%" align="center"><?
			$sql_umed ="SELECT cod_comuna AS id, comuna AS descripcion FROM comunas ORDER BY comuna ASC";
			$res_umed = mysql_query($sql_umed,$enlace);
			$contb=0;
			?>
             <select name="lstciudad" id="lstciudad" style="width:192px">
                  <option value="0" selected="selected"> CIUDAD (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;?></option>
                  <?
				$contb = $contb+1;
			}
			?>
                </select>		
                </td>
	</tr>
</table>
<table width="150" height="32" border="0" align="center">
	<tr>
		<td width="30%" align="right"><input type="button" name="Submit1" value="Pantalla" onClick="fun_pantalla()"/></td>
		<td width="40%" align="right"><input type="button" name="Submit2" value="Salida Excel" onClick="fun_excel()"/></td>
		<td width="30%" 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();
	}
function fun_excel()
	{
	document.form1.action='muestra1.php';
	document.form1.submit();
	}
function fun_pantalla()
	{
	document.form1.action='muestra.php';
	document.form1.submit();
	}
</script>
			

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