Example #1
0
 public function Logout()
 {
     // Libera sess?o
     new Sessao();
     Sessao::free();
     $this->view->show();
 }
 function index()
 {
     $tipo = Sessao::pegar('tipo');
     if ($tipo == 0) {
         $this->renderizar = false;
     }
 }
 function descandidatarse($vaga)
 {
     $vaga = (int) $vaga;
     $curriculo = Sessao::pegar('curriculo');
     $sql = "DELETE FROM vaga_curriculos WHERE vaga = '{$vaga}' AND curriculo = '{$curriculo}'";
     $this->query($sql);
 }
 public function __construct()
 {
     new Sessao();
     $oPeriodo = Sessao::getObject("oPeriodo");
     $oProf = Sessao::getObject("oProf");
     $this->model = new Frequencia($oProf, $oPeriodo);
     $this->view = new View("frequencia.html");
 }
Example #5
0
 public function executa()
 {
     if (!isset($_POST['username'])) {
         echo '<script>alert("Nome de usuario ou senha incorretos"); window.history.go(-1);</script>';
         exit;
     }
     $usuario = $_POST['username'];
     $senha = $_POST['password'];
     $redireciona = $_POST['redireciona'] == '' ? 'perfil' : $_POST['redireciona'];
     $dao = new SessaoDAO();
     $id = $dao->validaLogin($usuario, $senha);
     if ($id == 0) {
         echo '<script>alert("Nome de usuario ou senha incorretos"); window.history.go(-1);</script>';
     } else {
         $daoP = new PessoaDAO();
         $pessoa = $daoP->carrega($id);
         $nomeCompleto = $pessoa->get_nome();
         $separaNome = explode(' ', $nomeCompleto);
         $nome = $separaNome[0];
         $opcao = 'pessoa';
         $_SESSION[$opcao]['id'] = $pessoa->get_id();
         $_SESSION[$opcao]['nome'] = $nome;
         $_SESSION[$opcao]['nomeCompleto'] = $nomeCompleto;
         $_SESSION[$opcao]['login'] = $pessoa->get_login();
         $_SESSION[$opcao]['email'] = $pessoa->get_email();
         $_SESSION[$opcao]['sexo'] = $pessoa->get_sexo();
         $_SESSION[$opcao]['contrato'] = $daoP->getContrato($pessoa->get_id());
         $foto = $this->getBaseUrl();
         $fotoOriginal = $foto;
         $foto .= $pessoa->get_foto() != '' ? $pessoa->get_foto() : 'assets/img/avatar.png';
         $fotoOriginal .= $pessoa->get_fotoOriginal() != '' ? $pessoa->get_fotoOriginal() : 'assets/img/avatar.png';
         $_SESSION[$opcao]['foto'] = $foto;
         $_SESSION[$opcao]['fotoOriginal'] = $fotoOriginal;
         $dao->deslogaContas($id, $opcao);
         $ip = $_SERVER['REMOTE_ADDR'];
         $userAgent = $_SERVER['HTTP_USER_AGENT'];
         $sessao = new Sessao();
         $sessao->set_idOpcao($id);
         $sessao->set_opcao($opcao);
         $sessao->set_ip($ip);
         $sessao->set_idSessao(session_id());
         $sessao->set_userAgent($userAgent);
         $sessao->set_dataLogin(date('Y-m-d H:i:s'));
         $sessao->set_dataLogout(null);
         $idLog = $dao->loga($sessao);
         $_SESSION[$opcao]['idlog'] = $idLog;
         $dao->visualizaPagina($idLog, 'loga');
         header('Location: ' . $redireciona);
     }
 }
 public function getAreaDescricao()
 {
     $corpo = Sessao::listarCorpoParte();
     $areas = array();
     foreach ($this->areas as $area) {
         $areas[] = $corpo[$area]['nome'];
     }
     return implode(', ', $areas);
 }
 function index()
 {
     $tipo = Sessao::pegar('tipo');
     if ($tipo != '0') {
         $this->renderizar = true;
         $this->visao = 'indexAdm';
         header('location: ' . URL . 'curriculos/');
     }
 }
 public function deletarGc($arquivo)
 {
     // echo 'teste';
     $string = (string) @file_get_contents($arquivo);
     $array = Sessao::unserialize_session($string);
     if (isset($array['foto'])) {
         if ($array['foto'] != '') {
             $caminho = PASTA_IMAGENS . 'sessao' . SEPARADOR . $array['foto'];
             if (file_exists($caminho)) {
                 unlink($caminho);
             }
         }
     }
 }
Example #9
0
 public static function temPermissao($acesso, $redireciona = true)
 {
     if (isset($_SESSION['permissao']) && Sessao::logado() || Sessao::eSuperAdm(false)) {
         if (in_array($acesso, $_SESSION['permissao']) || Sessao::eSuperAdm(false)) {
             return true;
         } else {
             if ($redireciona) {
                 header("Location: sistema.php?action=paginaprotegida");
             } else {
                 return false;
             }
         }
     } else {
         if ($redireciona) {
             header("Location: sistema.php?action=paginaprotegida");
         } else {
             return false;
         }
     }
 }
 function editar()
 {
     $tipo = Sessao::pegar('tipo');
     if ($tipo == '0') {
         header('location: ' . URL);
     } else {
         $id = Sessao::pegar('id');
         $this->modelo->obrigatorios = array('nome');
         $this->modelo->tipos['senha'] = 'senhaNova';
         $this->campos['senha'] = 'Nova Senha';
         if (isset($_POST['nome'])) {
             $campos['nome'] = $_POST['nome'];
             if ($_POST['senha'] != '') {
                 $campos['senha'] = $_POST['senha'];
             }
             $this->modelo->atualizar($id, $campos);
         }
         $this->dados['usuario'] = $this->modelo->pesquisarId($id, array('nome'));
     }
 }
Example #11
0
 public static function iniciar()
 {
     $s = SessaoController::porUsuario();
     if ($s) {
         if ($s->getSize() <= 3) {
             if ($s->getSize() == 3) {
                 $s1 = Sessao::fromArray($s->getElement(0));
                 $s1->setCodigo(UsuarioController::get("codigo"));
                 $o = $s1->refresh();
                 if ($o) {
                     SessaoController::gerar_token();
                 }
             } else {
                 self::$sessao->setUsuario(UsuarioController::get("id"));
                 self::$sessao->setCodigo(UsuarioController::get("codigo"));
                 $o = self::$sessao->persistir();
                 if ($o) {
                     SessaoController::gerar_token();
                 }
             }
         }
     }
 }
Example #12
0
 public function show()
 {
     // obtém objetos da sessão
     $oPeriodo = Sessao::getObject("oPeriodo");
     $oProf = Sessao::getObject("oProf");
     $oBanco = $this->model->getBanco($oProf->getCodProfFuncao());
     $vInicio = new DateTime($oPeriodo->getInicial());
     $this->view->addFile("TOPO", "topo.html");
     // cabeçalho
     $vTitulo = ":: BANCO DE HORAS :: " . $vInicio->format("m") . "/" . $vInicio->format("y") . " :: " . $oProf->getMatricula() . " - " . $oProf->getNome() . " :: " . $oProf->getFuncao();
     $this->view->setValue("TITULO", $vTitulo);
     foreach ($oBanco as $row) {
         if ($vBool) {
             $vBool = false;
             $vCor = "#ffffff";
         } else {
             $vBool = true;
             $vCor = "#f4f4f3";
         }
         $this->view->setValue("COR", $vCor);
         $this->view->setValue("PERIODO", $row->getPeriodo());
         $this->view->setValue("EXTRA50", $row->getHorhex50());
         $this->view->setValue("EXTRA100", $row->getHorhex100());
         $this->view->setValue("HORNORMAIS", $row->getHornormais());
         $this->view->setValue("TOTALTRABALHADO", $row->getHortrabalhadas());
         $this->view->setValue("HORASATRABALHAR", $row->getHoratrabalhar());
         $this->view->setValue("SALDODOPERIODO", $row->getHorsaldo());
         $this->view->setValue("HORASPAGAS", $row->getHorpagas());
         $this->view->setValue("SALDOACUMULADO", $row->getHoracumuladas());
         $this->view->parseBlock("BLOCK_BANCO_HORAS", true);
         $vSaldo = $row->getHoracumuladas();
     }
     $this->view->setValue("SALDO", $vSaldo);
     $this->view->addFile("FOOTER", "rodape.html");
     $this->view->show();
 }
Example #13
0
<?php

require_once "../controle/controle.php";
Sessao::LoginNecessario();
if (isset($_GET["id"]) and $_GET["id"]) {
    $veiculo = Veiculo::Consultar($_GET["id"]);
    if ($veiculo) {
        $veiculo->Excluir();
        Sessao::setMensagem("Veiculo com ID = {$_GET['id']} excluido");
    } else {
        Sessao::setMensagem("Veiculo com ID = {$_GET['id']} não existe");
    }
    Sessao::Retornar();
}
Example #14
0
<?php

require 'common.php';
$msgerro = null;
if (array_key_exists('map', $_GET) && array_key_exists('personagem', $_GET)) {
    $id_mapa = intval($_GET['map']);
    if ($id_mapa <= 0) {
        $msgerro = 'Selecione o mapa.';
    }
    $id_personagem = intval($_GET['personagem']);
    if ($id_personagem <= 0) {
        $msgerro = 'Selecione o personagem.';
    }
    if (is_null($msgerro)) {
        $id_sessao = Sessao::iniciarSessaoSolo($id_mapa, $id_personagem);
        header('Location: sessao.php?s=' . $id_sessao . '&id=' . $id_personagem);
        exit;
    }
}
require 'header.php';
if (!is_null($msgerro)) {
    ?>
<div class="row">
    <div class="twelve columns">
        <div class="alert-box alert"><?php 
    echo $msgerro;
    ?>
</div>
    </div>
</div>
<?php 
<?php

include_once '../../../config.php';
if (Sessao::eSuperAdm() && isset($_POST)) {
    try {
        $retorno = array('status' => 'NO');
        if (isset($_POST['idCredenciado'])) {
            $acesso = new AcessoCredenciado(Conf::pegCnxPadrao());
            $acesso->liberar($_POST);
            $retorno = array('status' => count($_POST) > 1 ? 'OK' : 'NO');
        }
    } catch (PDOException $e) {
        $retorno = array('status' => 'ERRO');
    }
} else {
    $retorno = array('status' => 'PERMISSAO');
}
echo json_encode($retorno);
Example #16
0
<?php

include_once 'config.php';
if (Sessao::existeUsuarioLogado()) {
    $_SESSION['app'] = 'BACK';
    ob_start("ob_gzhandler");
    ?>
<!DOCTYPE html>
<html lang="en">
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
        <meta charset="utf-8" />
        <title>E-Imóves Admin</title>

        <meta name="description" content="overview &amp; stats" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0" />

        <!-- bootstrap & fontawesome -->
        <link rel="stylesheet" href="css/backend/bootstrap.min.css" />
        <link rel="stylesheet" href="css/backend/font-awesome.min.css" />

        <!-- page specific plugin styles -->

        <!-- text fonts -->
        <link rel="stylesheet" href="css/backend/ace-fonts.css" />

        <!-- ace styles -->
        <link rel="stylesheet" href="css/backend/ace.min.css" />

        <!--[if lte IE 9]>
                <link rel="stylesheet" href="../assets/css/ace-part2.min.css" />
Example #17
0
<?php

include_once 'app/view/backend/menupadrao.php';
Sessao::eSuperAdm();
?>

<div class="main-content">

<form action="javascript: void(0)" id="frmTipoAnuncio" class="formpadrao">    
    <fieldset><h1 style="text-align: center;"><strong>Tipos de Anúncio cadastrados</strong></h1><hr /><br />
    <p><strong>Consultar tipo:</strong><br />
    <input type="text" id="txtConsulta" name="txtConsulta" size="70" />&nbsp;
    <button id="btnConsultar" class="button medium white" name="btnConsultar"><strong>Consultar</strong></button>&nbsp;&nbsp;&nbsp;
    <button id="btnNovo" class="button medium blue" name="btnNovo"><strong>Novo tipo</strong></button></p><br />
    <div id="dados">   
        <div id="registros" style="text-align: right;">0 registro(s) encontrado(s).</div>
        <table id="tblTipos" class="tabelapadrao ajustar">
            <thead>
            <tr>
                <th>#</th>
                <th>Descrição</th>                
                <th width="100">Ações</th>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td colspan="3" align="center">Nenhum registro encontrado</td>
            </tr>
            </tbody>            
        </table>        
    </div>
Example #18
0
<?php 
include_once 'app/view/backend/menupadrao.php';
Sessao::eSuperAdm();
?>

<div class="main-content">
    
<?php 
if (Sessao::temPermissao('cad_credenciados')) {
    ?>

<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="sistema.php">Início</a>
        </li>
        <li class="active">Credenciados</li>
    </ul>					
</div>

<div class="page-content">

    <div class="page-header">
        <!--<h1 style="text-align: center; font-weight: bold">-->
        <h1>
Example #19
0
<?php

include_once 'app/view/backend/menupadrao.php';
?>

<div class="main-content">
    
<?php 
if (Sessao::temPermissao('planocontaslista')) {
    ?>

<div class="breadcrumbs" id="breadcrumbs">
    <script type="text/javascript">
            try{ace.settings.check('breadcrumbs' , 'fixed')}catch(e){}
    </script>

    <ul class="breadcrumb">
        <li>
            <i class="ace-icon fa fa-home home-icon"></i>
            <a href="sistema.php">Início</a>
        </li>
        <li class="active">Plano de contas</li>
    </ul>					
</div>

<div class="page-content">

    <div class="page-header">
        <!--<h1 style="text-align: center; font-weight: bold">-->
        <h1>
            Plano de contas cadastrados
Example #20
0
<?php

require 'common.php';
$msgerro = null;
if (array_key_exists('acao', $_POST) && $_POST['acao'] == 'nova-sessao') {
    $id_campanha = intval($_POST['id_campanha']);
    if ($id_campanha <= 0) {
        $msgerro = 'Selecione a campanha.';
    }
    $id_mapa = intval($_POST['id_mapa']);
    if ($id_mapa <= 0) {
        $msgerro = 'Selecione o mapa.';
    }
    if (is_null($msgerro)) {
        $id_sessao = Sessao::iniciarSessao();
        header('Location: sessao.php?s=' . $id_sessao);
        exit;
    }
}
/*
if (!Mapa::carregarEstrutura()) {
   $id_mapa = Mapa::inserirEstrutura();
   header('Location: mapa.php?map='.$id_mapa);
   exit();    
}
*/
require 'header.php';
if (!is_null($msgerro)) {
    ?>
<div class="row">
    <div class="twelve columns">
<?php

require_once "../controle/controle.php";
Sessao::LoginNecessario();
$motoristas = Motorista::Listar();
$viagem_id = @intval($_GET["viagem_id"]);
// Executar código da visão
ob_start();
include "../visoes/viagem_escolher_motorista.php";
$conteudo = ob_get_contents();
ob_end_clean();
// Gerar HTML e mostrar
include "../visoes/layout.php";
Example #22
0
<?php

Sessao::temPermissao('gerusuario');
include_once 'app/view/backend/menuusuario.php';
$usuario = new Usuario(Conf::pegCnxPadrao());
$usuario->setIdUsuario(isset($_GET['id']) ? (int) $_GET['id'] : 0);
$usuario->setIdPessoaProprietario($_SESSION['idPessoaProprietario']);
$usuario->preencheObj();
?>

<div class="main-content">    
    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>
        <ul class="breadcrumb">
            <li>
                <i class="ace-icon fa fa-home home-icon"></i>
                <a href="sistema.php">Início</a>
            </li>
            <li class="active">Permissões do usuário</li>
        </ul>					
    </div>

    <div class="page-content">

        <div class="page-header">
            <!--<h1 style="text-align: center; font-weight: bold">-->
Example #23
0
<?php

require_once "../controle/controle.php";
Sessao::LoginNecessario();
$mensagem = Sessao::getMensagem();
if (isset($_GET["id"]) and $_GET["id"]) {
    $veiculo = Veiculo::Consultar($_GET["id"]);
    if (!$veiculo) {
        echo "Veiculo com ID = {$_GET['id']} não existe";
        die;
    }
    $titulo = "Detalhes do veiculo";
} elseif (isset($_SESSION["veiculo"]) and $_SESSION["veiculo"]) {
    $veiculo = $_SESSION["veiculo"];
    unset($_SESSION["veiculo"]);
    $titulo = "Cadastrar veiculo";
} else {
    $veiculo = new Veiculo();
    $titulo = "Cadastrar veiculo";
}
// Executar código da visão
ob_start();
include "../visoes/veiculo_form.php";
$conteudo = ob_get_contents();
ob_end_clean();
// Gerar HTML e mostrar
include "../visoes/layout.php";
Example #24
0
<?php

Sessao::temPermissao('anunciocad');
include_once 'app/view/backend/menupadrao.php';
$anuncio = new Anuncio(Conf::pegCnxPadrao());
$titulo = 'Anunciar';
$temImagens = false;
if (isset($_GET['idanuncio'])) {
    $titulo = 'Editar anuncio';
    $anuncio->set_idPessoaProprietario($_SESSION['idPessoaProprietario']);
    $anuncio->setIdAnuncio($_GET['idanuncio']);
    $anuncio->preecheObjeto();
    $temImagens = sizeof($anuncio->get_imagens()) > 0;
}
$imovel = new Imovel(Conf::pegCnxPadrao());
$imovel->setIdPessoaProprietario($_SESSION['idPessoaProprietario']);
$imovel->setIdImovel($anuncio->getIdImovel());
$imoveis = $imovel->getSemAnuncio();
?>

<div class="main-content">

    <div class="breadcrumbs" id="breadcrumbs">
        <script type="text/javascript">
            try {
                ace.settings.check('breadcrumbs', 'fixed')
            } catch (e) {
            }
        </script>

        <ul class="breadcrumb">
Example #25
0
<?php

require_once dirname(__FILE__) . "/sessao.php";
function __autoload($class = null)
{
    if ($class) {
        include_once dirname(__FILE__) . "/../modelos/{$class}.php";
    }
}
Sessao::Iniciar();
Example #26
0
<?php

if (Sessao::temPermissao('imovellista')) {
    ?>
<form action="javascript: void(0)" id="frmConImovel" class="formpadrao">    
    <fieldset><h1 style="text-align: center;"><strong>Imóveis cadastrados</strong></h1><hr /><br />
    <p><strong>Consultar imóvel:</strong><br />
    <input type="text" id="txtConsulta" name="txtConsulta" size="70" />&nbsp;
    <button id="btnConsultar" class="button medium white" name="btnConsultar"><strong>Consultar</strong></button>&nbsp;&nbsp;&nbsp;
    <button id="btnNovo" class="button medium blue" name="btnNovo"><strong>Novo imóvel</strong></button></p><br />
    <div id="dados">   
        <div id="registros" style="text-align: right;">0 registro(s) encontrado(s).</div>
        <table id="tblImoveis" class="tabelapadrao ajustar">
            <thead>
            <tr>
                <th>#</th>
                <th>Código</th>
                <th>Categoria</th>
                <th>Descrição</th>
                <th>Cadastro</th>                
                <th>Ações</th>
            </tr>
            </thead>
            <tbody>            
            </tbody>            
        </table>        
    </div>
    <div class="carregando"><img src="images/ajax-loader.gif"><br />carregando...</div>
    </fieldset>
    <div id="fundo">
        <div id="janela" class="grid_12">
Example #27
0
            $limite_personagem = intval($_POST['limite_personagem']);
        }
        if ($id_mapa <= 0) {
            $msgerro = 'Selecione o mapa.';
        }
        if ($id_personagem <= 0) {
            $msgerro = 'Selecione o personagem.';
        }
        if ($tempo_turno <= 0) {
            $msgerro = 'Deve ter um tempo de turno.';
        }
        if ($limite_personagem <= 1) {
            $msgerro = 'A quantidade de personagens de ser maior que 1.';
        }
        if (is_null($msgerro)) {
            $id_sessao = Sessao::iniciarSessaoGrupo($id_mapa, $id_personagem, $tempo_turno, $limite_personagem);
            Feed::novaSessao($id_sessao);
            header('Location: perfil.php');
            exit;
        }
    }
}
require 'header.php';
?>
<form method="POST">
<?php 
if (!is_null($msgerro)) {
    ?>
<div class="row">
    <div class="twelve columns">
        <div class="alert-box alert"><?php 
Example #28
0
    eval("\$controller->" . $acao . $par . ";");
}
/*
 * Executa depois da acao
 */
$controller->afterAction();
/*
 * cria as variaveis para a view
 */
foreach ($controller->vars_for_view as $n => $v) {
    ${$n} = $v;
}
/*
 * instancia a classe sessao para a view
 */
$sessao = new Sessao();
$flash_mensagem = $sessao->readFlash();
/*
 * instancia o helper $html e $form
 */
$html = new Html();
$form = new Form(get_class($controller));
/*
 * DebugSQL
 */
$d = Debug::singleton();
$sqlDebug = $d->sql;
/*
 * chama a view
 */
$view_file = $views_folder . $controlador . "/" . $acao . ".phtml";
Example #29
0
                            </div>
                        </div>
                        <div id="lblDescricao" class="form-group">
                            <label for="descricao" class="col-sm-2 control-label no-padding-right" style="font-weight: bold;">Nome do Banco:</label>
                            <div class="col-sm-9">
                                <input type="text" id="descricao" class="col-xs-10 col-sm-5 obrigatorio" name="descricao" value="<?php 
echo $banco->getDescricao();
?>
" maxlength="200" title="Nome do banco"/>
                            </div>
                        </div>
                        <hr />
                        <div id="divButoes"><br />
                        
                        <?php 
if (Sessao::temPermissao('bancoslista', false)) {
    ?>
                            <button class="btn btn-info" type="button" id="btnLista" name="btnLista">
                                <i class="ace-icon fa fa-arrow-left icon-on-right bigger-125"></i>
                                <strong>Bancos cadastrados</strong>
                            </button>&nbsp;&nbsp;
                        <?php 
}
?>
                            
                        <button class="btn btn-light" type="button" id="btnNovo" name="btnNovo">
                            <i class="ace-icon fa fa-pencil-square-o bigger-125"></i>
                            <strong>Novo</strong>
                        </button>&nbsp;&nbsp;&nbsp;&nbsp;
                        
                        <button class="btn btn-success" type="button" id="btnSalvar" name="btnSalvar">
Example #30
0
        <div class="col-xs-12">
            <!-- PAGE CONTENT BEGINS -->
            <div class="row">
                <div class="col-xs-12"><br />
                    
                    <?php 
echo Utilitarios::exibirMensagem();
?>
                    
                    <input type="text" id="txtConsulta" class="input-large" placeholder="Pesquisar banco" />
                    
                    <button type="button" id="btnConsultar" class="btn btn-info btn-sm">
                        <i class="ace-icon fa fa-search icon-on-right bigger-110"></i><strong>Pesquisar</strong>
                    </button>
                    <?php 
if (Sessao::temPermissao('bancoscad', false)) {
    ?>
                    &nbsp;&nbsp;
                    <button type="button" id="btnNovo" name="btnNovo" class="btn btn-success btn-sm">
                        <i class="ace-icon fa fa-pencil-square-o bigger-110"></i><strong>Novo banco</strong>
                    </button>
                    <?php 
}
?>
                    <div id="registros" style="text-align: right; font-weight: bold; padding: 1% 1% 1% 1%; display: none">0 registro(s) encontrado(s).</div>
                    <table id="tblBancos" class="table table-striped table-bordered table-hover" style="display: none">
                        <thead>
                            <tr>
                                <th>#</th>
                                <th>Código</th>
                                <th>Banco</th>