<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
include("phpmnu_fun.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//+++
$HW=V($_SESSION['SYS_HW']);
$IdUsu=vbval(V($_SESSION['SYS_USER_ID']));
//6+++
$StrGT="";
$SYS_MSG="";
$SYS_FOC="";
$OK=1;
//
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$LStrPag=V($_POST['TxtPag']);
//
include("ges_proveedores_fun.php");
//
$VP_RegXPag=100;
$LStrTR=gn("count(*)","ges_proveedores","id_prv>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Proveedores</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/ges_proveedores.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />

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

.tableFixHead          { overflow-y: auto; overflow:auto; border:solid 1px #363636;position: absolute; }
.tableFixHead thead th { position: sticky; top: 0; }
table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#A0A0A0}
</style>
<script>
$(document).ready(function(){  
   Inicializar();
   //
   SYS_LOAD();
});
</script>
</head>

<body >
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
echo GEN_MENU($IdUsu);
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" autocomplete="off"
action="ges_proveedores.php" enctype="multipart/form-data" 
style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="png/ges_prove.png"  class="iT" />
<div class="tT">PROVEEDORES</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left:35px; top: 115px; width: 103px;">
NOMBRE CORTO</div>
<input name="Nom"  type="text" id="Nom"
class="lt" style="left: 35px; top: 135px; width: 121px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Nom;?>"/>


<div class="s1" style="left:167px; top: 115px; width: 315px;">
NOMBRE COMPLETO ( Usado para generar el invoice)</div>
<input name="Now"  type="text" id="Now"
class="lt" style="left:166px; top: 135px; width: 318px"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Now;?>"/>


<div class="s1" style="left:497px; top: 115px; width: 172px;">
DIRECCION</div>
<input name="Dir"  type="text" id="Dir"
class="lt" style="left: 496px; top: 135px; width: 323px"
tabindex="<?php echo ++$TI;?>" maxlength="500"
value="<?php echo $Dir;?>"/>

<div class="s1" style="left:831px; top: 115px; width: 143px;">
TELEFONO</div>
<input name="Tel"  type="text" id="Tel"
class="lt" style="left:831px; top: 135px; width: 121px"
tabindex="<?php echo ++$TI;?>" maxlength="40"
value="<?php echo $Tel;?>"/>


<div class="s1" style="left:965px; top: 115px; width: 87px;">
FAX</div>
<input name="Fax"  type="text" id="Fax"
class="lt" style="left:964px; top: 135px; width: 103px"
tabindex="<?php echo ++$TI;?>" maxlength="40"
value="<?php echo $Fax;?>"/>

<div class="s1" style="left:1079px; top: 115px; width: 101px;">
EMAIL</div>
<input name="Ema"  type="text" id="Ema"
class="lt" style="left:1076px; top: 135px; width: 136px"
tabindex="<?php echo ++$TI;?>" maxlength="70"
value="<?php echo $Ema;?>"/>

<div class="s1" style="left:35px; top: 164px; width: 180px;">
EXPORT AGENT</div>
<input name="ExpAge"  type="text" id="ExpAge"
class="lt" style="left:35px; top: 183px; width: 179px"
tabindex="<?php echo ++$TI;?>" maxlength="500"
value="<?php echo $ExpAge;?>"/>


<div class="s1" style="left:227px; top: 164px; width: 180px;">
EXPORT AGENT ACCOUNT</div>
<input name="Age"  type="text" id="Age"
class="lt" style="left:225px; top: 183px; width: 265px"
tabindex="<?php echo ++$TI;?>" maxlength="500"
value="<?php echo $Age;?>"/>

<div class="s1" style="left:496px; top: 164px; width: 126px;">
THE BANCK</div>
<input name="Ban"  type="text" id="Ban"
class="lt" style="left:496px; top: 183px; width: 171px"
tabindex="<?php echo ++$TI;?>" maxlength="150"
value="<?php echo $Ban;?>"/>

<div class="s1" style="left:674px; top: 164px; width: 135px;">
ADDRESS (BANCK)</div>
<input name="BanDir"  type="text" id="BanDir"
class="lt" style="left:676px; top: 183px; width: 174px"
tabindex="<?php echo ++$TI;?>" maxlength="500"
value="<?php echo $BanDir;?>"/>


<div class="s1" style="left:861px; top: 164px; width: 104px;">
SWIFT CODE</div>
<input name="Swi"  type="text" id="Swi"
class="lt" style="left:861px; top: 183px; width: 107px"
tabindex="<?php echo ++$TI;?>" maxlength="100"
value="<?php echo $Swi;?>"/>


<div class="s1" style="left:980px; top: 164px; width: 103px;">
<b>INVOICE</b> / SERIE</div>
<input name="Ser"  type="text" id="Ser"
class="lt" style="left:980px; top: 183px; width: 102px"
tabindex="<?php echo ++$TI;?>" maxlength="100"
value="<?php echo $Ser;?>"/>

<div class="s1" style="left:1091px; top: 164px; width: 125px;">
<b>INVOICE</b> / Numero *</div>
<input name="Num"  type="text" id="Num"
class="nei" style="left:1091px; top: 183px; width: 120px"
tabindex="<?php echo ++$TI;?>" maxlength="100"
value="<?php echo $Num;?>"/>


<!--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;?>" />
</div>
<!--FIN_BOTONES-------------------------------->
<div  style="position: absolute; left:35px; top: 215px; ; width: 1175px;height: ">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px">
<thead>
<tr>
<td colspan="10" height="18" align="center">
<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>
</thead>
</table>
</div>

<div class="tableFixHead" style="left:35px; top: 253px; width: 1175px; height: 311px;">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px" >
<thead>
<tr>
<th width="11%" align="left">NOMBRE </th>
<th width="21%" align="left">NOMBRE COMPLETO</th>
<th width="13%" align="left">TELEFONO</th>
<th width="37%" align="left">EXPORT AGENT ACCOUNT</th>
<th width="7%" align="left">SERIE</th>
<th width="9%" align="left">NUMERO</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;
$s="SELECT * FROM ges_proveedores WHERE id_prv>0 ORDER BY prv_nom ";	
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);
$rs=grs($s);
while($r=$rs->fetch_assoc()){	
$PX++;
$CSS="";
if($PX%2==0)$CSS=' style="background-color:#D4D4D4" ';
?>
<tr onDblClick="fAc(<?php echo $r['id_prv'];?>);" <?php echo $CSS;?>>
<!----------------------------------------------->
<td><?php echo $r['prv_nom'];?></td>
<td><?php echo $r['pro_now'];?></td>
<td><?php echo $r['prv_tel'];?></td>
<td><?php echo $r['prv_age'];?></td>
<td><?php echo $r['prv_serie'];?></td>
<td><?php echo $r['prv_nro'];?></td>
<!----------------------------------------------->
<td align="center">
<a href="javascript:void(0)" onClick="fAc(<?php echo $r['id_prv'];?>);">
<img src="img/b_edit.png"  border="0"/></a></td>
</tr>
<?php
}
?>		  

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

<div class="s1" style="left:36px; top: 574px; width: 1063px;"> Numero * : Ultimo numero emitido</div>
<!--INI_OCULTOS-------------------------------->
<?php
include("ocultos.php");
?>
<!--INI_OCULTOS-------------------------------->
<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>" />
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>" />
</form>
</div>
</div>
</body>
</html>
