// best practise is write logfile in the directory where this php script is saved because some php installations have problems to read files outside the webserver directories
$handle=fopen("lastheard.log","r");
// import to array
while(($data=fgetcsv($handle))!==false)
{
$log_time[]=$data[0];
$transmit_timer[]=$data[1];
$calltype[]=$data[2];
$event[]=$data[3];
$system[]=$data[4];
$src_id[]=$data[5];
$src_name[]=$data[6];
$ts[]=$data[7];
$tg[]=$data[8];
$tgname[]=$data[9];
$user_id[]=$data[10];
$user_call[]=$data[11];
$user_name[]=$data[12];
}
// define some macros for table output
$s="<TD>";
$s_r="<TD align=\"right\">";
$s_m="<TD align=\"center\">";
// output to html table from the newest entry to the oldest
for($i=count($log_time)-1;$i>=0;$i--)
{
// prepare date string for output in european format
$split_date=substr($log_time[$i],0,10);
$date_eu=explode("-",$split_date);
$ts[$i]=substr($ts[$i],-1);
$tg[$i]=substr($tg[$i],2);
// define special character convert for number zero - we write calls with number zero with this character in logs in Germany
// thats a special thing for an Id comes without DMR-Id from PEGASUS project - it means we need to convert to "NoCall" thats for calls from source ECHOLINK