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.

343 lines
9.1KB

  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. //require_once ('includes/markdown.php');
  9. //require ('funciones/convert.php');
  10. $xajax->processRequests();
  11. //if($_REQUEST[id2] =='') {$agregar= $_REQUEST[id];}else {$agregar = $_REQUEST[id2];}
  12. if(isset($_REQUEST[categoria]) AND isset($_REQUEST[buscar])) {
  13. $_REQUEST[buscar] = "$_REQUEST[categoria]:$_REQUEST[buscar]";
  14. }
  15. $formulario_nombre = remplacetas('form_id','id',$_REQUEST[id],'nombre') ;
  16. $formulario_descripcion = remplacetas('form_id','id',$_REQUEST[id],'descripcion') ;
  17. $agregar_nombre = remplacetas('form_id','id',$agregar,'nombre') ;
  18. $id_empresa = remplacetas('form_id','id',$_REQUEST[id],'id_empresa') ;
  19. $logo = remplacetas('empresa','id',"$id_empresa[0]",'imagen','') ;
  20. $razon_social = remplacetas('empresa','id',"$id_empresa[0]",'razon_social','') ;
  21. $campos_formulario = input_campos("$_REQUEST[id]","categoria");
  22. $plantilla ="mapa";
  23. ?>
  24. <!DOCTYPE html>
  25. <html lang="en">
  26. <head >
  27. <title><?php echo $formulario_nombre[0] ?> MILFS</title>
  28. <meta charset="utf-8">
  29. <!-- <meta name="viewport" content="user-scalable=no, width=device-width, maximum-scale=1, initial-scale=1"> -->
  30. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  31. <!-- <meta name="viewport" content="width=device-width, initial-scale=1"> -->
  32. <meta name="description" content="">
  33. <?php $xajax->printJavascript("milfs/xajax/"); ?>
  34. <link rel="shortcut icon" href="favicon-152.png">
  35. <link rel="apple-touch-icon-precomposed" href="favicon-152.png">
  36. <link rel="stylesheet" href="librerias/leaflet/leaflet-search.css"/>
  37. <script src="librerias/leaflet/leaflet.js"></script>
  38. <script src="https://code.jquery.com/jquery-1.11.3.min.js"></script>
  39. <script src="librerias/leaflet/leaflet-providers.js"></script>
  40. <script src="librerias/leaflet/leaflet-search.js"></script>
  41. <link rel="stylesheet" type="text/css" media="screen" href="milfs/css/bootstrap.css">
  42. <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.css" />
  43. <script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/1.0.3/leaflet.js"></script>
  44. <link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.css" />
  45. <link rel="stylesheet" href="librerias/leaflet/dist/MarkerCluster.Default.css" />
  46. <script src="librerias/leaflet/dist/leaflet.markercluster-src.js"></script>
  47. <script type="text/javascript" src="milfs/geojson.js.php?id=<?php echo $_REQUEST['id'] ?>&buscar=<?php echo $_REQUEST['buscar'] ?>"></script>
  48. <style type="text/css">
  49. @media (max-width: 800px) {
  50. .panel-map{
  51. max-width: 970px;
  52. }
  53. }
  54. @media (min-width: 800px) {
  55. .panel-map{
  56. max-width: 200px;
  57. }
  58. }
  59. .leaflet-popup-content { word-wrap: break-word !important; /*width:600px !important; */ }
  60. #map { position:absolute; top:0; bottom:0; width:100%; }
  61. /* Sticky footer styles
  62. -------------------------------------------------- */
  63. .footer {
  64. position: absolute;
  65. bottom: 3px;
  66. width: 95%;
  67. margin: 0 auto;
  68. height: 120px;
  69. /* Set the fixed height of the footer here */
  70. z-index: 999999;
  71. }
  72. #div_leyenda {
  73. padding: 2px;
  74. background-color: white;
  75. border-radius: 3px;
  76. width: 90%;
  77. overflow-x: scroll;
  78. }
  79. .modal-dialog {
  80. width: 70%;
  81. height: 50%;
  82. padding: 0;
  83. }
  84. .modal-content {
  85. height: 50%;
  86. }
  87. ::-webkit-scrollbar {
  88. width: 12px;
  89. }
  90. ::-webkit-scrollbar-track {
  91. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
  92. border-radius: 10px;
  93. }
  94. ::-webkit-scrollbar-thumb {
  95. border-radius: 10px;
  96. -webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.5);
  97. }
  98. </style>
  99. <?php
  100. $categorias = lista_categorias($_REQUEST['id'],'','') ;
  101. $css_adicional = remplacetas('form_parametrizacion','campo',"index",'descripcion'," tabla='css' and opcion = 'adicional' and id_empresa = '$id_empresa[0]'") ;
  102. if($css_adicional[0] !="") {
  103. $css_adicional ="<style >
  104. $css_adicional[0]
  105. <!-- adicional -->
  106. </style>";
  107. }
  108. else {
  109. $css_adicional ="<style ><!-- nada --></style>";
  110. }
  111. echo $css_adicional; ?>
  112. </head>
  113. <body>
  114. <!--nav sidebar -->
  115. <aside>
  116. <nav class="navbar navbar-inverse sidebar navbar-fixed-top" role="navigation">
  117. <link href="//maxcdn.bootstrapcdn.com/font-awesome/4.2.0/css/font-awesome.min.css" rel="stylesheet">
  118. <link href="librerias/leaflet/css/sidebar.css" rel="stylesheet">
  119. <div class="nav-side-menu">
  120. <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>
  121. <i class="fa fa-bars fa-2x toggle-btn" data-toggle="collapse" data-target="#menu-content"></i>
  122. <br>
  123. <form action="?id=<?php echo $_REQUEST[id]; ?>" method="get">
  124. <div class='input-group '>
  125. <input type='hidden' id='id' name='id' value="<?php echo $_REQUEST[id]; ?>" >
  126. <?php echo $campos_formulario; ?><div id='div_campos'></div>
  127. <input type='text' id='buscar' name='buscar' class='form-control' placeholder='Buscar' >
  128. <input type="submit" class="btn btn-info " value="Buscar">
  129. </div>
  130. </form>
  131. <hr>
  132. <div class="menu-list">
  133. <div style='width: calc(90% - 40px);;' class="container-fluid">
  134. <h1><?php echo $formulario_nombre[0]; ?></h1>
  135. <h2><?php echo $formulario_descripcion[0]; ?></h2>
  136. <hr>
  137. <h3>Categorías</h3>
  138. <div style="height: 300px; overflow: auto;" >
  139. <?php echo $categorias; ?>
  140. </div>
  141. <div class="sidebar-logo">
  142. <a href="e<?php echo $id_empresa[0]; ?>" >
  143. <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]; ?>">
  144. <h4><?php echo $razon_social[0]; ?></h4>
  145. </a>
  146. </div>
  147. </div>
  148. </div>
  149. </div>
  150. </nav>
  151. </aside>
  152. <div id="map"></div>
  153. <?php
  154. if($categorias !="") {
  155. $pie="
  156. <div style='' class='' id='contenedor_pie' >
  157. <div style='' class='container' >
  158. <a href='#' onclick=\"xajax_limpia_div('contenedor_pie'); \"><span class='pull-right'><i class='fa fa-times'></i></span></a>
  159. $categorias
  160. </div></div>
  161. </div>";
  162. $leyenda ="<div id='div_leyenda'><a class='btn btn-default btn-xs' onclick=xajax_contenido_ocultar('div_leyenda');>Cerrar</a> $categorias </div> ";
  163. }else{
  164. }
  165. //echo $pie;
  166. ?>
  167. <script type="text/javascript">
  168. function htmlbodyHeightUpdate(){
  169. var height3 = $( window ).height()
  170. var height1 = $('.nav').height()+50
  171. height2 = $('.main').height()
  172. if(height2 > height3){
  173. $('html').height(Math.max(height1,height3,height2)+10);
  174. $('body').height(Math.max(height1,height3,height2)+10);
  175. }
  176. else
  177. {
  178. $('html').height(Math.max(height1,height3,height2));
  179. $('body').height(Math.max(height1,height3,height2));
  180. }
  181. }
  182. $(document).ready(function () {
  183. htmlbodyHeightUpdate()
  184. $( window ).resize(function() {
  185. htmlbodyHeightUpdate()
  186. });
  187. $( window ).scroll(function() {
  188. height2 = $('.main').height()
  189. htmlbodyHeightUpdate()
  190. });
  191. });
  192. function htmlbodyHeightUpdate(){
  193. var height3 = $( window ).height()
  194. var height1 = $('.nav').height()+50
  195. height2 = $('.main').height()
  196. if(height2 > height3){
  197. $('html').height(Math.max(height1,height3,height2)+10);
  198. $('body').height(Math.max(height1,height3,height2)+10);
  199. }
  200. else
  201. {
  202. $('html').height(Math.max(height1,height3,height2));
  203. $('body').height(Math.max(height1,height3,height2));
  204. }
  205. }
  206. $(document).ready(function () {
  207. htmlbodyHeightUpdate()
  208. $( window ).resize(function() {
  209. htmlbodyHeightUpdate()
  210. });
  211. $( window ).scroll(function() {
  212. height2 = $('.main').height()
  213. htmlbodyHeightUpdate()
  214. });
  215. });
  216. var tiles = L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
  217. maxZoom: 18,
  218. attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
  219. }),
  220. latlng = L.latLng(4, -74.9005222);
  221. var map = L.map('map', {center: latlng, zoom: 5, layers: [tiles],zoomControl: false});
  222. var geojson = L.geoJson(geojsonSample, {
  223. pointToLayer: function(feature, latlng) {
  224. var smallIcon = new L.Icon({
  225. iconSize: [60, 60],
  226. iconAnchor: [13, 27],
  227. popupAnchor: [1, -24],
  228. iconUrl: feature.properties.icon.iconUrl
  229. });
  230. return L.marker(latlng, {icon: smallIcon});
  231. },
  232. onEachFeature: function(feature, layer) {
  233. var popupText = feature.properties.description
  234. layer.bindPopup(popupText); }
  235. });
  236. var markers = L.markerClusterGroup();
  237. markers.addLayer(geojson);
  238. map.fitBounds(geojson.getBounds());
  239. var legend = L.control({position: 'bottomright'});
  240. //disable zoomControl when initializing map (which is topleft by default)
  241. //add zoom control with your options
  242. L.control.zoom({
  243. position:'topright'
  244. }).addTo(map);
  245. legend.onAdd = function (map) {
  246. var div = L.DomUtil.create('div', 'info legend');
  247. div.innerHTML = "";
  248. div.id = "info legend"
  249. return div;
  250. };
  251. legend.addTo(map);
  252. map.addLayer(markers);
  253. </script>
  254. </body>
  255. </html>