From f67e09b75f14d1c64dd1386e1819ed07cbcfa022 Mon Sep 17 00:00:00 2001 From: humano Date: Wed, 22 Oct 2014 19:26:28 -0500 Subject: [PATCH] Muchas mejoras y nuevas prestaciones :) --- milfs/c3p.php | 103 ++++++++++++ milfs/funciones/funciones.php | 286 +++++++++++++++++++++++--------- milfs/images/100x100.png | Bin 0 -> 177 bytes milfs/images/200x200.png | Bin 0 -> 292 bytes milfs/images/transparente40.png | Bin 0 -> 280 bytes milfs/images/transparente50.png | Bin 0 -> 279 bytes milfs/json.lab.php | 114 +++++++++++++ milfs/map.php | 8 +- milfs/mapa.php | 35 +++- milfs/rt.php | 156 +++++++++++++++++ 10 files changed, 622 insertions(+), 80 deletions(-) create mode 100644 milfs/c3p.php create mode 100755 milfs/images/100x100.png create mode 100755 milfs/images/200x200.png create mode 100644 milfs/images/transparente40.png create mode 100644 milfs/images/transparente50.png create mode 100755 milfs/json.lab.php create mode 100644 milfs/rt.php diff --git a/milfs/c3p.php b/milfs/c3p.php new file mode 100644 index 0000000..df1edf2 --- /dev/null +++ b/milfs/c3p.php @@ -0,0 +1,103 @@ +processRequests(); + +?> + + + + + + + + + + printJavascript("xajax/"); ?> + + + + + + + + + + + + + + + + + + +
+ + + +
+
+ +
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/milfs/funciones/funciones.php b/milfs/funciones/funciones.php index 1d0656a..96a9904 100644 --- a/milfs/funciones/funciones.php +++ b/milfs/funciones/funciones.php @@ -146,19 +146,77 @@ return $respuesta; } $xajax->registerFunction("formulario_parametrizacion"); +function lista_categorias($perfil,$categoria,$tipo) { +$link=Conectarse(); +mysql_query("SET NAMES 'utf8'"); + $categoria_campo = remplacetas('parametrizacion','campo',$perfil,'descripcion'," tabla='form_id' and opcion = 'categoria:campo'") ; + $categoria_campo = $categoria_campo[0]; +$consulta = " + SELECT md5(binary contenido) as md5_contenido, contenido FROM form_datos + WHERE form_id = '$perfil' + AND id_campo = '$categoria_campo' + GROUP BY contenido + ORDER BY contenido asc"; +/* + $consulta = " + SELECT opcion, GROUP_CONCAT(descripcion ORDER by id desc ) as data FROM `parametrizacion` WHERE `tabla` LIKE 'form_id' AND `campo` LIKE '$perfil' AND `opcion` LIKE 'categoria:icon:%%' group by descripcion + "; + */ + /* + $categoria_filtro = remplacetas('parametrizacion','campo',$id,'descripcion',"tabla='form_id' and opcion = 'categoria:filtro:$row[id_campo]'") ; + $filtro = $categoria_filtro; + $categoria_filtro = $categoria_filtro[0]; + $icono = remplacetas('parametrizacion','campo',$id,'descripcion'," tabla='form_id' and opcion = 'categoria:icon:$md5_contenido'") ; + if($icono[0] =='') { + $icon = "http://$_SERVER[HTTP_HOST]/milfs/images/pin.png "; + }else{ + + $icon = $icono[0]; + } + $icono = "$icon"; + */ +$sql=mysql_query($consulta,$link); +if (mysql_num_rows($sql)!='0'){ +$resultado = ""; + } +else{$resultado = 'nada';} -function imprime_geojson($id){ - $id_form = mysql_seguridad($id); - $campo = buscar_campo_tipo($id_form,"14"); +return $resultado; +} + +function imprime_geojson($id,$id2){ + $id_form = mysql_seguridad($id); + $id_form2 = mysql_seguridad($id2); + $campo = buscar_campo_tipo($id_form,"14"); + $campo2 = buscar_campo_tipo($id_form2,"14"); $id_campo = $campo[0]; + $id_campo2 = $campo2[0]; + if($id_form2 !=""){$w_id2 =" OR form_id = '$id_form2'"; $or_2 ="or id_campo = '$id_campo2'";} $link=Conectarse(); $consulta = "SELECT form_id as id, control, GROUP_CONCAT(contenido ORDER by timestamp desc ) as data FROM `form_datos` - WHERE form_id = '$id_form' - AND id_campo ='$id_campo' $valor + WHERE (form_id = '$id_form' $w_id2 ) + AND ( id_campo ='$id_campo' $or_2 ) group by control ORDER BY orden desc"; @@ -178,18 +236,18 @@ while( $row = mysql_fetch_array( $sql ) ) { $lat = $campos[0]; $lon = $campos[1]; $zoom = $campos[2]; - $formulario = formulario_imprimir($id_form,$row[control],'obligatorio'); + $formulario = formulario_imprimir($row[id],$row[control],'full'); $marcador["type"] = "Point"; $marcador["coordinates"] = array($lat,$lon); - $propiedades = formulario_imprimir_linea($id_form,$row[control],"array");// + $propiedades = formulario_imprimir_linea($row[id],$row[control],"array");// //$propiedades[description] ="HOLA MUNDO"; $propiedades[description] ="
$formulario
"; $propiedades[sounds] =""; $propiedades[url] =''; //$propiedades[title] ='Hola mundo'; //$propiedades[icon][iconUrl] = "images/pin.png"; - $geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK|JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE)."},"; + $geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK|JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP | JSON_UNESCAPED_UNICODE|JSON_PRETTY_PRINT)."},"; $features[] = $marcador; $id++; @@ -203,7 +261,7 @@ header('Content-Type: text/plain'); //echo $consulta; $resultado = " { \"type\": \"FeatureCollection\", \"features\": "; -$resultado .= json_encode($features,JSON_NUMERIC_CHECK); +$resultado .= json_encode($features,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT); $resultado .= "}"; //echo $resultado; $geometria = substr("$geometria",0,-1); @@ -225,7 +283,7 @@ $impresion = formulario_imprimir("$id","$control",""); } $siguiente = "SIGUIENTE"; if($div ==''){ - $presentacion = "
$siguiente $impresion
"; + $presentacion = "
$siguiente $impresion
"; }else{ //$respuesta->addAlert("$consulta"); $respuesta->addScript("setTimeout(function(){xajax_aplicacion_presentacion('$id','presentacion_$id','$timeout')},$timeout)"); @@ -241,7 +299,8 @@ $xajax->registerFunction("aplicacion_presentacion"); function aplicaciones_listado($id_form,$tipo){ // if($id_empresa !=''){ $_empresa = " ";} - if($tipo =='publico'){ $w_publico =" publico ='0'";}else {$w_publico =" publico ='1'";} + //if($tipo =='publico'){ $w_publico =" publico ='0'";}else {$w_publico =" publico ='1'";} + $w_publico =" publico ='1'"; $link=Conectarse(); mysql_query("SET NAMES 'utf8'"); $consulta = "SELECT * FROM form_id WHERE $w_publico ORDER BY id DESC "; @@ -250,29 +309,79 @@ $sql=mysql_query($consulta,$link); if (mysql_num_rows($sql)!='0'){ mysql_data_seek($sql, 0); - //$resultado .=" Público "; + $modificable = remplacetas('form_id','id',$id,'modificable',"") ; + $modificable = " +
+ Formulario privado + + Público +
+ "; $primer = formulario_uso("$id",'','primer') ; @@ -2188,7 +2311,7 @@ $resultado .= "
$primer Creado por: $propietario[0] Creación: $row[creacion] - $mapa $estado + $mapa $estado $modificable
Modificar campos
Llenar @@ -2701,10 +2824,15 @@ function formulario_modal($id,$form_respuesta,$control,$tipo) { $pie .= empresa_datos("$id_empresa",'pie'); $formulario_descripcion = remplacetas('form_id','id',$id,'descripcion') ; $cabecera ="$encabezado

$formulario_nombre[0]

$formulario_descripcion[0]

$nuevo_formulario "; +/* + $modificable = remplacetas('form_id','id',$id,'modificable') ; $publico = remplacetas('form_id','id',$id,'publico') ; - if($publico[0] != 1 AND (!isset ( $_SESSION[id]) )) { + if($modificable[0] != "1" and (!isset ( $_SESSION[id]) )){$restringido = 1;} + elseif($publico[0] != "1" and (!isset ( $_SESSION[id]) )) {$restringido = 1;} + else{$restringido=0;} + if($restringido === 1 ) { $muestra_form ="
-

+

$restringido $modificable[0]

Este formulario no esta disponible publicamente.

"; $respuesta->addAssign("muestra_form","innerHTML","$muestra_form"); @@ -2712,27 +2840,31 @@ $respuesta->addAssign("titulo_modal","innerHTML","$cabecera"); $respuesta->addAssign("pie_modal","innerHTML","$pie"); $respuesta->addscript("$('#muestraInfo').modal('toggle')"); return $respuesta; - - } + } +*/ $nuevo_formulario = "Llenar otro formulario "; - if($control !='' AND $tipo =='' ) { - -$impresion = formulario_imprimir("$id","$control",""); - -$formulario_nombre = remplacetas('form_id','id',$id,'nombre') ; -$muestra_form = "
$impresion
"; - - -$respuesta->addAssign("muestra_form","innerHTML","$muestra_form"); -$respuesta->addAssign("titulo_modal","innerHTML","$cabecera"); -$respuesta->addAssign("pie_modal","innerHTML","$pie"); -$respuesta->addscript("$('#muestraInfo').modal('toggle')"); -return $respuesta; - - -} - +if($control !='' AND $tipo =='' ) { + $impresion = formulario_imprimir("$id","$control",""); + $formulario_nombre = remplacetas('form_id','id',$id,'nombre') ; + $muestra_form = "
$impresion
"; + $respuesta->addAssign("muestra_form","innerHTML","$muestra_form"); + $respuesta->addAssign("titulo_modal","innerHTML","$cabecera"); + $respuesta->addAssign("pie_modal","innerHTML","$pie"); + $respuesta->addscript("$('#muestraInfo').modal('toggle')"); + return $respuesta; + } + $modificable = remplacetas('form_id','id',$id,'modificable') ; + if($modificable[0] != "1" and (!isset ( $_SESSION[id]) )) { + $resultado ="

Acceso restringido

No se pueden consultar los datos.
"; + $respuesta->addAssign("muestra_form","innerHTML","$resultado"); + $respuesta->addAssign("titulo_modal","innerHTML","$cabecera"); + $respuesta->addAssign("pie_modal","innerHTML","$pie"); + $respuesta->addscript("$('#muestraInfo').modal('toggle')"); + return $respuesta; + } + + $consulta = " SELECT * FROM form_id, form_contenido_campos WHERE form_id.id = form_contenido_campos.id_form diff --git a/milfs/images/100x100.png b/milfs/images/100x100.png new file mode 100755 index 0000000000000000000000000000000000000000..5f90606d0154b99f2a94e060d38e8f926b45622f GIT binary patch literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^DImL~ literal 0 HcmV?d00001 diff --git a/milfs/images/200x200.png b/milfs/images/200x200.png new file mode 100755 index 0000000000000000000000000000000000000000..3b6945cded987b4431b2dc7cf6cc42f96b34920d GIT binary patch literal 292 zcmeAS@N?(olHy`uVBq!ia0vp^$3d8b4M?tKbw38A*pj^6T^Rm@;DWu&Cj&(|3p^r= zffC9f%(!V~{8gYJdx@v7EBiezeqJLDHN6cNfI=HRT^vIyZoNIo$P45hTJYUJm(P3w ekU2QPgIf&QD;XFyubw#ta-gTHpUXO@geCyk>L)n> literal 0 HcmV?d00001 diff --git a/milfs/images/transparente40.png b/milfs/images/transparente40.png new file mode 100644 index 0000000000000000000000000000000000000000..94ae0953825c89c566156965bb87dd0638d42c5b GIT binary patch literal 280 zcmeAS@N?(olHy`uVBq!ia0vp^DIm_RelF{r G5}E)eKRp%z literal 0 HcmV?d00001 diff --git a/milfs/images/transparente50.png b/milfs/images/transparente50.png new file mode 100644 index 0000000000000000000000000000000000000000..ba3b13a72c5f3de0c1107c8f03953d3300a85cb1 GIT binary patch literal 279 zcmeAS@N?(olHy`uVBq!ia0vp^DIm$lat,'lon'=>$lon); + + $formulario = formulario_imprimir($row[id],$row[control],'full'); + $propiedades = formulario_imprimir_linea($row[id],$row[control],"array");// + $propiedades["name"] ="
$formulario
"; + //$propiedades["title"] ="images/pin.png"; + //$propiedades[icon][iconUrl] = "images/pin.png"; + + //formulario_imprimir($id,$control) + //$marcador["zoom"] = $zoom; + //$geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK).",\"properties\":{}},"; + $geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT)."},"; + $features[] = $marcador; + //$resultado .= "
  • $row[tipo]
    $row[title]
    $row[description]
  • "; + + $id++; + } + +} +/* +//encode and output jsonObject +header('Content-Type: text/plain'); +//echo $consulta; +$resultado = " { \"type\": \"FeatureCollection\", + \"features\": "; +$resultado .= json_encode($features,JSON_NUMERIC_CHECK); +$resultado .= "}"; +//echo $resultado; +$geometria = substr("$geometria",0,-1); +$geometria = "{ + \"type\": \"FeatureCollection\", + \"features\": [$geometria ]}"; +return $geometria; +*/ + +//-75.58295 6.25578 16 +//{"geometry": {"type": "Point", "coordinates": [48.460711540220927, 39.562486386735543]}, "type": "Feature", "properties": {}} +//encode and output jsonObject +header('Content-Type: application/json'); +//echo $consulta; +//$resultado = " { \"type\": \"FeatureCollection\", \"features\": "; +$resultado .= json_encode($features,JSON_NUMERIC_CHECK|JSON_PRETTY_PRINT); +//$resultado .= "}"; +//echo $resultado; +$geometria = substr("$geometria",0,-1); +/*$geometria = "{ + \"type\": \"FeatureCollection\", + \"features\": [$geometria ]}"; + */ +echo $geometria; + +?> \ No newline at end of file diff --git a/milfs/map.php b/milfs/map.php index 4bf63be..8b53b23 100644 --- a/milfs/map.php +++ b/milfs/map.php @@ -5,7 +5,10 @@ $xajax = new xajax(); //require ('json.lab.php'); require ('funciones/funciones.php'); //require ('funciones/convert.php'); +$xajax->processRequests(); +if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];} $formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ; +$agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ; ?> @@ -52,7 +55,7 @@ $formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ; - "> +
    @@ -61,7 +64,7 @@ L.mapbox.accessToken = 'pk.eyJ1IjoiaHVtYW5vIiwiYSI6IlgyRTFNdFEifQ.OmQBXmcVg_zq-v var map = L.mapbox.map('map', 'humano.jki5hno0') .setView([40, -74.50], 8); -var geoJson = [ ]; +var geoJson = [ ]; var myLayer = L.mapbox.featureLayer() .setGeoJSON(geoJson) .addTo(map); @@ -87,6 +90,7 @@ myLayer.setGeoJSON(geoJson); diff --git a/milfs/mapa.php b/milfs/mapa.php index bf256b5..5713fa7 100644 --- a/milfs/mapa.php +++ b/milfs/mapa.php @@ -17,6 +17,38 @@
    + var map = L.map('map') - .setView([, ], ); + // .setView([, ], ); + .setView([latitude, longitude], ); L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png').addTo(map); //var lat = window.parent.document.getElementById('lat'); diff --git a/milfs/rt.php b/milfs/rt.php new file mode 100644 index 0000000..b777b3c --- /dev/null +++ b/milfs/rt.php @@ -0,0 +1,156 @@ +processRequests(); +if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];} +$formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ; +$agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ; +?> + + + + +<?php echo $formulario_nombre[0] ?> MILFS + + + + + + + + + <?php echo $formulario_nombre[0] ?> MILFS + + + + + + + printJavascript("xajax/"); ?> + + + + + + + + + + + + + + + + + + + +
    +
    + + +
    +
    + Agregar
    + * +
    + + + + + + + + + + \ No newline at end of file