Repositorio para la herramienta Tupale completo
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

432 lines
13KB

  1. <?php session_start();
  2. if(isset($_REQUEST['debug'])) {ini_set('display_errors', 'On');}
  3. require ('milfs/xajax/xajax.inc.php');
  4. $xajax = new xajax();
  5. //require ('json.lab.php');
  6. require ('milfs/funciones/funciones.php');
  7. require ("milfs/funciones/conex.php");
  8. include ('milfs/librerias/parsedown/Parsedown.php');
  9. //require_once ('includes/markdown.php');
  10. //require ('funciones/convert.php');
  11. $xajax->processRequests();
  12. //if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];}
  13. if(isset($_REQUEST[categoria]) AND isset($_REQUEST[buscar])) {
  14. $cadena_busqueda = "$_REQUEST[buscar]";
  15. $_REQUEST['buscar'] = "$_REQUEST[categoria]:$_REQUEST[buscar]";
  16. }
  17. $formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ;
  18. $formulario_descripcion = remplacetas('form_id','id',$_REQUEST[id],'descripcion') ;
  19. $descripcion_meta = preg_replace("[\n|\r|\n\r|\t]",'', strip_tags($formulario_descripcion[0]));
  20. $agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ;
  21. $id_empresa = remplacetas('form_id','id',$_REQUEST[id],'id_empresa') ;
  22. $twitter = remplacetas('empresa','id',"$id_empresa[0]",'twitter','') ;
  23. if($twitter[0] =="") {$twitter[0] ="@tupaleCo";}
  24. $logo = remplacetas('empresa','id',"$id_empresa[0]",'imagen','') ;
  25. $razon_social = remplacetas('empresa','id',"$id_empresa[0]",'razon_social','') ;
  26. $campos_formulario = input_campos("$_REQUEST[id]","categoria");
  27. $uri = "$_SERVER[SERVER_NAME]/$_SERVER[REQUEST_URI]";
  28. $background_imagen = buscar_imagen("$_REQUEST[id]","","","$id_empresa");
  29. $plantilla ="mapa";
  30. ?>
  31. <!DOCTYPE html>
  32. <html lang="en">
  33. <head >
  34. <title><?php echo "$formulario_nombre[0] / $cadena_busqueda" ?> tupale.co</title>
  35. <meta charset="utf-8">
  36. <!-- <meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1"> -->
  37. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  38. <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
  39. <meta name="description" content="">
  40. <meta NAME="Language" CONTENT="Spanish">
  41. <meta NAME="Revisit" CONTENT="1 days">
  42. <meta NAME="Distribution" CONTENT="Global">
  43. <meta NAME="Robots" CONTENT="All">
  44. <meta name="twitter:card" content="summary">
  45. <meta name="twitter:site" content="<?php echo $twitter[0]; ?>">
  46. <meta name="twitter:creator" content="@qwerty_co">
  47. <meta name="twitter:url" content="<?php echo $uri ; ?>">
  48. <meta name="twitter:title" content="<?php echo "$formulario_nombre[0] / $cadena_busqueda" ?> tupale.co">
  49. <meta name="twitter:description" content=" <?php echo $descripcion_meta; ?>">
  50. <meta name="twitter:image" content="<?php echo "$_SESSION[url]images/secure/?file=full/$background_imagen"; ?>">
  51. <meta property="og:type" content="article">
  52. <meta property="og:title" content="<?php echo "$formulario_nombre[0] / $cadena_busqueda" ?> tupale.co" />
  53. <meta property="og:type" content="website" />
  54. <meta property="og:url" content="<?php echo "$uri"; ?>" />
  55. <meta property="og:image" content="<?php echo "$_SESSION[url]images/secure/?file=full/$background_imagen"; ?>" />
  56. <meta property="og:site_name" content="<?php echo $razon_social[0]; ?>" />
  57. <meta property="og:description" content=" <?php echo $descripcion_meta; ?>" />
  58. <link rel="shortcut icon" href="<?php echo "milfs/images/secure/?file=150/$logo[0]"; ?>">
  59. <?php $xajax->printJavascript("milfs/xajax/"); ?>
  60. <link rel="shortcut icon" href="favicon-152.png">
  61. <link rel="apple-touch-icon-precomposed" href="favicon-152.png">
  62. <link rel="stylesheet" href="librerias/leaflet/leaflet-search.css"/>
  63. <script src="librerias/leaflet/leaflet.js"></script>
  64. <script src="librerias/jquery/jquery-2.1.4.min.js"></script>
  65. <script src="librerias/leaflet/leaflet-providers.js"></script>
  66. <script src="librerias/leaflet/leaflet-search.js"></script>
  67. <link rel="stylesheet" type="text/css" media="screen" href="milfs/css/bootstrap.css">
  68. <link rel="stylesheet" href="librerias/leaflet/leaflet.css" />
  69. <script src="librerias/leaflet/leaflet.js"></script>
  70. <link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.css" />
  71. <link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.Default.css" />
  72. <script src="librerias/leaflet/dist/leaflet.markercluster-src.js"></script>
  73. <script type="text/javascript" src="milfs/geojson.js.php?id=<?php echo $_REQUEST['id'] ?>&buscar=<?php echo $_REQUEST['buscar'] ?>&item=<?php echo $_REQUEST['item'] ?>"></script>
  74. <?php
  75. $otro_json = remplacetas('form_parametrizacion','campo',$_REQUEST[id],'descripcion'," tabla='form_id' and opcion = 'json'") ;;
  76. //$obj = file_get_contents('https://www.kleper.net/wiki/RutaPazTerritorial.geojson');
  77. $ids = json_decode($otro_json[0]);
  78. foreach ($ids as $clave => $valor) {
  79. if($valor !=""){
  80. $obj=file_get_contents("$valor[0]");
  81. $li .="<script>var geojsonAuxiliar_$clave = $obj ;</script>";
  82. $layer .= "
  83. var geojsonAux_$clave = L.geoJson(geojsonAuxiliar_$clave, {
  84. pointToLayer: function(feature, latlng) {
  85. var smallIcon = new L.Icon({
  86. iconSize: [100, 100],
  87. iconAnchor: [13, 27],
  88. popupAnchor: [1, -24],
  89. /*iconUrl: feature.properties.icon.iconUrl*/
  90. iconUrl: 'https://tupale.co/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png'
  91. });
  92. return L.marker(latlng, {icon: smallIcon});
  93. },
  94. onEachFeature: function(feature, layer) {
  95. var popupText = feature.properties.description
  96. layer.bindPopup(popupText); }
  97. });
  98. ";
  99. $add_layer .= "markers.addLayer(geojsonAux_$clave);";
  100. $capas_nombre .="geojsonAux_$clave,";
  101. $capas .= "{
  102. '$clave': geojsonAux_$clave
  103. };";
  104. $overlays ="
  105. var overlays = $capas ";
  106. }
  107. }
  108. echo $li;
  109. ?>
  110. <style type="text/css">
  111. @media (max-width: 800px) {
  112. .panel-map{
  113. max-width: 970px;
  114. }
  115. }
  116. @media (min-width: 800px) {
  117. .panel-map{
  118. max-width: 200px;
  119. }
  120. }
  121. .leaflet-popup-content { word-wrap: break-word !important; width:600px !important; }
  122. #map { position:absolute; top:0; bottom:0; width:100%; }
  123. /* Sticky footer styles
  124. -------------------------------------------------- */
  125. .footer {
  126. position: absolute;
  127. bottom: 3px;
  128. width: 95%;
  129. margin: 0 auto;
  130. height: 120px;
  131. /* Set the fixed height of the footer here */
  132. z-index: 999999;
  133. }
  134. #div_leyenda {
  135. padding: 2px;
  136. background-color: white;
  137. border-radius: 3px;
  138. width: 90%;
  139. overflow-x: scroll;
  140. }
  141. .modal-dialog {
  142. width: 70%;
  143. height: 50%;
  144. padding: 0;
  145. }
  146. .modal-content {
  147. height: 50%;
  148. }
  149. ::-webkit-scrollbar {
  150. width: 12px;
  151. }
  152. ::-webkit-scrollbar-track {
  153. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
  154. border-radius: 10px;
  155. }
  156. ::-webkit-scrollbar-thumb {
  157. border-radius: 10px;
  158. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
  159. }
  160. </style>
  161. <?php
  162. $categorias = lista_categorias($_REQUEST['id'],'','') ;
  163. $css_adicional = remplacetas('form_parametrizacion','campo',"index",'descripcion'," tabla='css' and opcion = 'adicional' and id_empresa = '$id_empresa[0]'") ;
  164. if($css_adicional[0] !="") {
  165. $css_adicional ="<style >
  166. $css_adicional[0]
  167. <!-- adicional -->
  168. </style>";
  169. }
  170. else {
  171. $css_adicional ="<style ><!-- nada --></style>";
  172. }
  173. echo $css_adicional; ?>
  174. </head>
  175. <body>
  176. <!--nav sidebar -->
  177. <aside>
  178. <nav class="navbar navbar-inverse sidebar navbar-fixed-top" role="navigation">
  179. <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
  180. <link href="librerias/leaflet/css/sidebar.css" rel="stylesheet">
  181. <div class="nav-side-menu">
  182. <div class="brand"><a href="./"><img style='width: 100%;' src='images/banner.png' class='image-responsive'></a><br> <i class="fa fa-info-circle fa-lg pull-right" style="margin-top: 10px; margin-right: 5px;"></i></div>
  183. <i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
  184. <br>
  185. <form action="?id=<?php echo $_REQUEST[id]; ?>" method="get">
  186. <div class='input-group '>
  187. <input type='hidden' id='id' name='id' value="<?php echo $_REQUEST[id]; ?>" >
  188. <?php echo $campos_formulario; ?><div id='div_campos'></div>
  189. <input type='text' id='buscar' name='buscar' class='form-control' placeholder='Buscar' >
  190. <input type="submit" class="btn btn-info " value="Buscar">
  191. </div>
  192. </form>
  193. <hr>
  194. <div class="menu-list">
  195. <div style='width: calc(90% - 40px);;' class="container-fluid">
  196. <h1><?php echo $formulario_nombre[0]; ?></h1>
  197. <h2><?php echo $formulario_descripcion[0]; ?></h2>
  198. <hr>
  199. <h3>Categorías</h3>
  200. <div style="height: 300px; overflow: auto;" >
  201. <?php echo $categorias; ?>
  202. </div>
  203. <div class="sidebar-logo">
  204. <a href="e<?php echo $id_empresa[0]; ?>" >
  205. <img style='margin: 0px auto;' class='img img-responsive block-center' src="milfs/images/secure/?file=150/<?php echo $logo[0]; ?>" alt="<?php echo $razon_social[0]; ?>">
  206. <h4><?php echo $razon_social[0]; ?></h4>
  207. </a>
  208. </div>
  209. </div>
  210. </div>
  211. </div>
  212. </nav>
  213. </aside>
  214. <div id="map"></div>
  215. <?php
  216. if($categorias !="") {
  217. $pie="
  218. <div style='' class='' id='contenedor_pie' >
  219. <div style='' class='container' >
  220. <a href='#' onclick=\"xajax_limpia_div('contenedor_pie'); \"><span class='pull-right'><i class='fa fa-times'></i></span></a>
  221. $categorias
  222. </div></div>
  223. </div>";
  224. $leyenda ="<div id='div_leyenda'><a class='btn btn-default btn-xs' onclick=xajax_contenido_ocultar('div_leyenda');>Cerrar</a> $categorias </div> ";
  225. }else{
  226. }
  227. //echo $pie;
  228. ?>
  229. <script type="text/javascript">
  230. function htmlbodyHeightUpdate(){
  231. var height3 = $( window ).height()
  232. var height1 = $('.nav').height()+50
  233. height2 = $('.main').height()
  234. if(height2 > height3){
  235. $('html').height(Math.max(height1,height3,height2)+10);
  236. $('body').height(Math.max(height1,height3,height2)+10);
  237. }
  238. else
  239. {
  240. $('html').height(Math.max(height1,height3,height2));
  241. $('body').height(Math.max(height1,height3,height2));
  242. }
  243. }
  244. $(document).ready(function () {
  245. htmlbodyHeightUpdate()
  246. $( window ).resize(function() {
  247. htmlbodyHeightUpdate()
  248. });
  249. $( window ).scroll(function() {
  250. height2 = $('.main').height()
  251. htmlbodyHeightUpdate()
  252. });
  253. });
  254. function htmlbodyHeightUpdate(){
  255. var height3 = $( window ).height()
  256. var height1 = $('.nav').height()+50
  257. height2 = $('.main').height()
  258. if(height2 > height3){
  259. $('html').height(Math.max(height1,height3,height2)+10);
  260. $('body').height(Math.max(height1,height3,height2)+10);
  261. }
  262. else
  263. {
  264. $('html').height(Math.max(height1,height3,height2));
  265. $('body').height(Math.max(height1,height3,height2));
  266. }
  267. }
  268. $(document).ready(function () {
  269. htmlbodyHeightUpdate()
  270. $( window ).resize(function() {
  271. htmlbodyHeightUpdate()
  272. });
  273. $( window ).scroll(function() {
  274. height2 = $('.main').height()
  275. htmlbodyHeightUpdate()
  276. });
  277. });
  278. var tiles = L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
  279. maxZoom: 18,
  280. attribution: '<a href="https://tupale.co">https://tupale.co</a> &copy; <a href="https://openstreetmap.org/copyright">OpenStreetMap</a> contributors'
  281. }),
  282. latlng = L.latLng(4, -74.9005222);
  283. var map = L.map('map', {center: latlng, zoom: 5, layers: [tiles],zoomControl: false});
  284. var geojson = L.geoJson(geojsonSample, {
  285. pointToLayer: function(feature, latlng) {
  286. var smallIcon = new L.Icon({
  287. iconSize: [100, 100],
  288. iconAnchor: [13, 27],
  289. popupAnchor: [1, -24],
  290. iconUrl: feature.properties.icon.iconUrl
  291. /* iconUrl: "http://localhost/default/tupali/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png"*/
  292. });
  293. return L.marker(latlng, {icon: smallIcon});
  294. },
  295. onEachFeature: function(feature, layer) {
  296. var popupText = feature.properties.description
  297. layer.bindPopup(popupText); }
  298. });
  299. /*
  300. var geojsonAux = L.geoJson(geojsonAuxiliar, {
  301. pointToLayer: function(feature, latlng) {
  302. var smallIcon = new L.Icon({
  303. iconSize: [60, 60],
  304. iconAnchor: [13, 27],
  305. popupAnchor: [1, -24],
  306. iconUrl: "http://localhost/default/tupali/milfs/images/secure/?file=150/da6d16547658ebc06c5378b30d1ee4bf.png"
  307. });
  308. return L.marker(latlng, {icon: smallIcon});
  309. },
  310. onEachFeature: function(feature, layer) {
  311. var popupText = feature.properties.description
  312. layer.bindPopup(popupText); }
  313. });
  314. */
  315. <?php echo $layer; ?>
  316. var markers = L.markerClusterGroup();
  317. markers.addLayer(geojson);
  318. // markers.addLayer(geojsonAux);
  319. <?php echo $add_layer; ?>
  320. map.fitBounds(geojson.getBounds());
  321. var legend = L.control({position: 'bottomright'});
  322. //disable zoomControl when initializing map (which is topleft by default)
  323. ///L.control.layers(<?php echo $capas_nombre; ?>).addTo(map);
  324. /* //add zoom control with your options
  325. L.control.zoom({
  326. position:'topright'
  327. }).addTo(map);
  328. */
  329. legend.onAdd = function (map) {
  330. var div = L.DomUtil.create('div', 'info legend');
  331. div.innerHTML = "";
  332. div.id = "info legend"
  333. return div;
  334. };
  335. legend.addTo(map);
  336. map.addLayer(markers);
  337. </script>
  338. </body>
  339. </html>