tupali/opendata.php

289 lines
9.0 KiB
PHP
Raw Permalink Normal View History

2016-10-29 15:07:15 +00:00
<?php
///este archivo debe estar un nivel superior al directorio milfs
2016-10-29 15:07:15 +00:00
session_start();
if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
2016-10-29 15:07:15 +00:00
//ini_set('display_errors', 'On');
require ('milfs/xajax/xajax.inc.php');
$xajax = new xajax();
require ('milfs/funciones/funciones.php');
//require ('milfs/funciones/experimentales.php');
2016-10-29 15:07:15 +00:00
//require ('milfs/funciones/convert.php');
require ('milfs/funciones/login.php');
require_once ('milfs/includes/markdown.php');
require ("milfs/funciones/conex.php");
$xajax->processRequests();
2016-10-29 15:07:15 +00:00
if($_REQUEST['tipo'] == 'documento') {
2016-10-29 15:07:15 +00:00
if($_REQUEST['id'] !="") {
$linea = consultar_contenido_formulario("$_REQUEST[id]",'','','embebido','','impresion');
$nombre="documento_$_REQUEST[id].odt";
}else {
$linea = landingpage_contenido_identificador("$_REQUEST[identificador]","$id_form","impresion",'paginado');
$nombre="documento_$_REQUEST[identificador].docx";
}
2016-10-29 15:07:15 +00:00
header('Content-Description: File Transfer');
//header('Content-Type: application/vnd.openxmlformats-officedocument.wordprocessingml.document');
header('Content-Type: application/vnd.oasis.opendocument.text');
header("Content-Disposition: attachment;filename=$nombre");
header('Content-Transfer-Encoding: binary');
header('Expires: 0');
header('Cache-Control: must-revalidate');
header('Pragma: public');
echo "<html><body><h2>https://tupale.co</h2> $linea</body></html>";
return;
2016-11-28 16:49:43 +00:00
}elseif($_REQUEST['tipo'] == 'svg') {
2016-11-28 16:49:43 +00:00
if($_REQUEST['id'] !="") {
// $linea = consultar_contenido_formulario("$_REQUEST[id]",'','','simple','','svg');
$creacion = exportar_svg($_REQUEST['id']);
echo $creacion ;
echo"$creacion svg";
return;
}else {
// $linea = landingpage_contenido_identificador("$_REQUEST[identificador]","$id_form","impresion",'paginado');
// $nombre="documento_$_REQUEST[identificador].docx";
}
/*header('Content-type: image/svg+xml');
echo '<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
width="210mm"
height="297mm"
viewBox="0 0 744.09448819 1052.3622047"
id="svg9084"
version="1.1">
<defs
id="defs9086">
<clipPath
clipPathUnits="userSpaceOnUse"
id="clipPath11049">
</clipPath>
</defs>
<metadata
id="metadata9089">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
';
echo $linea;
echo '</svg>';
//echo $linea;
return;
*/
}else{}
2016-10-29 15:07:15 +00:00
if(isset($_REQUEST['id']) AND $_REQUEST['id'] !="") {$formulario = $_REQUEST['id'];
$id_proyecto = remplacetas('form_id','id',"$formulario",'id_empresa','') ; $id_proyecto = $id_proyecto[0];
2016-10-29 15:07:15 +00:00
}else {$formulario = "";}
if(isset($_REQUEST['campo']) AND $_REQUEST['campo'] !="") {$id_campo = $_REQUEST['campo'];}else {$id_campo = "";}
if(isset($_REQUEST['proyecto']) AND $_REQUEST['proyecto'] !="") {$id_proyecto = $_REQUEST['proyecto'];}else {}
if($id_proyecto =="") {$id_proyecto= "1";}
$listado_formularios = portal_listado_formularios($id_proyecto);
$panel_formularios ="
2018-07-20 17:23:44 +00:00
<div class='dropdown' id='drop_aplicacion'>
<button class='btn btn-warning btn-block dropdown-toggle' type='button' data-toggle='dropdown'>Selecciona una Aplicación
<span class='caret'></span></button>
<ul class='dropdown-menu'>
<ul class='list-unstyled'>
$listado_formularios
</ul>
</ul>
</div>
2016-10-29 15:07:15 +00:00
";
$logo = remplacetas('empresa','id',"$id_proyecto",'imagen','') ;
$direccion = remplacetas('empresa','id',"$id_proyecto",'direccion','') ;
$telefono = remplacetas('empresa','id',"$id_proyecto",'telefono','') ;
$email = remplacetas('empresa','id',"$id_proyecto",'email','') ;
$razon_social = remplacetas('empresa','id',"$id_proyecto",'razon_social','') ;
$slogan = remplacetas('empresa','id',"$id_proyecto",'slogan','') ;
$formulario_publico = remplacetas('form_id','id',"$formulario",'publico',"") ;
$empresa = remplacetas('form_id','id',"$formulario",'id_empresa',"") ;
if($formulario_publico[0] !="1" AND ($id_empresa[0] == $_SESSION['id_empresa']) ) {
$formulario_descripcion="";
$formulario_nombre="";
$acciones="";
}
else {
2016-10-29 15:07:15 +00:00
$formulario_descripcion = remplacetas('form_id','id',"$formulario",'descripcion',"") ;
$formulario_nombre = remplacetas('form_id','id',"$formulario",'nombre',"") ;
2017-10-26 12:35:00 +00:00
$acciones=formulario_acciones("$formulario","");
}
2016-10-29 15:07:15 +00:00
?>
<!DOCTYPE html>
<html lang="en">
<head >
<meta charset="utf-8">
<meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="">
<?php $xajax->printJavascript("milfs/xajax/"); ?>
<link rel="shortcut icon" href="favicon-152.png">
<link rel="apple-touch-icon-precomposed" href="favicon-152.png">
<link href="milfs/css/font-awesome/css/font-awesome.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="milfs/css/style.css" media="screen" /> -->
<link href="librerias/bootstrap/css/sticky-footer-navbar.css" rel="stylesheet">
2016-10-29 15:07:15 +00:00
<!-- <script src="http://cdn.leafletjs.com/leaflet-0.7/leaflet.js"></script> -->
<!-- <link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7/leaflet.css" /> -->
<link rel="stylesheet" href="librerias/bootstrap/css/bootstrap.min.css?'.time().'" >
<link href="librerias/font-awesome/css/font-awesome.min.css" rel="stylesheet" >
2016-10-29 15:07:15 +00:00
<!-- <link href="milfs/css/estilos.php" rel="stylesheet"> -->
<script src="milfs/js/jquery.min.js"></script>
<script src="milfs/js/jquery.timelinr-0.9.54.js"></script>
<script src="./librerias/charts/Chart.bundle.js"></script>
<script src="./librerias/charts/utils.js"></script>
2016-10-29 15:07:15 +00:00
<style type="text/css">
/*@font-face {
font-family: Brandon_light;
src: url("milfs/patos/fuentes/Brandon_light.otf") format("opentype");
}*/
body{
font-size: 18px;
color: black;
}
.modal-dialog {
width: 95%;
height: 95%;
padding: 0;
}
.modal-content {
/*height: 100%;*/
border-radius: 0;
}
.container-fluid {
padding: 0px !important;
}
a.pie{
color: white !important;
}
a.menu{
color: white !important;
}
a:active{
color: black !important;
}
</style>
<!-- morris -->
<link rel="stylesheet" href="librerias/morris/morris.css">
<script src="librerias/raphael/raphael-min.js"></script>
<script src="librerias/morris/morris.min.js"></script>
2016-10-29 15:07:15 +00:00
<!-- morris -->
</head>
<body >
<!-- Static navbar -->
<div id ='contenedor' style=' ' class="container">
<div class="col-md-12">
<?php echo "<h1><img class='img img-rounded' src='milfs/images/secure/?file=150/$logo[0]' style='max-height:100px;'> $razon_social[0]<small><br>$slogan[0]</small></h1>"; ?>
2016-10-29 15:07:15 +00:00
</div>
2018-07-20 17:23:44 +00:00
<div class='container-full'>
<div class='col-md-6'>
<?php
$empresas = drop('empresa','id','razon_social','?proyecto',"",'Selecciona un Proyecto');
echo $empresas
2018-07-20 17:23:44 +00:00
?>
</div>
<div class='col-md-6'>
2016-10-29 15:07:15 +00:00
<?php echo $panel_formularios ?>
2018-07-20 17:23:44 +00:00
</div>
<div class='col-md-12'>
2016-10-29 15:07:15 +00:00
<div id='mostrar_contenido' class='container-fluid'>
2017-10-26 03:36:21 +00:00
<?php echo "<h2>$formulario_nombre[0] <small><br>$formulario_descripcion[0]</small></h2> $acciones $buscador
2016-10-29 15:07:15 +00:00
<div id='mostrar_contenido_buscador' class=''>
</div>
2016-10-29 15:07:15 +00:00
";
if($id_campo =="") {
2016-10-29 15:07:15 +00:00
echo portal_listado_campos("$formulario");
}
?>
2016-10-29 15:07:15 +00:00
</div>
2016-10-29 15:07:15 +00:00
</div>
2016-10-29 15:07:15 +00:00
</div>
</div>
<div class="" style="background-color: black; color:white; ">
<!-- <img class='img img-resposive' src="milfs/patos/images/pie.png" style="width:100%" alt=""> -->
</div>
</div>
<!-- Modal -->
<div class='modal fade ' id='muestraInfo' tabindex='-1' role='dialog' aria-labelledby='myModalLabel' aria-hidden='true'>
<div class='modal-dialog modal-lg' style=' ' >
<div class='modal-content' style=' '>
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
<br>
</div>
<div class='modal-body'>
<div id='muestra_form' class="row"></div>
</div>
</div>
</div>
<!--
2016-10-29 15:07:15 +00:00
<div class='pie' style=" position: fixed;
bottom: 0;
2016-10-29 15:07:15 +00:00
width: 100%;
/* Set the fixed height of the footer here */
2016-10-29 15:07:15 +00:00
">
</div> -->
2016-10-29 15:07:15 +00:00
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<!-- <script src="milfs/js/jquery.min.js"></script> -->
<script src="https://code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js" integrity="sha512-K1qjQ+NcF2TYO/eI3M6v8EiNYZfA95pQumfvcVrTHtwQVDG+aHRqLi/ETn2uB+1JqwYqVG3LIvdm9lj6imS/pQ==" crossorigin="anonymous"></script>
<!-- <script src="milfs/js/bootstrap.min.js"></script> -->
<script src="milfs/js/scripts.js"></script>
2016-10-29 15:07:15 +00:00
</body>
</html>