<?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(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
	JsDir("cerrar.php");	
	return;
}
//**
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//++
include("bitacora_bx.php");
?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>BITACORA - HISTORIAL</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="yyy/funcionexx.js"></script>
<!--FIN_SCRIPT------------------------------------->
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="tcal.css"  />
<link rel="stylesheet" type="text/css" href="basixx.css"  />
<script type="text/javascript" src="tcal.js"></script>
<style type="text/css">
.cF {height:700px;width:1300px;position:relative;top:0px}
</style>
<script>
$(document).ready(function(){  
   Inicializar();
   jF("Dex");
});
//
function ExportarXLS(){
	var dex=gv("Dex");
	var hax=gv("Hax");
	if(jL(dex)==0){
		return AF("Ingrese una fecha desde","Dex");
	}
	if(jL(hax)==0){
		return AF("Ingrese una fecha hasta","Hax");
	}
	var d=hax.split("-");
	var h=dex.split("-");
	//
	var a = moment([jVal(d[2])+2000, jVal(d[1])-1, jVal(d[0])]);
	var b = moment([jVal(h[2])+2000, jVal(h[1])-1, jVal(h[0])]);
	var d=a.diff(b, 'days');
	if(d>=0 && d<=62){
		SM("EXPORTAR_XSL");
	}else{
		return AF("El rango maximo permitido es 62 dias (2 meses)","Hax");
	}
	
}
</script>
</head>

<body  <?php echo $LStrMsg;?>  >
<div align="center">

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="bitacora.php">
<!--INI_TITULO-->
<div id="DivT" class="dT" style="width:1300px" >
<img src="img/buscar.png" width="56" height="52" class="iT" />
<div class="tT">BITACORA - HISTORIAL</div>
</div>
<!--FIN_TITULO-->
<div class="s1" style="left: 116px; top: 41px; width: 140px; height: 16px; color:#FFF">
USUARIO: </div>
<div class="s1" style="left:35px; top: 117px; width: 61px; height: 18px;">
DESDE</div>
<input name="Dex"  type="text" 
class="fe tcal"  id="Dex" style="left:35px; top:134px; width:102px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Dex;?>"  />

<div class="s1" style="left:145px; top: 117px; width: 72px; height: 18px;">
HASTA</div>
<input name="Hax"  type="text" 
class="fe tcal"  id="Hax" style="left:143px; top:134px; width:112px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Hax;?>"  />

<div class="s1" style="left:265px; top: 117px; width: 107px; height: 18px;"> USUARIO
</div>
<input name="Usu" type="text" id="Usu" 
class="lt"  style="left:264px; top: 134px; width: 145px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Usu;?>" />

<div class="s1" style="left:418px; top: 117px; width: 107px; height: 18px;">
MENU</div>
<input name="Mnu" type="text" id="Mnu" 
class="lt"  style="left:418px; top: 134px; width: 145px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Mnu;?>" />

<div class="s1" style="left:571px; top: 117px; width: 107px; height: 18px;">
MODULO</div>
<input name="Mod" type="text" id="Mod" 
class="lt"  style="left:571px; top: 134px; width: 238px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Mod;?>" />

<div class="s1" style="left:817px; top: 117px; width: 107px; height: 18px;"> ACCION
</div>
<input name="Acc" type="text" id="Acc" 
class="lt"  style="left:817px; top: 134px; width: 177px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Acc;?>" />


<div class="s1" style="left:1005px; top: 117px; width: 107px; height: 18px;"> MOD_ID (Numero)
</div>
<input name="ModId" type="text" id="ModId" 
class="lt"  style="left:1005px; top: 134px; width: 143px;"
tabindex="<?php echo ++$TI;?>"
value="<?php echo $ModId;?>" />



<!--INI_BOTONES----->
<?php 
	$VOLVER="menu.php";
	$BTN_EXP=0;
?>
<?php 
	include("botones_b.php");
?>;
<!--FIN_BOTONES-->
<!--INI_TABLA----->
<div class="datagrid"  id="Exportar_a_Excel"
style="position:absolute; left: 35px; top: 166px; width: 1235px; height: 486px; overflow:auto">
<table width="75%">
<thead>
<tr>
<td colspan="15" height="18" align="center">
<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>
<tr>
<th width="5%">FECHA</th>
<th width="7%">HORA</th>
<th width="10%">USUARIO</th>
<th width="18%">MENU</th>
<th width="29%">MODULO</th>
<th width="5%">MOD_ID</th>
<th width="24%">ACCION</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$s="SELECT * FROM vis_bitacora WHERE ".$FF." ORDER BY ID DESC";
$CX=0;
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);	
$rs = grs($s);
while ($r = $rs->fetch_assoc()){
	$CX++;
	$CSS=' style="background-color:#EAEAEA" ';
	if($CX%2==0)$CSS="";
?>
	<tr <?php echo $CSS;?> >
	<!----------------------------------------------->
    <td>'<?php echo $r['FEC_'];?></td>   
    <td><?php echo $r['HOR'];?></td>   
	<td><?php echo $r['USU'];?></td>   
    <td><?php echo $r['MNU'];?></td>
    <td><?php echo $r['MOD_PHP'];?></td>
    <td><?php echo $r['MOD_ID'];?></td>
    <td><?php echo $r['ACC'];?></td>
	<!----------------------------------------------->
	<td bgcolor="#FFFFFF" align="center">
	</td>
	</tr>
<?php
}
?>
</tbody>
</table>
</div>
<div class="s1" style="left:36px; top:671px; width: 605px; height: 18px;">
</div>
<!--FIN_TABLA----->
<?php include("ocultos.php");?>
</form>

<form action="ficheroExcel.php" 
method="post" target="_blank" 
id="FormularioExportacion" >
</form>

</div>
</div>
</body>
</html>
