From adfa8fd8e969a6f48ec7e8854147e419f09d616a Mon Sep 17 00:00:00 2001 From: humano Date: Mon, 9 Jul 2018 14:27:51 -0500 Subject: [PATCH 1/9] correcion bug en grabar formulario --- funciones/funciones.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index b15ba67..7e9c89c 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -15844,7 +15844,7 @@ function formulario_grabar($formulario,$accion) { $Formulario_original = $formulario; $formulario = json_decode($formulario,true); //$formulario = print_r($formulario,true); - $respuesta->addAssign("resultado_triage","innerHTML","hOLA $formulario_original" ); + //$respuesta->addAssign("resultado_triage","innerHTML","hOLA $formulario_original" ); //return $respuesta; } From 7ecd0a2341ec0d65bfb7db466e160cfb1d9fda7a Mon Sep 17 00:00:00 2001 From: humano Date: Mon, 9 Jul 2018 14:33:00 -0500 Subject: [PATCH 2/9] correcion bug en grabar formulario --- funciones/funciones.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 7e9c89c..402b26b 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -15838,9 +15838,9 @@ return $existe; function formulario_grabar($formulario,$accion) { $formulario_original = $formulario; - + $respuesta = new xajaxResponse('utf-8'); if($accion == "api"){ - $respuesta = new xajaxResponse('utf-8'); + $Formulario_original = $formulario; $formulario = json_decode($formulario,true); //$formulario = print_r($formulario,true); @@ -15849,7 +15849,7 @@ function formulario_grabar($formulario,$accion) { } $debug=""; - $respuesta = new xajaxResponse('utf-8'); + //$respuesta = new xajaxResponse('utf-8'); $datos=""; $envio=""; From 94fd2e61512993538d8cde918a792006ebb50815 Mon Sep 17 00:00:00 2001 From: humano Date: Mon, 9 Jul 2018 19:48:46 -0500 Subject: [PATCH 3/9] dummy --- funciones/funciones.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 402b26b..6b1af45 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -149,7 +149,7 @@ if (is_array($v) ){ } - else{ //busca campos vacios + else{ //busca campos vacios $campo_obligatorio = remplacetas("form_contenido_campos","id_campo",$c,"obligatorio","id_form = '$formulario[form_id]'"); if($campo_obligatorio[0] =='1'){ $error ='obligatorio'; From de1d49190aebb6086a94f98ccc5fcef9654846b2 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 12 Jul 2018 14:18:34 -0500 Subject: [PATCH 4/9] revision funciones --- funciones/funciones.php | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 6b1af45..bb946b6 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -33,10 +33,9 @@ $tipo_formulario = $formulario['tipo']; // - - - $metadatos = json_decode($formulario['metadatos']); - + if(isset($formulario['metadatos'])){ + $metadatos = json_decode($formulario['metadatos']); + }else{ $metadadatos="";} $consulta_form = "SELECT * FROM form_contenido_campos,form_campos WHERE form_contenido_campos.id_campo = form_campos.id @@ -15550,7 +15549,7 @@ $render = " $valores_rango = explode(";",$campos[0]); $min= $valores_rango[0]; $max= $valores_rango[1]; - $pasos= $valores_rango[2]; + $pasos= @$valores_rango[2]; $aviso_rango=""; $aviso_pasos=""; if( $rango[0] !=""){ @@ -15859,7 +15858,11 @@ function formulario_grabar($formulario,$accion) { $control = $formulario['control']; // $form_id = $formulario['form_id']; // $tipo = $formulario['tipo']; // - $metadatos = json_decode($formulario['metadatos']); + + if(isset($formulario['metadatos'])){ + $metadatos = json_decode($formulario['metadatos']); + }else{ $metadadatos="";} +// $metadatos = json_decode($formulario['metadatos']); $campo_consecutivo = buscar_campo_tipo($formulario["form_id"],"33"); if($formulario["tipo"] !="edit"){ if($campo_consecutivo[0] != ""){ @@ -16105,7 +16108,7 @@ if($consulta_grabada =='1') { $z= $metadatos[3][1]; $autor= $metadatos[4][1]; - if($formulario['clase'] !=""){ + if(isset($formulario['clase']) and $formulario['clase'] !=""){ parametrizacion_linea('form_id',"$formulario[form_id]",'clase',"$formulario[clase]",'mensaje_$control','',"$formulario[control]"); //parametrizacion_linea('form_id','$id','clase','green','mensaje_$row[control]','','$row[control]'); @@ -16241,7 +16244,7 @@ Esta herramienta es creada y proporcionada por Tupale.co, como portal para el ac //$exito .= "$email[0] $headers "; } /// } - if($formulario['tipo_form'] =='mini'){ + if(isset($formulario['tipo_form'] ) AND $formulario['tipo_form'] =='mini'){ $respuesta -> addScript("xajax_limpia_div('nueva_nota_$formulario[control]')"); $respuesta->addScript("make_draggable($('.note'));"); From 6b0df813c15f6cf437e854afb73d47a04f645ab4 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 12 Jul 2018 14:52:01 -0500 Subject: [PATCH 5/9] revision funciones --- funciones/funciones.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index de69dc7..9631681 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -15861,7 +15861,7 @@ function formulario_grabar($formulario,$accion) { if(isset($formulario['metadatos'])){ $metadatos = json_decode($formulario['metadatos']); - }else{ $metadadatos="";} + }else{ $metadatos="";} // $metadatos = json_decode($formulario['metadatos']); $campo_consecutivo = buscar_campo_tipo($formulario["form_id"],"33"); if($formulario["tipo"] !="edit"){ @@ -16103,20 +16103,24 @@ $json_datos[] = array($c, array("nombre_campo",$campo_nombre[0]), array("conteni if($consulta_grabada =='1') { - $x= $metadatos[1][1]; - $y= $metadatos[2][1]; - $z= $metadatos[3][1]; - $autor= $metadatos[4][1]; + if(isset($formulario['clase']) and $formulario['clase'] !=""){ parametrizacion_linea('form_id',"$formulario[form_id]",'clase',"$formulario[clase]",'mensaje_$control','',"$formulario[control]"); //parametrizacion_linea('form_id','$id','clase','green','mensaje_$row[control]','','$row[control]'); } - + + if( is_array($metadatos) ){ + $x= $metadatos[1][1]; + $y= $metadatos[2][1]; + $z= $metadatos[3][1]; + $autor= $metadatos[4][1]; + $posicion = parametrizacion_linea('form_id',"$formulario[form_id]",'posicion',"$x-$y-$z",'mensaje_$control','',"$formulario[control]"); $metadatos_iniciales = parametrizacion_linea('form_id',"$formulario[form_id]",'metadatos_iniciales',"$x-$y-$z-$autor",'mensaje_$control','',"$formulario[control]"); $autor = parametrizacion_linea('form_id',"$formulario[form_id]",'autor',"$autor",'mensaje_$control','',"$formulario[control]"); +} if(@$formulario['continuar']=='1') { // xajax_formulario_embebido_ajax($form[0],'$identificador','edit') From 90d1a4c38fc5f55eef35487fb46984de1c4ab158 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 12 Jul 2018 18:37:02 -0500 Subject: [PATCH 6/9] solucion parcial bug de cerrar session --- funciones/conex.php | 11 +++++++++-- js/scripts.js | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 2 deletions(-) diff --git a/funciones/conex.php b/funciones/conex.php index 9790660..fcbe03b 100644 --- a/funciones/conex.php +++ b/funciones/conex.php @@ -22,12 +22,16 @@ function Conectarse(){ exit(); } */ + $timestamp =time(); $_SESSION['path']= $path_instalacion; $_SESSION['path_images_secure']= $path_images_secure; $_SESSION['url']= $url; $_SESSION['site']= $site; $_SESSION['analizador']= "$codigo_analizador"; $_SESSION['upload_size']= $upload_size; + + $_SESSION['timestamp']= $timestamp; + return $link; } } @@ -54,13 +58,16 @@ function Conectarse_recursivo(){ exit(); } */ + $timestamp =time(); + $_SESSION['path']= $path_instalacion; $_SESSION['path_images_secure']= $path_images_secure; $_SESSION['url']= $url; $_SESSION['site']= $site; $_SESSION['analizador']= "$codigo_analizador"; - $_SESSION['upload_size']= $upload_size; + $_SESSION['timestamp']= $timestamp; + setcookie("timestamp",$timestamp); return $link; } } -?> \ No newline at end of file +?> diff --git a/js/scripts.js b/js/scripts.js index f40910c..ac9f828 100644 --- a/js/scripts.js +++ b/js/scripts.js @@ -1,3 +1,36 @@ + function revisarSession(){ + tiempo = "30"; + gavela="19"; + timestamp = Math.round(Date.now() /1000) + inicio = leerCookie("timestamp"); + transcurrido = (timestamp - inicio); + transcurrido_minutos = Math.round(transcurrido/60); + restante = (tiempo - transcurrido_minutos) + prefin = (tiempo*60)-transcurrido + + document.form_session.tiempo_session.value = "Cerrar en: "+restante+" minutos "; + + if(restante == 1 ){ + //alert(transcurrido); + location.href="./includes/salir.php"; +}else{ + setTimeout("revisarSession()",2000) ; +} +} + + +function leerCookie(nombre) { + var lista = document.cookie.split(";"); + for (i in lista) { + var busca = lista[i].search(nombre); + if (busca > -1) {micookie=lista[i]} + } + var igual = micookie.indexOf("="); + var valor = micookie.substring(igual+1); + return valor; + } + + function loadArticle(pageNumber,id,plantilla,registros,scroll) { var newDiv = document.createElement('div'); From 9b4469db38364bce89077e506f13c38072147472 Mon Sep 17 00:00:00 2001 From: humano Date: Thu, 12 Jul 2018 19:09:23 -0500 Subject: [PATCH 7/9] exportacion --- funciones/funciones.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 9631681..fb185e0 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -5869,7 +5869,7 @@ $contenido $edicion ="
Editar
"; }else {$edicion="";} } - $documento=""; + $documento=""; if($plantilla_original=="svg") { return $impresion;}else{ if($tipo=="listado") { @@ -6846,7 +6846,7 @@ $boton_borrar = " "; if($formato!='csv'){ - $boton_exportar = " Exportar ";} + $boton_exportar = "";} $link = ""; // $page = $_GET['page']; @@ -13605,9 +13605,9 @@ if (mysqli_num_rows($sql)!=0){ if (mysqli_num_rows($sql)!='0'){ $botones .= "Limpiar "; if($formato!='csv'){ - $botones .= " + $botones .= " "; } $paginacion ="
    "; $total_paginas = ceil($total_registros / $registros); From 0ce02a9d9811a40653bbaad9bac08f00cf915d11 Mon Sep 17 00:00:00 2001 From: humano Date: Fri, 13 Jul 2018 22:42:09 -0500 Subject: [PATCH 8/9] escapado enter --- funciones/funciones.php | 21 ++++++++++++++------- xajax/xajax.inc.php | 2 +- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index fb185e0..173f4b7 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -8,17 +8,18 @@ date_default_timezone_set('America/Bogota'); function formulario_validar($formulario,$accion,$tipo) { - $formulario_original = $formulario; + //$formulario_original = $formulario; +// $formulario = mysql_seguridad($formulario); $error ='0'; if($accion == "api"){ $respuesta = new xajaxResponse('utf-8'); - $Formulario_original = $formulario; + $formulario_original = $formulario; $formulario = json_decode($formulario,true); //$formulario = print_r($formulario,true); //$respuesta->addAssign("resultado_triage","innerHTML","hOLA $formulario_original" ); //return $respuesta; - + } $debug=""; @@ -40,6 +41,8 @@ $tipo_formulario = $formulario['tipo']; // $consulta_form = "SELECT * FROM form_contenido_campos,form_campos WHERE form_contenido_campos.id_campo = form_campos.id AND id_form = '$form_id' "; + + $link=Conectarse(); mysqli_set_charset($link, "utf8"); @@ -49,8 +52,10 @@ $tipo_formulario = $formulario['tipo']; // } if(isset ( $_SESSION['equipo'])){$equipo = $_SESSION['equipo']; }else { $equipo = NULL;} - - + + //$respuesta->addAssign("resultado_triage","innerHTML","hOLA $formulario_original ".time()."" ); + //return $respuesta; + foreach($formulario as $c=>$v){ @@ -151,6 +156,7 @@ if (is_array($v) ){ else{ //busca campos vacios $campo_obligatorio = remplacetas("form_contenido_campos","id_campo",$c,"obligatorio","id_form = '$formulario[form_id]'"); if($campo_obligatorio[0] =='1'){ + $error ='obligatorio'; $respuesta->addAssign("input_".$c."[".$C."]","className"," form-group has-error "); $respuesta->addAlert("ATENCION: El campo $campo_nombre[0] es obligatorio"); @@ -15840,7 +15846,7 @@ function formulario_grabar($formulario,$accion) { $respuesta = new xajaxResponse('utf-8'); if($accion == "api"){ - $Formulario_original = $formulario; + $formulario_original = $formulario; $formulario = json_decode($formulario,true); //$formulario = print_r($formulario,true); //$respuesta->addAssign("resultado_triage","innerHTML","hOLA $formulario_original" ); @@ -16069,7 +16075,7 @@ if(@$campo_tipo[0] =="18") { } -else{$V=$V;} +else{$V=mysqli_real_escape_string($link,$V);} $consulta =" @@ -16257,6 +16263,7 @@ Esta herramienta es creada y proporcionada por Tupale.co, como portal para el ac } $respuesta->addAssign("div_$control","innerHTML","$exito "); + //$respuesta->addAlert("La informacion se grabó correctamente"); return $respuesta; }else{ diff --git a/xajax/xajax.inc.php b/xajax/xajax.inc.php index e0c312a..1e56b64 100644 --- a/xajax/xajax.inc.php +++ b/xajax/xajax.inc.php @@ -89,7 +89,7 @@ class xajax $this->sRequestURI = $this->_detectURI(); $this->sWrapperPrefix = $sWrapperPrefix; $this->setCharEncoding($sEncoding); - $this->bDebug = $bDebug; + $this->bDebug =$bDebug; $this->bWaitCursor = true; $this->bExitAllowed = true; $this->bErrorHandler = false; From eb974d96deda1a495f7d5b1050e0b89d46013988 Mon Sep 17 00:00:00 2001 From: humano Date: Mon, 16 Jul 2018 10:28:56 -0500 Subject: [PATCH 9/9] correccion estilos --- funciones/funciones.php | 2 +- index.php | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/funciones/funciones.php b/funciones/funciones.php index 173f4b7..812409a 100644 --- a/funciones/funciones.php +++ b/funciones/funciones.php @@ -15545,7 +15545,7 @@ elseif($campo_tipo_accion == 'email'){$render = " $render = " - + "; $cols='12'; } diff --git a/index.php b/index.php index 1944346..79d75e7 100644 --- a/index.php +++ b/index.php @@ -46,7 +46,11 @@ if (isset($_REQUEST['t'])) {$t = $_REQUEST['t'];} else {$t = "";} - ";}else{ echo "";} ?> + "; + }else{ + //echo ""; + } ?>