Ver Mensaje Individual
  #10 (permalink)  
Antiguo 12/05/2013, 05:28
Avatar de satjaen
satjaen
 
Fecha de Ingreso: septiembre-2012
Ubicación: Jaén (Andalucía)
Mensajes: 893
Antigüedad: 11 años, 8 meses
Puntos: 10
Respuesta: Refrescar la pantalla cada cierto tiempo automaticamente.

Te pongo el código, faltando el select que no me coge:
Código Javascript:
Ver original
  1. <?php require_once('Connections/conexion.php'); ?>
  2. <?php
  3. if (!function_exists("GetSQLValueString")) {
  4. function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
  5. {
  6.   if (PHP_VERSION < 6) {
  7.     $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
  8.   }
  9.  
  10.   $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);
  11.  
  12.   switch ($theType) {
  13.     case "text":
  14.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  15.       break;    
  16.     case "long":
  17.     case "int":
  18.       $theValue = ($theValue != "") ? intval($theValue) : "NULL";
  19.       break;
  20.     case "double":
  21.       $theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
  22.       break;
  23.     case "date":
  24.       $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
  25.       break;
  26.     case "defined":
  27.       $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
  28.       break;
  29.   }
  30.   return $theValue;
  31. }
  32. }
  33. $id_aviso=$_GET['id_aviso'];
  34. mysql_select_db($database_conexion, $conexion);
  35. $query_Recordset1 = "SELECT * FROM avisos WHERE id_aviso='$id_aviso'";
  36. $Recordset1 = mysql_query($query_Recordset1, $conexion) or die(mysql_error());
  37. $row_Recordset1 = mysql_fetch_assoc($Recordset1);
  38. $totalRows_Recordset1 = mysql_num_rows($Recordset1);
  39. ?>
  40.  
  41.  
  42. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  43.  
  44. <html xmlns="http://www.w3.org/1999/xhtml">
  45.  
  46. <head>
  47.  
  48.     <meta http-equiv="refresh" content="20; url=ubicacionavisos.php?id_aviso=<?php echo $row_Recordset1['id_aviso']; ?>">
  49.    
  50.     <meta name="viewport" content="width=device-width, minimum-scale=1, maximum-scale=1">
  51.  
  52.     <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  53.  
  54.        
  55.  
  56.     <title>WedServer ubicación</title>
  57.  
  58. <link rel="stylesheet" type="text/css" href="http://code.jquery.com/mobile/latest/jquery.mobile.min.css" />
  59. <link rel="stylesheet" type="text/css" href="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.min.css" />
  60.  
  61. <script type="text/javascript" src="http://code.jquery.com/jquery-1.7.1.min.js"></script>
  62. <script type="text/javascript" src="http://code.jquery.com/mobile/latest/jquery.mobile.min.js"></script>
  63.  
  64. <!-- Optional Mousewheel support: http://brandonaaron.net/code/mousewheel/docs -->
  65. <script type="text/javascript" src="PATH/TO/YOUR/COPY/OF/jquery.mousewheel.min.js"></script>
  66.  
  67. <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.core.min.js"></script>
  68. <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/latest/jqm-datebox.mode.calbox.min.js"></script>
  69. <script type="text/javascript" src="http://dev.jtsage.com/cdn/datebox/i18n/jquery.mobile.datebox.i18n.en_US.utf8.js">
  70. </script>
  71. <link href="http://code.jquery.com/mobile/1.0/jquery.mobile-1.0.min.css" rel="stylesheet" type="text/css"/>
  72. <script src="http://code.jquery.com/jquery-1.6.4.min.js" type="text/javascript"></script>
  73.  
  74.  
  75.     <style>
  76.  
  77.     #map_canvas
  78.  
  79.     {
  80.  
  81.         color:#333;
  82.  
  83.         font-size:12px;
  84.  
  85.         text-shadow:none;
  86.  
  87.         line-height:12px;
  88.  
  89.     }
  90.  
  91.     .marcador
  92.  
  93.     {
  94.  
  95.         background-image:url();
  96.  
  97.         background-repeat:no-repeat;
  98.  
  99.         padding-left:35px;
  100.  
  101.         line-height:7px;
  102.  
  103.     }
  104.  
  105.     /*globo de texto: nombre usuario*/
  106.  
  107.     h2
  108.  
  109.     {
  110.  
  111.         color:#333;
  112.  
  113.         font-size:14px;    
  114.  
  115.         text-shadow:inherit;
  116.  
  117.         text-shadow:#CCC;
  118.  
  119.         font-family:Tahoma, Geneva, sans-serif;
  120.  
  121.     }
  122.  
  123.     /*globo de texto: direccion usuario*/
  124.  
  125.     h3
  126.  
  127.     {
  128.  
  129.         color:#333;
  130.  
  131.         font-size:11px;    
  132.  
  133.         text-shadow:none;
  134.  
  135.         line-height:13px;
  136.  
  137.     }
  138.  
  139.     </style>
  140.  
  141.  
  142.  
  143.     <script src="../js/jquery-min.js"></script>
  144.  
  145.        
  146.  
  147.     <script language="JavaScript" src="funcionesjavascript.js"></script>
  148.  
  149.        
  150.  
  151.     <script type="text/javascript">            
  152.  
  153.         $(document).bind("mobileinit", function ()
  154.  
  155.         {
  156.  
  157.             $.mobile.ajaxEnabled  = true;
  158.  
  159.         });
  160.  
  161.     </script>
  162.  
  163.  
  164.  
  165.    
  166.    
  167.     <script type="text/javascript" src="jquery-ui-map-3.0-rc/ui/jquery.ui.map.js"></script>
  168.  
  169.     <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&language=es&region=ES"></script>
  170.    
  171.     <script src="http://maps.googleapis.com/maps/api/js?sensor=false"></script>    
  172.  
  173.     <script src="http://code.google.com/apis/gears/gears_init.js"></script>
  174.    
  175.    
  176.  
  177.    
  178.  
  179.  
  180.  
  181.  
  182.  
  183.     <script type="text/javascript">
  184.  
  185.         var directionDisplay;
  186.  
  187.         var directionsService = new google.maps.DirectionsService();
  188.  
  189.         var initialLocation;
  190.  
  191.         var geocoder;
  192.  
  193.         var Arriate = new google.maps.LatLng(37.778551, -3.804231);
  194.  
  195.         var browserSupportFlag =  new Boolean();
  196.  
  197.         var map;
  198.  
  199.         var infowindow = new google.maps.InfoWindow();
  200.  
  201.      
  202.  
  203.         function initialize() {
  204.  
  205.             directionsDisplay = new google.maps.DirectionsRenderer();
  206.  
  207.      
  208.  
  209.             var myOptions =
  210.  
  211.                           {      
  212.  
  213.                             zoom: 11,
  214.  
  215.                             disableDefaultUI: true,
  216.  
  217.                             mapTypeId: google.maps.MapTypeId.ROADMAP
  218.  
  219.                            
  220.  
  221.                           };
  222.  
  223.      
  224.  
  225.                           geocoder = new google.maps.Geocoder();
  226.  
  227.                           var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
  228.  
  229.      
  230.  
  231.                           if(navigator.geolocation)
  232.  
  233.                           {
  234.  
  235.                             browserSupportFlag = true;
  236.  
  237.                             navigator.geolocation.getCurrentPosition(function(position)
  238.  
  239.                             {
  240.  
  241.         initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);
  242.  
  243.                                
  244.  
  245.                                 map.setCenter(initialLocation);
  246.  
  247.                              
  248.  
  249.                                 infowindow.open(map);
  250.  
  251.                                
  252.  
  253.                                 var ContenidoMarcador = 'Posición del Técnico';
  254.  
  255.                                      
  256.  
  257.                                 var infoventana = new google.maps.InfoWindow(
  258.  
  259.                                 {
  260.  
  261.                                     content: ContenidoMarcador                                    
  262.  
  263.                                 });
  264.  
  265.                                
  266.  
  267.  
  268.  
  269.      
  270.  
  271.                                 var image = '../imagenes/tecnico.png';
  272.  
  273.                                 var marcadorTecnico = new google.maps.Marker(
  274.  
  275.                                 {
  276.  
  277.                                     position: initialLocation,
  278.  
  279.                                     map: map,
  280.  
  281.                                     icon: image,
  282.  
  283.                                     title:"Aviso"
  284.  
  285.                                 });
  286.  
  287.      
  288.  
  289.                                 google.maps.event.addListener(marcadorTecnico, 'click', function()
  290.  
  291.                                 {
  292.  
  293.                                     infoventana.open(map,marcadorTecnico);
  294.  
  295.                                 });
  296.  
  297.                            
  298.  
  299.                             }, function() {
  300.  
  301.                               handleNoGeolocation(browserSupportFlag);
  302.  
  303.                             });
  304.  
  305.                           } else if (google.gears) {
  306.  
  307.                            
  308.                             browserSupportFlag = true;
  309.  
  310.                             var geo = google.gears.factory.create('beta.geolocation');
  311.  
  312.                             geo.getCurrentPosition(function(position) {
  313.  
  314.                               initialLocation = new google.maps.LatLng(position.latitude,position.longitude);                              
  315.  
  316.                               map.setCenter(initialLocation);
  317.  
  318.                               infowindow.open(map);
  319.  
  320.                                                    
  321.  
  322.                                 var ContenidoMarcador = 'Posición del Técnico';
  323.  
  324.      
  325.  
  326.                                 var infoventana = new google.maps.InfoWindow({
  327.  
  328.                                     content: ContenidoMarcador
  329.  
  330.                                 });
  331.  
  332.      
  333.  
  334.                                 var image = '../imagenes/tecnico.png';
  335.  
  336.                                 var marcadorTecnico = new google.maps.Marker({
  337.  
  338.                                     position: initialLocation,
  339.  
  340.                                     map: map,
  341.  
  342.                                     icon: image,
  343.  
  344.                                     title:"Aviso"
  345.  
  346.                                 });
  347.  
  348.                                
  349.  
  350.                                 google.maps.event.addListener(marcadorTecnico, 'click', function() {
  351.  
  352.                                     infoventana.open(map,marcadorTecnico);
  353.  
  354.                                 });
  355.  
  356.                             }, function() {
  357.  
  358.                               handleNoGeolocation(browserSupportFlag);
  359.  
  360.                             });
  361.  
  362.                           } else {
  363.  
  364.                             // Browser doesn't support Geolocation
  365.  
  366.                             browserSupportFlag = false;
  367.  
  368.                             handleNoGeolocation(browserSupportFlag);
  369.  
  370.                           }