Пример #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);
}
Пример #2
0
                            <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;
            ?>
</td>
                                <td><?php 
            echo $log->url;
            ?>
</td>
Пример #3
0
    case 'alteraquantidade':
        $codigo = $_GET['codigo'];
        $_POST = array_trim($_POST);
        $nsaldo = $_POST['nsaldo'];
        $c = new conexao();
        $c->set_charset('utf8');
        $q = "UPDATE componentes SET saldo = '{$nsaldo}' WHERE codigo = '{$codigo}';";
        $c->query($q);
        header('Location: componentes.php?action=quantidade&p=0');
        break;
    default:
        @($p = empty($_GET['p']) ? $p = 0 : ($p = $_GET['p']));
        $c = new conexao();
        $c->set_charset('utf8');
        $q = "SELECT count(codigo) AS QtdLinhas FROM componentes;";
        $r1 = $c->query($q);
        $qtdlinhas = $r1->fetch_object();
        $q = "SELECT * FROM componentes LIMIT {$p},100;";
        $r = $c->query($q);
        ?>
                <h2>Lista de componentes</h2>
                <div class="paginador">
                <?php 
        if ($p < 100) {
            ?>
                <form action='componentes.php' method='get'>
                    <input type='text' name='p' size='4' maxlength="4" value='<?php 
            echo $p;
            ?>
'/>
                    <a href='componentes.php?p=<?php