示例#1
0
<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/controller/Cusuario.php';
$json = file_get_contents('php://input');
$obj = json_decode($json);
$usuario = new Cusuario();
$msg = $usuario->cadastrarUsuario($obj);
if (!$msg) {
    $msg = "Usuario cadastrado com sucesso!! Acesse seu email(" . $usuario->getEmail() . ") e ative sua conta!";
    $tipo = 'success';
} else {
    $tipo = 'error';
}
$retorno = ["msg" => $msg, 'tipo' => $tipo];
echo json_encode($retorno);
示例#2
0
<?php

session_start();
require_once $_SERVER['DOCUMENT_ROOT'] . '/controller/Cusuario.php';
$json = file_get_contents('php://input');
$obj = json_decode($json);
$usuario = new Cusuario();
$msg = $usuario->logarUsuario($obj);
if (!$msg) {
    $msg = "Usuario Logado!";
    $tipo = 'success';
} else {
    $tipo = 'error';
}
$retorno = ["msg" => $msg, 'tipo' => $tipo];
echo json_encode($retorno);
示例#3
0
function getPerfil($user)
{
    include_once $_SERVER['DOCUMENT_ROOT'] . '/controller/Cusuario.php';
    $usuario = new Cusuario();
    $usuario->getUsuarioPerfil($user);
    ?>

<!doctype html>

<html lang="pt-br">
<head>
<meta charset="utf-8"/>
<title>MyTest</title>
    <!-- jquery -->
    <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js"></script>

    <!-- Latest compiled and minified CSS -->
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">

    <!-- Latest compiled and minified JavaScript -->
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/js/bootstrap.min.js"></script>

    <?php 
    include_once $_SERVER['DOCUMENT_ROOT'] . '/interacoes/Iautenticacao.php';
    ?>

</head>
<body>
    <div class="container" >    
        <div id="divLogin" style="margin-top:50px;" class="col-md-6 col-lg-6">                    
            <div class="panel panel-info" >
                <div class="panel-heading">
                    <div>Perfil de <?php 
    echo $usuario->getUsuario();
    ?>
</div>
                </div>     
                <div  class="panel-body" >
                    <div class="col-md-12 col-lg-12">
                        <div class="col-md-7 col-lg-7">
                            <img style="padding: 20px;" src="<?php 
    echo "http://www.gravatar.com/avatar/" . md5(strtolower(trim($usuario->getEmail()))) . "?s=80";
    ?>
" />
                        </div>
                    </div>
                    <br/>
                    <div class="col-md-12 col-lg-12">
                        <label class="col-md-5 col-lg-5 control-label">Nome Completo</label>
                        <div class="col-md-7 col-lg-7">
                            <?php 
    echo $usuario->getNomeCompleto();
    ?>
                        </div>
                    </div>
                    <div class="col-md-12 col-lg-12">
                        <label class="col-md-5 col-lg-5 control-label">Email</label>
                        <div class="col-md-7 col-lg-7">
                            <?php 
    echo $usuario->getEmail();
    ?>
                        </div>
                    </div>
                    <div class="col-md-12 col-lg-12">
                        <div class="col-md-12 col-lg-12">
                            <a href="http://jucelio.pe.hu/interacoes/logoff.php">Sair</a>
                        </div>
                    </div>
                </div>                     
            </div>  
        </div>
    </div>
</body>
</html>
<?php 
}
示例#4
0
<?php
session_start();
session_destroy()
?>
<?php
require_once './conf/modelConexao.php';
require_once './include/CBanco.php';
require_once './conf/MControladorGenerico.php';
require_once './conf/ControladorGenerico.php';
require_once './Cusuario.php';
require_once './include/header.php';
$controladorUsuario = new Cusuario(FALSE);
?>
<header>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8" > 
    <style>
	.form-signin
	{
	    max-width: 330px;
	    padding: 15px;
	    margin: 0 auto;
	}
	.form-signin .form-signin-heading, .form-signin .checkbox
	{
	    margin-bottom: 10px;
	}

	.form-signin .checkbox
	{
	    font-weight: normal;
	}