Пример #1
0
<?php

require_once '\\..\\vendor\\autoload.php';
use App\Classes\LoginController;
$ctrlLogin = new LoginController();
$usuario = $ctrlLogin->pegar_usuario();
?>

<div id="perfil">
	<img src="http://placehold.it/500x500" class="img-rounded img-responsive" alt="...">
	<h5 class="text-center" id="name-user"><?php 
echo $usuario->getNome();
?>
</h5>
</div>
<ul class="nav nav-pills nav-stacked">
  <li><a href="<?php 
echo 'http://' . $_SERVER['HTTP_HOST'];
?>
/restrito.php">Dashboard</a></li>
  <li><a href="<?php 
echo 'http://' . $_SERVER['HTTP_HOST'];
?>
/perfil.php">Perfil</a></li>
  <li><a href="<?php 
echo 'http://' . $_SERVER['HTTP_HOST'];
?>
/conteudo.php">Conteúdo do Curso</a></li>
  <li><a href="<?php 
echo 'http://' . $_SERVER['HTTP_HOST'];
?>
Пример #2
0
<?php

require_once '..\\..\\vendor\\autoload.php';
use App\Classes\LoginController;
if (!empty($_REQUEST)) {
    $login = new LoginController();
    switch ($_REQUEST['acao']) {
        case 'login':
            $email = $_REQUEST['email'];
            $pwd = $_REQUEST['password'];
            if ($login->logar($email, $pwd)) {
                $usuario = $login->pegar_usuario();
                if ($usuario->getAdmin()) {
                    header('location:/../../admin/index.php');
                } else {
                    header('location:/../../index.php');
                }
            } else {
                echo 'Deu algum erro';
            }
            break;
        case 'logoff':
            $login->logoff();
            header('location:/../../index.php');
            break;
    }
}
Пример #3
0
<?php

include 'partials/top.php';
require_once 'vendor\\autoload.php';
use App\Classes\LoginController;
$ctrlLogin = new LoginController();
$logged = $ctrlLogin->esta_logado();
if ($logged) {
    header('location:pagamento.php');
}
?>
	<div class="container">
		<div class="row">
			<div class="col-md-4 col-md-offset-4 text-center">
				<p style="margin: 30px 0px;"><img src="img/dozeroaodeploy.png"></p>
				<h3>Realize sua Inscrição</h3>

				<div id="box-inscricao">
					<h2>R$750,00</h2>
					<p>Ou 10 vezes de R$75,00</p>
					<hr>
					<form method="POST" action="/app/Code/dataRecords.php?acao=register">
						<div class="form-group" >
					    	<label for="InputNome">Seu Nome</label>
					    	<input type="text" name="nome" class="form-control" id="InputNome" placeholder="Nome">
						</div>
						<div class="form-group">
					    	<label for="InputEmail">Seu E-mail</label>
					    	<input type="email" name="email" class="form-control" id="InputEmail" placeholder="E-mail">
						</div>
						<div class="form-group">
Пример #4
0
 $config = new Configurations();
 $dataConf = $config->dataBaseConfiguration();
 $connect = new ConnectionDB($dataConf['DSN'], $dataConf['user'], $dataConf['pwd']);
 $instance = $connect->connect();
 $instance->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
 switch ($_REQUEST['acao']) {
     case 'register':
         $user = new Usuario();
         $user->setNome($_REQUEST['nome']);
         $user->setEmail($_REQUEST['email']);
         $user->setSenha($_REQUEST['senha']);
         $sql = 'INSERT INTO usuarios(nome, email, senha) VALUES (?, ?, ?)';
         $stmt = $instance->prepare($sql);
         $newUser = $stmt->execute($user->register());
         if ($newUser) {
             $login = new LoginController();
             $login->logar($user->getEmail(), $user->getSenha());
             header('location:/../../pagamento.php');
         } else {
             die($newUser);
         }
         break;
     case 'profile':
         $session = Sessao::instanciar();
         $session->destroy('error');
         $session->destroy('field');
         $error = [];
         $field = [];
         /*$imagem = $_FILES['image'];
           echo '<pre>'.var_dump($imagem).'</pre>';
           die();*/