';
include('ipmi-errors.log');
echo '
';
}
echo ('Données mises à jour '.time_elapsed_string('@'.filemtime('ipmi-lst.html')).'
');
function time_elapsed_string($datetime, $full = false) {
$now = new DateTime;
$ago = new DateTime($datetime);
$diff = $now->diff($ago);
$diff->w = floor($diff->d / 7);
$diff->d -= $diff->w * 7;
$string = array(
'y' => 'an',
'm' => 'mois',
'w' => 'semaine',
'd' => 'jour',
'h' => 'heure',
'i' => 'minute',
's' => 'seconde',
);
foreach ($string as $k => &$v) {
if ($diff->$k) {
$v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : '');
} else {
unset($string[$k]);
}
}
if (!$full) $string = array_slice($string, 0, 1);
return $string ? 'il y a ' . implode(', ', $string) : 'à l\'instant';
}
echo ('');
if (file_exists('temp.html')) {include('temp.html');} else {echo("temp.html not found");}
?>