2018-07-01 22:21:48 +00:00
|
|
|
<?php
|
|
|
|
if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
|
|
|
|
require ('xajax/xajax.inc.php');
|
|
|
|
$xajax = new xajax();
|
|
|
|
require ('funciones/funciones.php');
|
|
|
|
require ('funciones/convert.php');
|
|
|
|
|
|
|
|
require ("funciones/conex.php");
|
|
|
|
|
|
|
|
|
|
|
|
$fecha_inicio = mysql_seguridad($_REQUEST[inicio]);
|
|
|
|
$fin = mysql_seguridad($_REQUEST[fin]);
|
|
|
|
$perfil = mysql_seguridad($_REQUEST[id]);
|
|
|
|
$id_campo = mysql_seguridad($_REQUEST[id_campo]);
|
2014-09-25 15:46:41 +00:00
|
|
|
$busqueda = mysql_seguridad($_REQUEST[cadena]);
|
2018-07-01 22:21:48 +00:00
|
|
|
|
|
|
|
$link=Conectarse();
|
2014-09-25 15:46:41 +00:00
|
|
|
if($perfil !=''){$perfil ="AND form_id = '$perfil'";}Else{$perfil ='';}
|
|
|
|
|
|
|
|
if($formato =='csv') {$orden = "ORDER BY form_datos.id ASC ";}
|
|
|
|
if($id_campo ==''){$campo ='';}else{$campo ="AND id_campo = '$id_campo'";}
|
|
|
|
if($busqueda !=''){$busca ="AND contenido LIKE '$busqueda'";}Else{$busca ='';}
|
|
|
|
|
2018-07-01 22:21:48 +00:00
|
|
|
|
2014-09-25 15:46:41 +00:00
|
|
|
|
|
|
|
|
|
|
|
$consulta = " SELECT *,form_campos.id AS id_campo, from_unixtime(timestamp) AS fecha , form_datos.id AS form_datos_id
|
|
|
|
FROM form_datos, form_campos
|
|
|
|
WHERE form_datos.id_campo = form_campos.id
|
|
|
|
$busca
|
|
|
|
$perfil
|
|
|
|
$campo
|
2018-07-01 22:21:48 +00:00
|
|
|
$orden";
|
|
|
|
|
|
|
|
//echo $consulta;
|
|
|
|
|
|
|
|
mysqli_query("SET NAMES 'UTF-8'");
|
|
|
|
|
|
|
|
|
|
|
|
$resultado = mysqli_query($link,$consulta) or die("error al ejecutar consulta $consulta ");
|
|
|
|
$fecha = time ();
|
|
|
|
$fecha=date ( "D, d M Y" , $fecha );
|
|
|
|
|
|
|
|
|
|
|
|
header('Content-Type: text/xml');
|
|
|
|
$xml= "<?xml version='1.0' encoding='utf-8'?>
|
|
|
|
<rss xmlns:content='http://purl.org/rss/1.0/modules/content/'
|
|
|
|
xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'
|
|
|
|
xmlns:dc='http://purl.org/dc/elements/1.1/' >
|
|
|
|
<channel>
|
|
|
|
<title>Formularios $consulta</title>
|
|
|
|
<link></link>
|
|
|
|
|
|
|
|
<description>Respuestas a formularios</description>
|
|
|
|
<category>Formularios</category>
|
|
|
|
<generator>http://qwerty.co</generator>
|
|
|
|
<managingEditor>correo@qwerty.co</managingEditor>
|
|
|
|
<pubDate>$fecha</pubDate>
|
|
|
|
<webMaster>correo@qwerty.co</webMaster>
|
|
|
|
<language>es-ES</language>";
|
|
|
|
|
|
|
|
mysqli_data_seek($resultado, 0);
|
|
|
|
while ($fila = mysqli_fetch_array($resultado)) {
|
|
|
|
$formulario_nombre = remplacetas('form_id','id',$fila[form_id],'nombre') ;
|
|
|
|
$formulario_nombre = utf8_encode($formulario_nombre[0]);
|
|
|
|
$title = utf8_encode($fila[item_title]);
|
|
|
|
$description = utf8_encode($fila[item_description]);
|
|
|
|
$content = utf8_encode($fila[item_content]);
|
|
|
|
$contenido = utf8_encode($fila[contenido]);
|
|
|
|
$campo = utf8_encode($fila[campo_nombre]);
|
|
|
|
//$resultado .= "<tr><td>$row[form_datos_id]</td><td>$row[fecha]</td><td>$row[timestamp]</td><td nowrap><a >$formulario_nombre[0]</a></td><td>$row[campo_nombre]</td><td>$row[contenido]</td></tr>";
|
|
|
|
$xml .= "<item>
|
|
|
|
<formulario>$formulario_nombre</formulario>
|
|
|
|
<id_form>$fila[form_id]</id_form>
|
|
|
|
<id_campo>$fila[id_campo]</id_campo>
|
|
|
|
<campo>$campo</campo>
|
|
|
|
<contenido><![CDATA[$contenido]]></contenido>
|
|
|
|
<timestamp>$fila[fecha]</timestamp>
|
|
|
|
<control>$fila[control]</control>
|
|
|
|
<id_usuario>$fila[id_usuario]</id_usuario>
|
|
|
|
|
|
|
|
</item>";
|
|
|
|
}
|
|
|
|
$xml .= '</channel></rss>';
|
2014-09-25 15:46:41 +00:00
|
|
|
|
2018-07-01 22:21:48 +00:00
|
|
|
|
|
|
|
|
|
|
|
echo $xml;
|
|
|
|
//
|
|
|
|
?>
|