2014-09-25 15:46:41 +00:00
|
|
|
<?php
|
|
|
|
//ini_set('display_errors', 'On');
|
|
|
|
require ('xajax/xajax.inc.php');
|
|
|
|
$xajax = new xajax();
|
|
|
|
require ('funciones/funciones.php');
|
2014-09-30 20:27:53 +00:00
|
|
|
require ('funciones/convert.php');
|
2015-06-30 17:01:37 +00:00
|
|
|
require ("includes/markdown.php");
|
2015-07-10 23:56:29 +00:00
|
|
|
require ("funciones/conex.php");
|
2014-09-25 15:46:41 +00:00
|
|
|
|
|
|
|
$fecha_inicio = mysql_seguridad($_REQUEST[inicio]);
|
|
|
|
$fin = mysql_seguridad($_REQUEST[fin]);
|
2014-09-29 01:59:03 +00:00
|
|
|
$perfil = mysql_seguridad($_REQUEST[id]);
|
2014-09-25 15:46:41 +00:00
|
|
|
$id = mysql_seguridad($_REQUEST[id]);
|
|
|
|
$busqueda = mysql_seguridad($_REQUEST[cadena]);
|
|
|
|
$campo = buscar_campo_tipo($id,"14");
|
|
|
|
$id_campo = $campo[0];
|
|
|
|
|
|
|
|
$link=Conectarse();
|
2018-07-01 22:21:48 +00:00
|
|
|
|
2014-10-07 12:02:29 +00:00
|
|
|
$consulta = "SELECT form_id as id, control, GROUP_CONCAT(contenido ORDER by timestamp desc ) as data
|
2014-10-07 11:28:54 +00:00
|
|
|
FROM `form_datos`
|
|
|
|
WHERE form_id = '$id'
|
|
|
|
AND id_campo ='$id_campo' $valor
|
|
|
|
group by control
|
|
|
|
ORDER BY orden desc";
|
2014-09-25 15:46:41 +00:00
|
|
|
|
2018-07-01 22:21:48 +00:00
|
|
|
mysqli_query("SET NAMES 'UTF8'");
|
2014-09-25 15:46:41 +00:00
|
|
|
|
|
|
|
|
2018-07-01 22:21:48 +00:00
|
|
|
$sql = mysqli_query($consulta,$link) or die("Error al ejecutar consulta en json.php");
|
2018-07-02 17:49:58 +00:00
|
|
|
if (mysqli_num_rows($sql)!='0'){
|
2014-09-25 15:46:41 +00:00
|
|
|
$id = 1;
|
|
|
|
$features = array();
|
2018-07-02 17:49:58 +00:00
|
|
|
while( $row = mysqli_fetch_array( $sql ) ) {
|
2014-09-25 15:46:41 +00:00
|
|
|
$marcador = array();
|
|
|
|
$propiedades = array();
|
2018-07-01 22:21:48 +00:00
|
|
|
|
2014-10-07 12:02:29 +00:00
|
|
|
$identificador = explode(',',$row[data]);
|
|
|
|
$identificador = $identificador[0];
|
|
|
|
$campos = explode(" ",$identificador);
|
2014-09-25 15:46:41 +00:00
|
|
|
$lat = $campos[0];
|
|
|
|
$lon = $campos[1];
|
|
|
|
$zoom = $campos[2];
|
|
|
|
$marcador["type"] = "Point";
|
|
|
|
$marcador["coordinates"] = array($lat,$lon);
|
2015-10-27 21:35:37 +00:00
|
|
|
$formulario = formulario_imprimir($perfil,$row[control],'');
|
2014-10-06 17:13:44 +00:00
|
|
|
$propiedades["name"] ="<div class='container-fluid' id='contenedor_datos' >$formulario</div>";
|
2018-07-01 22:21:48 +00:00
|
|
|
$geometria .= "{\"type\":\"Feature\",\"geometry\":".json_encode($marcador,JSON_NUMERIC_CHECK).",\"properties\":".json_encode($propiedades,JSON_NUMERIC_CHECK)."},";
|
2014-09-25 15:46:41 +00:00
|
|
|
$features[] = $marcador;
|
2018-07-01 22:21:48 +00:00
|
|
|
|
2014-09-25 15:46:41 +00:00
|
|
|
|
|
|
|
$id++;
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
header('Content-Type: application/json');
|
2018-07-01 22:21:48 +00:00
|
|
|
|
2014-09-25 15:46:41 +00:00
|
|
|
$resultado = " { \"type\": \"FeatureCollection\",
|
|
|
|
\"features\": ";
|
|
|
|
$resultado .= json_encode($features,JSON_NUMERIC_CHECK);
|
|
|
|
$resultado .= "}";
|
|
|
|
$geometria = substr("$geometria",0,-1);
|
|
|
|
$geometria = "{
|
|
|
|
\"type\": \"FeatureCollection\",
|
|
|
|
\"features\": [$geometria ]}";
|
|
|
|
echo $geometria;
|
|
|
|
|
|
|
|
?>
|