correciones en tiempo de session

This commit is contained in:
humano 2020-03-17 11:01:12 -05:00
parent 4cad68cc3a
commit 6c47a5da23
3 changed files with 24 additions and 24 deletions

View File

@ -1,5 +1,6 @@
<?php
function Conectarse(){
session_start();
if ( !isset ( $link ) ) {
@include("includes/datos.php");

View File

@ -211,7 +211,7 @@ legend.legend-area {
</style>
</head>
<body onload="revisarSession()"; >
<body >
<?php if($embebido ==1) {
if($form!=''){ echo formulario_embebido($form,$opciones);}
elseif($identificador !='') { echo mostrar_identificador($identificador,$id);}
@ -256,13 +256,14 @@ else{}
<div class='row'>
<div id='' class='col-sm-6'>
<?php if(isset($_SESSION['id'])){ echo "
<form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'>
<?php /* $sesion = "<pre>".print_r($_SESSION,true)."</pre>"; if(isset($_SESSION['id'])){ echo "
$sesion <form id='manejo_sesion' name='form_session' class='navbar-form navbar-left'>
<div class='input-group'>
<input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly>
<span class='input-group-addon'><a href='#' onclick=\"location.reload();\" title='Renovar'><span class='glyphicon glyphicon-refresh' aria-hidden='true'></span></a></span>
</div>
</form> "; } ?>
</form> "; }else{ echo "/ $sesion /<input type='text' name='tiempo_session' size='18' class='form-control input-sm' readonly>";}
*/ ?>
<?php
///echo adjuntar_basico('33');

View File

@ -10,23 +10,24 @@ function delayTimer() {
function revisarSession(){
function revisarSession(sesion){
tiempo = "30";
gavela="19";
timestamp = Math.round(Date.now() /1000)
inicio = leerCookie("timestamp");
inicio = sesion;//leerCookie("timestamp");
transcurrido = (timestamp - inicio);
transcurrido_minutos = Math.round(transcurrido/60);
restante = (tiempo - transcurrido_minutos);
prefin = (tiempo*60)-transcurrido;
//sesion = "hola";
document.form_session.tiempo_session.value = "Cierra en: "+restante+" minutos ";
document.form_session.tiempo_session.value = "Cierra en: "+restante+" minutos ("+transcurrido+" "+sesion+") ";
if(restante == 1 ){
//alert(transcurrido);
location.href="../../salir.php";
}else{
setTimeout("revisarSession()",2000) ;
setTimeout("revisarSession("+sesion+")",2000) ;
}
}
@ -622,6 +623,3 @@ else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
}