<?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;
}
//--------------------------------------------------------------------------
$UZU=vbval(V($_SESSION['SYS_USER_ID']));
include("sis_fec_ven_fun.php");
//--------------------------------------------------------------------------
$VP_RegXPag=20;
$LStrTR=gn("count(*)","vis_fechas_plazos","ID>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>

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

<script type="text/javascript" src="js/sis_funcionez.js"></script>
<script type="text/javascript" src="js/sis_fec_ven.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:600px;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_fec_ven.php" autocomplete="off">

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

<?php if(strlen($Fer)==0)$Fer=date("d-m-y");?>
<div class="s1" style="left: 35px; top: 126px; width: 127px;">
FECHA REGISTRO</div>
<input name="Fer" type="text" id="Fer"
class="roi" style="left: 35px; top: 146px; width: 119px;"  
value="<?php echo $Fer;?>"  
tabindex="<?php echo ++$TI;?>" />

<?php if(strlen($Fin)==0)$Fin=date("d-m-y");?>
<div class="s1" style="left: 165px; top: 126px; width: 127px;">
FECHA INICIO</div>
<input name="Fin" type="text" id="Fin"
class="fe" style="left: 165px; top: 146px; width: 119px;"  
value="<?php echo $Fin;?>"  
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 298px; top: 110px; width: 239px;"> DIAS DE PLAZO PARA
</div>

<div class="s1" style="left: 298px; top: 129px; width: 75px;">
COBROS</div>
<input name="Cob" type="text" id="Cob" 
class="nei" style="left: 298px; top: 146px; width: 98px; ; text-align: right" 
value="<?php echo $Cob;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 409px; top: 129px; width: 125px;">
SALIDA / DESPACHO</div>
<input name="Sal" type="text" id="Sal" 
class="nei" style="left: 409px; top: 146px; width: 126px; ; text-align: right" 
value="<?php echo $Sal;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 549px; top: 129px; width: 125px;"> OBSERVACION
</div>
<input name="Obs" type="text" id="Obs" 
class="lt" style="left: 549px; top: 146px; width: 663px; ; text-align: right" 
value="<?php echo $Obs;?>"  
tabindex="<?php echo ++$TI;?>"/>


<!--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: 179px; 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: 204px; width: 1180px; height: 366px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="9%">F.REGISTRO</th>
<th width="17%">FECHA INICIO</th>
<th width="7%">COBROS</th>
<th width="6%">SALIDA</th>
<th width="58%">OBSERVACION</th>
<th width="3%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;

$s="SELECT * FROM vis_fechas_plazos WHERE ID>0 ORDER BY ID DESC";	
$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 <?php echo $CSS;?> onDblClick="fActivar(<?php echo $r['ID'];?>);">
	<!----------------------------------------------->
	<td ><?php echo $r['FER_'];?></td>
	<td ><?php echo $r['FIN_'];?></td>
	<td ><?php echo $r['COB'];?></td>
	<td ><?php echo $r['SAL'];?></td>
	<td ><?php echo $r['OBS'];?></td>
	<!----------------------------------------------->       
	<td>
	<a href="javascript:void(0)" onClick="fActivar(<?php echo $r[0];?>);">
	<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>
