Beispiel #1
0
function logAction($usuario_id, $url, $post, $get)
{
    $post = addslashes($post);
    $get = addslashes($get);
    $c = new conexao();
    $c->set_charset('utf8');
    $q = "INSERT INTO logs(usuario_id, url, get, post, horario) VALUES('{$usuario_id}', '{$url}', '" . $get . "', '" . $post . "', now());";
    $c->query($q);
}
Beispiel #2
0
    default:
        ?>
					<h2>Logs</h2>
                    <table class="content_table">
                    	<tr>
                        	<th>ID</th>
                            <th>Usuário</th>
                            <th>URL</th>
                            <th>GET</th>
                            <th>POST</th>
                            <th>Horário</th>
                            <th>Apagar</th>
                        </tr>
                        <?php 
        $c = new conexao();
        $c->set_charset('utf8');
        /*
        	a: usuarios;
        	b: logs.
        */
        $q = "SELECT a.nome, b.* FROM usuarios AS a INNER JOIN logs AS b ON a.id = b.usuario_id ORDER BY b.id DESC;";
        $r = $c->query($q);
        while ($log = $r->fetch_object()) {
            ?>
                        	<tr>
                            	<td><?php 
            echo $log->id;
            ?>
</td>
                                <td><?php 
            echo $log->nome;