Пример #1
0
 public function consultaCPF($value)
 {
     $c = new clienteDAO();
     $lista = $c->consultaCliente();
     foreach ($lista as $cpf => $email) {
         if ($email['cpf'] == $value) {
             return true;
         } else {
             return false;
         }
     }
 }
Пример #2
0
<?php

include_once "DAOs/clienteDAO.php";
$email = $_GET['email'];
$nivel = $_POST['nivel'];
if ($_POST['nivel'] == '1') {
    $c = new clienteDAO();
    echo $email . ' ' . $nivel;
    $c->alterarNivel($nivel, $email);
    header("location :http://easycompre.esy.es/testeADM.php");
} elseif ($_POST['nivel'] == '2') {
    $c = new clienteDAO();
    echo $nivel . ' ' . $email;
    $c->alterarNivel($nivel, $email);
    header("location :http://easycompre.esy.es/testeADM.php");
}
Пример #3
0
 public function Login($Email, $senha)
 {
     $c = new clienteDAO();
     $cli = new clienteDAO();
     $lista = $c->consultaCliente();
     //var_dump($lista);
     $notLogged = true;
     foreach ($lista as $cpf => $email) {
         if ($email['senha'] == $senha && $email['email'] == $Email) {
             //echo $email['cpf'];
             session_start();
             $_SESSION['email'] = $email['email'];
             $_SESSION['senha'] = $email['senha'];
             $_SESSION['cpf'] = $email['cpf'];
             $_SESSION['nome'] = $email['nome'];
             $nivel = $cli->consultaNivel($_SESSION['cpf']);
             $_SESSION['nivel'] = $nivel[0][0];
             $notLogged = false;
             //	var_dump($_SESSION);
             //	if($_SESSION['nivel']=="cliente"){echo "noiado";}
             //	var_dump($this->isLogged());
             if ($acao != "ADM") {
                 include_once "home.php";
             }
             echo \Metodos\PHPalert('Bem vindo ' . $_SESSION['nome']);
             break;
         }
     }
     if ($notLogged) {
         //echo \Metodos\PHPalert('usuario ou senha invalidos');
         include_once "home.php";
         echo \Metodos\PHPalert('usuario ou senha invalidos');
     }
 }
Пример #4
0
    public function linhaEmail($e)
    {
        session_start();
        $cli = new clienteDAO();
        $linha = $cli->consultaCliente();
        echo '<!DOCTYPE html>
			<html lang="en">
			<head>
			  <title>Nivel Clientes</title>
			  <meta charset="utf-8">
			  <meta name="viewport" content="width=device-width, initial-scale=1">
			  <link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
			  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
			  <script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
			</head>
			<body>

			<div class="container">           
			  <table border="0" class="table table-striped">';
        $num = count($linha);
        for ($i = 0; $i < $num; $i++) {
            if ($linha[$i]['email'] == $e) {
                echo '<tr>';
                echo '<td>' . $linha[$i]['cpf'] . '</td>';
                echo '<td>' . \Metodos\retornarData($linha[$i]['data_nascimento']) . '</td>';
                echo '<td>' . $linha[$i]['email'] . '</td>';
                echo '<td>' . $linha[$i]['nome'] . '</td>';
                echo '<td>' . $linha[$i]['telefone_celular'] . '</td>';
                echo '<td>' . $linha[$i]['senha'] . '</td>';
                echo '<td rowspan="2">';
                echo '<form action="index.php?acao=alterarNivel&enviar=linhaEmail&email=' . $linha[$i]['email'] . '" method="POST">';
                echo '<select size="1" name="nivel">
									<option selected value="">Nivel</option>
									<option value="1">1</option>
									<option value="2">2</option>
								</select>';
                echo '<input type="submit" name="Alterar"/>';
                echo '</form>';
                echo '</td>';
                echo '</tr>';
            }
        }
        echo '</table>
			</div>

			</body>
			</html>';
    }