<?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;
}
//++++	
	$StrGT="";	
	$LStrMsg="";
	$LStrFoc="";
	$LStrMM="";	
	$LIMPIAR=0;	
	$LStrPag=V($_POST['TxtPag']);
	include("empresas_fun.php");
	$VP_RegXPag=10;
	$LStrTR=gn("count(*)","almacenes","id_almacen>0");
	$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);
	
?>
<!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>Empresas</title>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script type="text/javascript" src="fe/empresas2.js"></script>
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basic.css"  />
<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:650px;
     position:absolute;
     left:<?php echo "50%";?>;
     top:<?php echo "50%";?>;
	 background-color:#006699;
	 margin:<?php echo "-325px";?> 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}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="empresas.php">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >

    <div id="layer4" style="position:absolute; left: 32px; top: 85px; width: 538px; height: 26px;">
      <div align="left" class="f2">
        <input name="CmdB" type="button" id="CmdG"
		<?php
		if(strlen($StrId)==0){
			echo "value=\"Guardar\"";
		}else{
			echo "value=\"Modificar\"";
		}
		?>
		onclick="fGuardar();" style="width:80px" tabindex="4"/>
		<input name="CmdB" type="button" id="CmdC" value="Nuevo" onclick="fCancelar();"  tabindex="5"/>
		<input name="CmdB" type="button" id="CmdE" value="Eliminar" onclick="fEliminar();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";
		}
		?>
		 tabindex="6"/>
		<input name="CmdB" type="button" id="CmdZ" 
         value="Menu" onclick="fBuscar('menu.php');"  tabindex="7"/>
      </div>
    </div>

<div id="layer3" style="position:absolute; left: 32px; top: 447px; width: 637px; height: 186px; overflow:auto">
<div align="left" class="f2">
<table width="621" height="19" border="1" cellpadding="0" cellspacing="0">
<tr  >
<td height="18" colspan="3" bgcolor="#666666" align="center">
<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>
<tr>
<td width="415" bgcolor="#999999"><span class="Estilo4">NOMBRE</span></td>
<td width="176" bgcolor="#999999"><span class="Estilo4">NOMBRE CORTO</span></td>
<td width="22" bgcolor="#999999">&nbsp;</td>
</tr>
<?php
	$s="SELECT id_emp,emp_noml,emp_nomc FROM empresas
		WHERE id_emp> 0 ORDER BY emp_noml";
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);		  				
$result = grs($s);
while ($row = $result->fetch_row()){
	echo "<tr ondblclick=\"fActivar($row[0]);\">";
	echo "<td bgcolor=\"#FFFFFF\">
		  <span class=\"Estilo5\">$row[1]</span></td>";
	echo "<td bgcolor=\"#FFFFFF\">
		  <span class=\"Estilo5\">$row[2]</span></td>";

	echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
		 <a href=\"javascript:void(0)\" onclick=\"fActivar($row[0]);\">
		 <img src=\"img/b_edit.png\"  border=\"0\"/>
		 </a>
		 </td>";
	echo "</tr>";
}

?>		  

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

    <div id="layer" style="position:absolute; left: 128px; top: 19px; width: 412px; height: 24px; z-index: 100;">
      <div align="left" class="Estilo1">
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
        <strong>EMPRESAS</strong></div>
    </div>

<div id="LblTit" style="position:absolute; left: 57px; top: 9px; width: 69px; z-index: 100; height: 63px;">
<div align="left" class="Estilo1"><img src="img/almacen.jpg" width="68" height="62" /></div>
</div>

<div class="s1" style="left: 32px; top: 126px; width: 183px;">
NOMBRE</div>
<input name="Noml" type="text" id="Noml"
style="left: 32px; top: 146px; width: 395px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'Nomc');" 
value="<?php echo $Noml;?>" maxlength="150" />

<div class="s1" style="left: 457px; top: 126px; width: 168px;">
NOMBRE CORTO
</div>
<input name="Nomc" type="text" id="Nomc" 
style="left: 455px; top: 146px; width: 190px;" tabindex="2"   
onkeydown="return SoloTextoEx(event,'Dir');" 
value="<?php echo $Nomc;?>" maxlength="20" />

<div class="s1" style="left: 32px; top: 175px; width: 187px;">
DIRECCION</div>
<input name="Dir" type="text" id="Dir" 
style="left: 32px; top: 194px; width: 614px;" tabindex="3"   
onkeydown="return SoloTextoEx(event,'feDis');" 
value="<?php echo $Dir;?>" maxlength="150" />

<div class="s1" style="left: 32px; top: 226px; width: 264px;">
<b>FACTURACION ELECTRONICA</b></div>

<div class="s1" style="left: 32px; top: 247px; width: 114px;">HABILITADA</div>
<select name="feHab" id="feHab" 
style="position:absolute; left: 32px; top: 264px; width: 104px;" tabindex="8"
onkeydown="return SoloTextoEx(event,'TxtRojo');">
<?php echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$feHab,"N","N");?>
</select>

<div class="s1" style="left: 151px; top: 247px; width: 267px;">
NOMBRE COMERCIAL / RAZON SOCIAL</div>
<input name="feNom" type="text" id="feNom"
style="left: 151px; top: 264px; width: 500px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feRuc');" 
value="<?php echo $feNom;?>" maxlength="255" />

<div class="s1" style="left: 32px; top: 294px; width: 106px;"> RUC
</div>
<input name="feRuc" type="text" id="feRuc"
style="left: 32px; top: 313px; width: 100px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feDep');" 
value="<?php echo $feRuc;?>" maxlength="11" />

<div class="s1" style="left: 151px; top: 294px; width: 106px;">
DEPARTAMENTO</div>
<input name="feDep" type="text" id="feDep"
style="left: 151px; top: 313px; width: 131px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'fePrv');" 
value="<?php echo $feDep;?>" maxlength="255" />

<div class="s1" style="left: 301px; top: 294px; width: 106px;">
PROVINCIA</div>
<input name="fePrv" type="text" id="fePrv"
style="left: 301px; top: 313px; width: 111px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feDis');" 
value="<?php echo $fePrv;?>" maxlength="255" />

<div class="s1" style="left: 434px; top: 294px; width: 106px;"> DISTRITO
</div>
<input name="feDis" type="text" id="feDis"
style="left: 434px; top: 313px; width: 111px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feUbi');" 
value="<?php echo $feDis;?>" maxlength="255" />

<div class="s1" style="left:564px; top: 294px; width: 65px;">
UBIGEO
</div>
<input name="feUbi" type="text" id="feUbi"
style="left:561px; top: 313px; width: 89px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feDir');" 
value="<?php echo $feUbi;?>" maxlength="255" />


<div class="s1" style="left:32px; top:345px; width: 209px;">
DIRECCION
</div>
<input name="feDir" type="text" id="feDir"
style="left:32px; top: 364px; width: 619px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'feEma');" 
value="<?php echo $feDir;?>" maxlength="255" />


<div class="s1" style="left:32px; top:395px; width: 209px;">
EMAIL</div>
<input name="feEma" type="text" id="feEma"
style="left:32px; top: 411px; width: 619px;" 
tabindex="1"  
onKeyDown="return SoloTextoEx(event,'CmdG');" 
value="<?php echo $feEma;?>" maxlength="100" />







<div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 700px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
<div align="left" class="Estilo1">ALMACENES
<input name="TxtId2" type="hidden" id="TxtId2" value="<?php echo $StrId;?>"/>
<input name="TxtAc2" type="hidden" id="TxtAc2" value="" />
<input name="TxtPag2" type="hidden" id="TxtPag2" value="<?php echo $LStrPag; ?>" />
</div>
</div>
</div>
</center>	
</form>
</body>
</html>
