Location: PHPKode > scripts > php ireport > phpireport v1.0 alpha revision 25/phpireport/live.php
<?
$page_title = "live reports <img src='template/default/images/processing.gif' align='right'>";

$page_content = $page_content."
<script  type='text/javascript'>
function getreports(str)
{
if (str=='')
  {
  document.getElementById('live_reports').innerHTML='';
  return;
  }
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState==4 && xmlhttp.status==200)
    {
    document.getElementById('live_reports').innerHTML=xmlhttp.responseText;
    }
  }
xmlhttp.open('GET','messages_viewer.php?',true);
xmlhttp.send();
}
</script>
";


$page_content = $page_content."
<script type='text/javascript'>
var c=0;
var t;
var timer_is_on=1;

function timedCount()
{
//alert('hi');
getreports('yes');
t=setTimeout('timedCount()',5000);
}

function doTimer()
{
if (!timer_is_on)
  {
  timer_is_on=1;
  timedCount();
  }
}

timedCount();
</script>
";


$page_content = $page_content."<div id='live_reports'></div>";
?>
Return current item: php ireport