Subversion Repositories ALCASAR

Compare Revisions

No changes between revisions

Ignore whitespace Rev 2181 → Rev 2182

/web/acc/admin_log.php
1,72 → 1,83
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<TITLE>Admin Logs</TITLE>
<link rel="stylesheet" href="../css/bootstrap.min.css">
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
<style>
<?php
# $Id $
 
body {
background-color: #EFEFEF;
$Language = 'en';
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE'])) {
$Langue = explode(',', $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]), 0, 2));
}
 
</style>
</HEAD>
<body>
 
<?php
if(isset($_SERVER['HTTP_ACCEPT_LANGUAGE']))
{
$Langue = explode(",",$_SERVER['HTTP_ACCEPT_LANGUAGE']);
$Language = strtolower(substr(chop($Langue[0]),0,2));
if ($Language === 'fr') {
$l_title_amdin_log = "Connexion à l'ALCASAR Control Center (ACC)";
} else {
$l_title_amdin_log = "Connection to ALCASAR Control Center (ACC)";
}
 
if($Language == 'fr')
{
$l_title_amdin_log="Connexion à l'ALCASAR Control Center (ACC)";
}
else
{
$l_title_amdin_log="Connection to ALCASAR Control Center (ACC)";
}
 
echo '<center><h3>';
echo "$l_title_amdin_log";
echo '</h3></center><div class="container"><table class="table table-striped">';
echo "<thead>";
echo "<tr>";
echo "<th>Date</th>";
echo "<th>User</th>";
echo "<th>IP address</th>";
echo "</tr>";
echo "</thead>";
echo "<tbody>";
 
$fichier='admin_log.txt';
$pointeur=fopen($fichier,"r");
if ($pointeur){
while (!feof($pointeur)){
$ligne=fgets($pointeur);
$infos=explode("|||",$ligne);
echo "<tr>";
echo "<td>$infos[0]</td>";
echo "<td>$infos[1]</td>";
echo "<td>$infos[2]</td>";
echo "</tr>";
// Read access log
$accessLogs = [];
$accessLogFilename = 'admin_log.txt';
$filePtn = fopen($accessLogFilename, 'r');
if ($filePtn !== false){
while (!feof($filePtn)) {
$ligne = fgets($filePtn);
if (empty($ligne)) {
continue;
}
$infos = explode('|||', $ligne);
$accessLogs[] = (object) [
'date' => trim($infos[0]),
'username' => trim($infos[1]),
'ip' => trim($infos[2])
];
}
fclose($filePtn);
}
else
{
echo '<tr><center>Empty</center></tr>';
}
fclose($pointeur);
echo '</tbody></table></div>';
$accessLogs = array_reverse($accessLogs);
 
 
 
?>
 
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>Admin Logs</title>
<link rel="stylesheet" type="text/css" href="../css/bootstrap.min.css">
<style>
body {
background-color: #EFEFEF;
}
</style>
<script src="../js/jquery.min.js"></script>
<script src="../js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<center>
<h3><?= $l_title_amdin_log ?></h3>
</center>
<table class="table table-striped">
<thead>
<tr>
<th>Date</th>
<th>User</th>
<th>IP address</th>
</tr>
</thead>
<tbody>
<?php if (empty($accessLogs)): ?>
<tr>
<td colspan="3"><center>Empty</center></td>
</tr>
<?php else: ?>
<?php foreach ($accessLogs as $access): ?>
<tr>
<td><?= $access->date ?></td>
<td><?= $access->username ?></td>
<td><?= $access->ip ?></td>
</tr>
<?php endforeach; ?>
<?php endif; ?>
</tbody>
</table>
</div>
</body>
</HTML>
 
</html>
Property changes:
Added: svn:keywords
+Id
\ No newline at end of property