Hola a todos
Tengo un problema lo que pasa es que mi pagina principal se actualiza cada segundo con el siguiente archivo
Código HTML:
<html>
<head>
<meta http-equiv="refresh" content="60">
<title>Actualizador BD</title>
<script>
/*
* Parametros mandatorios
*/
var seconds = 1; // el tiempo en que se refresca
var divid = "tabla"; // el div que quieres actualizar!
var nocacheurl = 'tabla.php';
//var url = "tabla.php"; // el archivo que ira en el div
function refreshdiv(){
// The XMLHttpRequest object
var xmlHttp;
try{
xmlHttp=new XMLHttpRequest(); // Firefox, Opera 8.0+, Safari
}
catch (e){
try{
xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); // Internet Explorer
}
catch (e){
try{
xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
}
catch (e){
alert("Tu explorador no soporta AJAX.");
return false;
}
}
}
// Timestamp for preventing IE caching the GET request
var timestamp = parseInt(new Date().getTime().toString().substring(0, 10));
// The code...
xmlHttp.onreadystatechange=function(){
if(xmlHttp.readyState== 4 && xmlHttp.readyState != null){
document.getElementById(divid).innerHTML=xmlHttp.responseText;
setTimeout('refreshdiv()',seconds*1000);
}
}
xmlHttp.open("GET",nocacheurl,true);
xmlHttp.send(null);
}
// Empieza la función de refrescar
window.onload = function(){
refreshdiv(); // corremos inmediatamente la funcion
}
function Datos(){
//var alerta= "";
//confirm(alerta );
nocacheurl='tabladatos.php';
}
function Voz(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablavoz.php';
}
function Mintic(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablamintic.php';
}
function InfoTicket(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablainfo_ticket.php';
}
function SoporteOS(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablasoporte.php';
}
function MCF(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablamcf.php';
}
function ActualizarInfo(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tablaactualizar_info.php';
}
function DiaAnterior(){
//var alerta= "";
//alert(alerta);
nocacheurl = 'tabladia_anterior.php';
}
</script>
</head>
<body >
<!--alerta.gif -->
<?php
$botones='
<div id="Principal" align="center">
<button id="MCF(" onclick="MCF()" class="tabla1"> MCCF </button>
<button id="Voz" onclick="Voz()" class="tabla1"> Voz </button>
<button id="Datos" onclick="Datos()" class="tabla1"> Datos </button>
<button id="Mintic" onclick="Mintic()" class="tabla1"> Mintic </button>
<button id="DiaAnterior" onclick="DiaAnterior()" class="tabla2">Resumen Mes por dias</button>
<br></br><img src="images/informe.jpg" width="280" height="90" align="center">
</div>';
echo $botones;
echo '<div id="tabla">' ;
echo "</div>";
?>
</body>
</html>
Entonces este archivo me muestra el archivo tabla.php donde tengo toda la información que se muestra en la pagina, pero el problema es que en la parte inferior tengo 4 gráficas que me muestra un comportamiento cada hora y necesito que se me actualize cada hora y el resto de la pagina cada minuto
Adjunto la parte del archivo tabla.php que es el que quiero que se actualize cada hora
Código PHP:
echo "<table border='1' align='rigth' class='tabla td'>";
echo "<tr><td class='tabla td'>Consolidado dia </td></tr> ";
echo "</table>";
echo "<table border='0' align='center' ><tr><td>";
include("grafica_hora_datos.php");
echo "</td>";
echo "<td>";
include("grafica_hora_mintic.php");
echo "</td></tr></table>";
echo "<table border='0' align='center' ><tr><td>";
include("grafica_hora_datos.php");
echo "</td>";
echo "<td>";
include("grafica_hora_mintic.php");
echo "</td></tr></table>";
include("grafica_hora_mccf_voz.php");
Espero me ayuden y me hayan entendido
Gracias