<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
if(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
JsDir("cerrar.php");	
return;
}
//
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$StrNom=V($_POST['TxtNom']);		

$StrNomT=$StrNom."%";
$LStrTR=gn("count(*)","distritos","id_distrito>0 AND dis_nombre LIKE '$StrNomT'");
$LStrPag=V($_POST['TxtPag']);	
if($StrCmd=="F"){$LStrPag="1";}
$VP_RegXPag=20;	
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);

$LStrFoc="document.getElementById('TxtNom').focus();";
$LStrMsg="onload=\"$LStrFoc;\"";
?>
<!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>Departamentos</title>
<script type="text/javascript" src="fe/funciones.js"></script>
<style type="text/css">
<!--
body {
	background-color: #CCC;
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
     width:700px;
     height:600px;
     position:absolute;
     left:<?php echo "50%";?>;
     top:<?php echo "50%";?>;
	 background-color:#006699;
	 margin:<?php echo "-300px";?> 0 0 <?php echo "-350px";?>;

}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FFFFFF;
}
.f2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.Estilo4 {color: #000099}
.Estilo5 {color: #000000}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="distritos_buscar.php">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer6" style="position:absolute; left: 32px; top: 86px; width: 152px;">
      <div align="left" class="f2">NOMBRE</div>
    </div>
    <div id="layer5" style="position:absolute; left: 116px; top: 50px; width: 85px; height: 28px;">
      <div align="left" class="f2">
        <input name="CmdV" type="button" id="CmdV" 
        value="Volver" onclick="fVolver('distritos.php');" />
      </div>
    </div>

<div id="layer3" style="position:absolute; left: 30px; top: 138px; width: 638px; height: 412px; overflow:auto">
<div align="left" class="f2">
<table width="622" height="24" border="1" cellpadding="0" cellspacing="0">

<tr>
<td height="18" colspan="2" bgcolor="#666666" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<td width="551" bgcolor="#999999"><span class="Estilo4">NOMBRE</span></td>
<td width="28" bgcolor="#999999">&nbsp;</td>
</tr>
<?php		  				  
$s="SELECT id_distrito,dis_nombre 
	FROM distritos WHERE id_distrito> 0 AND 
	dis_nombre LIKE '$StrNomT' ORDER BY dis_nombre ";
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);
	$result = grs($s);
	while ($row = $result->fetch_row()){
		echo "<tr 
		ondblclick=\"location.href='distritos.php?Id=$row[0]&Pag=0';\">";
		echo "<td bgcolor=\"#FFFFFF\">
			 <span class=\"Estilo5\">$row[1]</span></td>";
		echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
			 <a href=\"distritos.php?Id=$row[0]&Pag=0\" >
			 <img src=\"img/b_edit.png\"  border=\"0\"/>
			 </a>
			 </td>";
		echo "</tr>";
	}

?>		  

</table>
</div>
</div>

    <div id="layer" style="position:absolute; left: 116px; top: 30px; width: 412px; height: 24px;">
      <div align="left" class="Estilo1">DEPARTAMENTOS - BUSCAR
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
        <input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
      </div>
    </div>
          <input name="TxtNom" type="text" id="TxtNom" 
          style="position:absolute; left: 31px; top: 109px; width: 443px;" 
          value="<?php echo $StrNom;?>"  
          onKeyDown="return SoloTextoEx(event,'CmdB');" tabindex="1" />

    <div id="LblTit" style="position:absolute; left: 57px; top: 25px; width: 64px;">
    <div align="left" class="Estilo1"><img src="img/buscar.png" width="57" height="60" /></div>
  </div>	
        <input name="CmdB" type="button" id="CmdB"
style="position:absolute; left: 487px; top: 109px; width: 72px;"
 value="Filtrar" onclick="fFiltrar();" />

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