<?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");
$SYS_MSG="";$SYS_FOC="";$OK=1;
$StrId=V($_POST['TxtId']);$StrCmd=V($_POST['TxtAc']);$LStrPag=V($_POST['TxtPag']);
//
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;
}
//--------------------------------------------------------------------------++
include("sis_empresas_fun.php");
//--------------------------------------------------------------------------+++
$VP_RegXPag=35;
$LStrTR=gn("count(*)","empresas","id_emp>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);
$TI=0;
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Empresas</title>
<?php AddJs(); ?>

<script type="text/javascript" src="js/sis_funciones_fes.js"></script>
<script type="text/javascript" src="js/sis_empresas_fes.js"></script>

<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />

<style type="text/css">
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}
.cF {height:1200px;width:1250px;position:relative;top:0px}
</style>

<script>
$(document).ready(function(){  
   Inicializar();
   SYS_LOAD();
});
</script>

</head>
<body>

<div align="center">
<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" action="sis_empresas.php" onSubmit="return false;" enctype="multipart/form-data">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="bng/emp.png" class="iT" style="width:48px; height:48px" />
<div class="tT">EMPRESAS</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left: 35px; top: 114px; width: 183px;">
NOMBRE</div>
<input name="Noml" type="text" id="Noml"
class="lt" style="left: 35px; top: 131px; width: 395px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Noml;?>" maxlength="150" />

<div class="s1" style="left: 439px; top: 114px; width: 168px;">
NOMBRE CORTO</div>
<input name="Nomc" type="text" id="Nomc" 
class="lt" style="left: 439px; top: 131px; width: 208px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Nomc;?>" maxlength="20" />

<div class="s1" style="left: 655px; top: 114px; width: 187px;">
DIRECCION</div>
<input name="Dir" type="text" id="Dir" 
class="lt" style="left: 655px; top: 131px; width: 569px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Dir;?>" maxlength="150" />

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

<div class="s1" style="left: 35px; top: 181px; width: 114px;">
HABILITADA</div>
<select name="feHab" id="feHab" 
class="lt" style="left: 35px; top: 198px; width: 104px;" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$feHab,"N","N");?>
</select>

<div class="s1" style="left: 152px; top: 181px; width: 267px;">
NOMBRE COMERCIAL / RAZON SOCIAL</div>
<input name="feNom" type="text" id="feNom"
class="lt" style="left: 152px; top: 198px; width: 452px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feNom;?>" maxlength="255" />

<div class="s1" style="left: 611px; top: 181px; width: 94px;"> RUC
</div>
<input name="feRuc" type="text" id="feRuc"
class="lt" style="left: 611px; top: 198px; width: 100px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feRuc;?>" maxlength="11" />

<div class="s1" style="left: 720px; top: 181px; width: 106px;">
DEPARTAMENTO</div>
<input name="feDep" type="text" id="feDep"
class="lt" style="left: 720px; top: 198px; width: 141px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feDep;?>" maxlength="255" />

<div class="s1" style="left: 868px; top: 181px; width: 106px;">
PROVINCIA</div>
<input name="fePrv" type="text" id="fePrv"
class="lt" style="left: 868px; top: 198px; width: 111px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $fePrv;?>" maxlength="255" />

<div class="s1" style="left: 987px; top: 181px; width: 106px;"> DISTRITO
</div>
<input name="feDis" type="text" id="feDis"
class="lt" style="left: 987px; top: 198px; width: 111px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feDis;?>" maxlength="255" />

<div class="s1" style="left: 1107px; top: 181px; width: 65px;">
UBIGEO
</div>
<input name="feUbi" type="text" id="feUbi"
class="lt" style="left: 1107px; top: 198px; width: 108px;" 
tabindex="<?php echo ++$TI;?>" 
value="<?php echo $feUbi;?>" maxlength="255" />


<div class="s1" style="left: 35px; top: 231px; width: 209px;">
DIRECCION
</div>
<input name="feDir" type="text" id="feDir"
class="lt" style="left: 35px; top: 248px; width: 603px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feDir;?>" maxlength="255" />

<div class="s1" style="left: 651px; top: 231px; width: 209px;">
EMAIL</div>
<input name="feEma" type="text" id="feEma"
class="lt" style="left: 651px; top: 248px; width: 563px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $feEma;?>" maxlength="100" />

<div class="s1" style="left: 35px; top: 279px; width: 135px;"> TIPO DE PROVEEDOR
</div>
<select name="FeTipPrv" id="FeTipPrv" 
class="lt" style="left: 35px; top: 297px; width: 130px;" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("au_item","auxiliar","au_tab='FE_PROVEEDOR'",$FeTipPrv,"N","N");?>
</select>

<div class="s1" style="left: 177px; top: 279px; width: 174px;">TELEFONO (Opcional)
</div>
<input name="FeTel" type="text" id="FeTel"
class="lt" style="left: 176px; top: 297px; width: 172px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeTel;?>" maxlength="25" />

<div class="s1" style="left: 362px; top: 279px; width: 173px;">
USUARIO PRINCIPAL
</div>
<input name="FeUsuPriNom" type="text" id="FeUsuPriNom"
class="lt" style="left: 362px; top: 297px; width: 131px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeUsuPriNom;?>" maxlength="50" />

<div class="s1" style="left: 504px; top: 279px; width: 107px;">
U.P. PASSWORD
</div>
<input name="FeUsuPriPas" type="text" id="FeUsuPriPas"
class="lt" style="left: 504px; top: 297px; width: 102px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeUsuPriPas;?>" maxlength="50" />


<div class="s1" style="left: 619px; top: 279px; width: 173px;">
USUARIO SECUNDARIO
</div>
<input name="FeUsuSecNom" type="text" id="FeUsuSecNom"
class="lt" style="left: 619px; top: 297px; width: 143px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeUsuSecNom;?>" maxlength="50" />


<div class="s1" style="left: 771px; top: 279px; width: 111px;">
U.S. PASSWORD
</div>
<input name="FeUsuSecPas" type="text" id="FeUsuSecPas"
class="lt" style="left: 771px; top: 297px; width: 102px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeUsuSecPas;?>" maxlength="50" />


<div class="s1" style="left: 884px; top: 279px; width: 175px;">
CERTIFICADO PASSWORD
</div>
<input name="FeCerPas" type="text" id="FeCerPas"
class="lt" style="left: 884px; top: 297px; width: 210px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeCerPas;?>" maxlength="50" />

<div class="s1" style="left:1108px; top: 279px; width: 111px;">
CERT.FEC.VCTO
</div>
<input name="FeCerFecVen" type="text" id="FeCerFecVen"
class="ltx fe" style="left: 1108px; top: 297px; width: 102px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $FeCerFecVen;?>" />


<div class="s1" style="left:35px; top:328px; width: 316px;">
ADJUNTAR CERTIFICADO (pfx)
</div>

<div class="s1" style="left:35px; top:345px; width: 571px;">
<input name="CerDig" type="file" id="CerDig"/>
</div>

<div class="s1" style="left:619px; top:328px; width: 316px;">
ADJUNTAR LOGO (jpg/png)
</div>

<div class="s1" style="left:619px; top:345px; width: 598px;">
<input name="Foto" type="file" id="Foto"/>
</div>





<!--INI_BOTONES-------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width:1000px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm" 
<?php GOM($StrId);?>
onclick="fGuardar();"  
tabindex="<?php echo ++$TI;?>"/>

<input name="CmdB" type="button" id="CmdC"  class="btm" 
value="Nuevo" onClick="fCancelar();"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdE" class="btm" 
value="Eliminar" onClick="fEliminar();"
<?php DIS($StrId);?>
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Menu" onClick="fBuscar('menu.php');"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!--FIN_BOTONES-------------------------------->


<div style="position: absolute; left: 35px; top: 376px; width: 1180px; height: 22px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr>
<td colspan="5"  align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>
</thead>
</table>
</div>

<div class="tableFixHead" style="position: absolute; left: 35px; top: 408px; width: 1180px; height: 600px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="23%">NOMBRE</th>
<th width="13%">RUC</th>
<th width="60%">NOMBRE CORTO</th>
<th width="4%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;

$s="SELECT id_emp,emp_noml,emp_nomc,emp_fe_ruc FROM empresas
	WHERE id_emp> 0 ORDER BY emp_noml";		

$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR); 	  				
$result = grs($s);
while ($r = $result->fetch_assoc()){
	$PX++;
	$CSS="";
	if($PX%2==0)$CSS=' style="background-color:#D4D4D4" ';
		?>
        <tr <?php echo $CSS;?> onDblClick="fActivar(<?php echo $r['id_emp'];?>);">
        <!----------------------------------------------->
        <td ><?php echo $r['emp_noml'];?></td>
        <td ><?php echo $r['emp_fe_ruc'];?></td>
        <td ><?php echo $r['emp_nomc'];?></td>
        <!----------------------------------------------->       
        <td>
        <a href="javascript:void(0)" onClick="fActivar(<?php echo $r['id_emp'];?>);">
        <img src="img/b_edit.png"  border="0"/></a>
        </td>    
        </tr>
		<?php
    }
    
?>  

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

<?php include("sis_ocultos.php");?>
 
</form>
</div>
</div>
</body>
</html>
