<?php
// variávis que se trabalham nessa página
$var_banco = "acessos";
$var_pagina = "acessos"
?>
<section class="content" >
<!-- Info boxes -->
<section class="content-header">
<h1>
Acessos ao sistema
</h1>
<br />
<?php
//********** BUSCA TODOS **********
$comando = "SELECT a.datacadastro, a.secao , b.nome
FROM ". $var_banco ." a
INNER JOIN usuario_sistema b ON a.id_usuario = b.id
ORDER BY a.id DESC";
$exec = mysql_query($comando);
?>
<div class="box">
<div class="box-header with-border">
<h3 class="box-title">Acessos ao sistema e aos módulos</h3>
</div>
<!-- /.box-header -->
<div class="box-body">
<table class="table table-bordered">
<tbody><tr>
<th>Nome</th>
<th>Onde?</th>
<th>Data e hora</th>
</tr>
<?php
while ($linha = mysql_fetch_assoc($exec)) {
?>
<tr <?php if ($linha["secao"] == "LOGIN") echo ' class="success" '?>>
<td><?php echo $linha["nome"];?></td>
<td><?php echo $linha["secao"];?></td>
<td><?php echo date('d/m/Y H:i:s',strtotime($linha['datacadastro']));?></td>
</tr>
<?php
} //while
?>
</tbody></table>
</div>
<!-- /.box-body -->
</div>
</section>
</section>