Ejemplo n.º 1
0
 public function index()
 {
     if (!Session::get('autenticado')) {
         $this->redirecionar('login');
     }
     $this->view->titulo = "Pagina Incial";
     $this->view->setCss(array("css"));
     $this->redirecionar('dashboard');
 }
Ejemplo n.º 2
0
 public function index($pagina = FALSE)
 {
     /*
      * @var
      */
     //$this->view->setJs(array("novo"));
     if (!$this->filtraInt($pagina)) {
         $pagina = false;
     } else {
         $pagina = (int) $pagina;
     }
     if (!Session::get('autenticado')) {
         $this->redirecionar();
     }
     $paginador = new \vendor\paginador\Paginador();
     $this->view->titulo = "Alarmes";
     $this->view->alarmes = $paginador->paginar($this->alarme->listaAll(), $pagina, 5);
     $this->view->paginacao = $paginador->getView('paginacao', 'alarmencc/index');
     if ($this->getInt('enviar') == 1) {
         $this->view->dados = $_POST;
         if (!$this->getSqlverifica('criated')) {
             $this->view->erro = "Porfavor Introduza o primeiro nome do cliente ";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('severity')) {
             $this->view->erro = "Porfavor Introduza o segundo nome do cliente ";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('device_service')) {
             $this->view->erro = "POrfavor Introduza um endereço ou morada  valido";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('details')) {
             $this->view->erro = "POrfavor Introduza um endereço ou morada  valido";
             $this->view->renderizar("novo");
             exit;
         }
         $this->alarme->setCriated($this->getSqlverifica('criated'));
         $this->alarme->setSeverity($this->getSqlverifica('severity'));
         $this->alarme->setDeviceService($this->getSqlverifica('device_service'));
         $this->alarme->setDetails($this->getSqlverifica('details'));
         $this->alarme->setData(date("Y-m-d"));
         $this->alarme->setIdusario(Session::get('id'));
         if ($this->alarme->Insert($this->alarme)) {
             $this->view->erro = "erro ao criar alarme";
             $this->view->renderizar("novo");
             exit;
         }
         $this->view->dados = FALSE;
         $this->view->mensagem = "A sua conta foi criada com Sucesso";
     }
     $this->view->renderizar("index");
 }
Ejemplo n.º 3
0
 public function index()
 {
     if (Session::get('id')) {
         $this->redirecionar("dashboard");
     } else {
         $this->view->setJs(array("novo"));
         $this->view->setCss(array("style"));
         $this->view->titulo = "Iniciar Sessão";
         if ($this->getInt('enviar') == 1) {
             $this->dados = $_POST;
             if (!$this->getSqlverifica('login')) {
                 $this->view->erro = "POrfavor Introduza um nome Valido";
                 $this->view->renderizar("index");
                 exit;
             }
             if (!$this->getSqlverifica('senha')) {
                 $this->view->erro = "POrfavor Introduza uma senha Valida";
                 $this->view->renderizar("index");
                 exit;
             }
             $this->log->setLogin($this->getSqlverifica('login'));
             $this->log->setSenha(Hash::getHash('md5', $this->alphaNumeric('senha'), HASH_KEY));
             // $this->log->setSenha($this->alphaNumeric('senha'));
             $linha = $this->log->Autenticar($this->log);
             if (!$linha) {
                 $this->view->erro = "Usuario ou Palavra Passe Incorreta";
                 $this->view->renderizar("index");
                 exit;
             }
             Session::set("autenticado", true);
             Session::set('nivel', $linha->getNivel());
             Session::set('tema', $linha->getTema());
             Session::set('nome', $linha->getPessoa()->getNome());
             Session::set('pessoa', $linha->getPessoa()->getId());
             Session::set('id', $linha->getId());
             Session::set('time', time());
             if (Session::get('nivel') == "gestor") {
                 $this->redirecionar('dashboard');
             }
             if (Session::get('nivel') == "aluno") {
                 $this->redirecionar("dashboard/aluno/");
             }
             if (Session::get('nivel') == "docente") {
                 $this->redirecionar("dashboard/docente/");
             }
             if (Session::get('nivel') == "administrador") {
                 $this->redirecionar("dashboard/admin/");
             } else {
                 $this->redirecionar('index');
             }
         }
     }
     $this->view->renderizar("index");
 }
 public function index($pagina = FALSE)
 {
     //$this->view->setJs(array("novo"));
     if (!$this->filtraInt($pagina)) {
         $pagina = false;
     } else {
         $pagina = (int) $pagina;
     }
     if (!Session::get('autenticado')) {
         $this->redirecionar();
     }
     $paginador = new \vendor\paginador\Paginador();
     $this->view->titulo = "Turnos";
     $this->view->turno = $paginador->paginar($this->turno->listaAll(), $pagina, 5);
     $this->view->paginacao = $paginador->getView('paginacao', 'alarmencc/index');
     if ($this->getInt('enviar') == 1) {
         $this->view->dados = $_POST;
         if (!$this->getSqlverifica('turno')) {
             $this->view->erro = "Porfavor Introduza o primeiro nome do cliente ";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('inicio')) {
             $this->view->erro = "Porfavor Introduza o segundo nome do cliente ";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('fim')) {
             $this->view->erro = "POrfavor Introduza um endereço ou morada  valido";
             $this->view->renderizar("novo");
             exit;
         }
         if (!$this->getSqlverifica('obs')) {
             $this->view->erro = "POrfavor Introduza um endereço ou morada  valido";
             $this->view->renderizar("novo");
             exit;
         }
         $this->turno->setTurno($this->getSqlverifica('turno'));
         $this->turno->setInicio($this->getSqlverifica('inicio'));
         $this->turno->setFim($this->getSqlverifica('fim'));
         $this->turno->setObs($this->getSqlverifica('obs'));
         $this->turno->setData(date("Y-m-d"));
         $this->turno->setIdUsuario(Session::get('id'));
         if (!$this->turno->Insert($this->turno)) {
             $this->view->erro = "erro ao criar alarme";
             $this->view->renderizar("novo");
             exit;
         }
         $this->view->dados = FALSE;
         $this->view->mensagem = "A sua conta foi criada com Sucesso";
     }
     $this->view->renderizar("index");
 }
Ejemplo n.º 5
0
 public function index()
 {
     if (!Session::get('autenticado')) {
         $this->redirecionar('login');
     }
     $this->view->titulo = "Pagina Incial";
     if (!Session::get('autenticado')) {
         $this->redirecionar('login');
     }
     //        $this->view->setCss(array("css"));
     $this->view->footer = $this->getFooter('footer', 'index');
     $this->view->renderizar("index");
 }
Ejemplo n.º 6
0
 public function gravar($mensagem)
 {
     $arquivo = $this->verificarArquivo();
     $texto = '---------Log Gerado em ' . date('d-m-Y H:m:s') . '------------' . "\n";
     $texto1 = 'IP da Maquina do Usuario: ' . $_SERVER['REMOTE_ADDR'] . "\n";
     $texto2 = 'Usuario: ' . Session::get('nome') . "\n";
     $texto3 = "Acção feita: " . $mensagem . "\n";
     $texto4 = "-------------------------------------------------------------------------------------------------" . "\n";
     $t = $texto . $texto1 . $texto2 . $texto3 . $texto4;
     if (!fwrite($arquivo, $t)) {
         $retorno = TRUE;
     } else {
         $retorno = FALSE;
     }
     fclose($arquivo);
     return $retorno;
 }
Ejemplo n.º 7
0
 public function index()
 {
     $this->view->setJs(array("novo"));
     $this->view->setCss(array("style"));
     $this->view->titulo = "Iniciar Sessão";
     if ($this->getInt('enviar') == 1) {
         $this->dados = $_POST;
         if (!$this->getSqlverifica('login')) {
             $this->view->erro = "POrfavor Introduza um nome Valido";
             $this->view->renderizar("index");
             exit;
         }
         if (!$this->getSqlverifica('senha')) {
             $this->view->erro = "POrfavor Introduza uma senha Valida";
             $this->view->renderizar("index");
             exit;
         }
         $this->log->setLogin($this->getSqlverifica('login'));
         $this->log->setSenha(Hash::getHash('md5', $this->alphaNumeric('senha'), HASH_KEY));
         $linha = $this->log->Autenticar($this->log);
         if (!$linha) {
             $this->view->erro = "Usuario ou Palavra Passe Incorreta";
             $this->view->renderizar("index");
             exit;
         }
         if ($linha->getStatus() != 'on') {
             $this->view->erro = "Esse Usuario Não Esta Activo";
             $this->view->renderizar("index");
             exit;
         }
         Session::set("autenticado", true);
         Session::set('nivel', $linha->getNivel());
         Session::set('nome', $linha->getNome());
         Session::set('id', $linha->getId());
         Session::set('time', time());
         if (Session::get('nivel') == "admin") {
             $this->redirecionar('dashboard');
         } else {
             $this->redirecionar();
         }
     }
     $this->view->renderizar("index");
 }
Ejemplo n.º 8
0
 public function alteraSenha()
 {
     if ($this->getInt('enviar') == 1) {
         $this->usuario->setSenha($_POST['senha']);
         $this->usuario->setId(Session::get('id'));
         if ($this->usuario->editarSenha($this->usuario)) {
             $this->view->mensagem = "Senha alterada com sucesso";
             $this->redirecionar("aluno/editar/" . Session::get('id'));
             exit;
         } else {
             $this->view->erro = "Erro ao alterar senha";
             $this->view->renderizar('senha');
             exit;
         }
     } else {
         $this->view->renderizar('senha');
     }
 }
Ejemplo n.º 9
0
 public function adicionar1($dados = FALSE)
 {
     if ($this->getInt('enviar')) {
         Session::get('pessoa');
         $id = $this->docente->pesquisar(Session::get('pessoa'));
         $_POST['docente'] = $id->getId();
         $dados = $_POST;
         if (!$this->getSqlverifica('curso')) {
             $this->view->erro = "Porfavor Selecciona um curso";
             $this->view->renderizar('novo1');
             exit;
         }
         if (!$this->getSqlverifica('modulo')) {
             $this->view->erro = "Porfavor Selecciona um modulo";
             $this->view->renderizar('novo1');
             exit;
         }
         if (!$this->getSqlverifica('data')) {
             $this->view->erro = "Porfavor Selecciona uma data";
             $this->view->renderizar('novo1');
             exit;
         }
         if (empty($_FILES['arquivo']["name"])) {
             $this->view->erro = "Porfavor Selecciona um arquivo";
             $this->view->renderizar('novo1');
             exit;
         }
         $diretorio = "upload/";
         move_uploaded_file($_FILES['arquivo']["tmp_name"], $diretorio . $_FILES['arquivo']["name"]);
         $this->materia->setNome($diretorio . $_FILES['arquivo']["name"]);
         $this->materia->setData($dados['data']);
         $p = $this->materia->pesquisarNome($diretorio . $_FILES['arquivo']["name"]);
         if ($p) {
             //$this->view->sms = "Já foi publicado um arquivo com esse nome";
             $this->view->renderizar('novo1');
             exit;
         }
         if ($this->materia->adiciona($this->materia, $dados)) {
             $this->view->mensagem = "Dados guardado com sucesso";
             $this->view->sms = "Dados guardado com sucesso";
             $this->view->renderizar('novo1');
             exit;
         } else {
             $this->view->sms = "Erro ao guardar dados";
             $this->view->renderizar('novo1');
             exit;
         }
     }
     $this->view->sms = "Adicionar Nova Matéria de Formação";
     $this->view->renderizar("novo1");
 }
Ejemplo n.º 10
0
 public function alteraTema()
 {
     $this->usuario->setId(Session::get('id'));
     $this->usuario->setTema($_POST['tema']);
     if ($this->usuario->editarTema($this->usuario)) {
         echo json_encode(array("mensagem" => "Tema alterado. Reiniciando..."));
         Session::destruir();
     } else {
         echo json_encode(array("mensagem" => "Erro ao alterar Tema"));
     }
 }
Ejemplo n.º 11
0
        <div class="navbar navbar-fixed-top">
            <div class="navbar-inner">
                <div class="container-fluid">
                    <a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse"> <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                        <span class="icon-bar"></span>
                    </a>
                    <a class="brand" href="<?php 
URL;
?>
dashboard">Admin Panel</a>
                    <div class="nav-collapse collapse">
                        <ul class="nav pull-right">
                            <li class="dropdown">
                                <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown"> <i class="icon-user"></i> <?php 
print Session::get('nome');
?>
 <i class="caret"></i>

                                </a>
                                <ul class="dropdown-menu">
                                    <li>
                                        <a tabindex="-1" href="#">Perfil</a>
                                    </li>
                                    <li class="divider"></li>
                                    <li>
                                        <a tabindex="-1" href="<?php 
print URL;
?>
login/logof">Logout</a>
                                    </li>
Ejemplo n.º 12
0
                <?php if (Session::get('nivel') == "gestor"): $menu = "dashboard"; ?>
                <a class="brand" href="#">Painel de Gestão</a>

                <?php endif; ?>

                <?php if (Session::get('nivel') == "docente"): $menu = "dashboard/docente/"; ?>
                    <a class="brand" href="#">Painel de Docente</a>

                <?php endif; ?>

                <?php if (Session::get('nivel') == "aluno"): $menu = "dashboard/aluno/"; ?>
                    <a class="brand" href="#">Painel de Aluno</a>

                <?php endif; ?>

                <?php if (Session::get('nivel') == "administrador"): $menu = "dashboard/admin/"; ?>
                    <a class="brand" href="#">Painel de Administrador</a>

                <?php endif; ?>


        </h1>
        <h2 class="section_title"><?php if (isset($this->titulo)): echo $this->titulo;
                endif; ?></h2>
    </hgroup>
</header> <!-- end of header bar -->

<section id="secondary_bar" class="">
    <div class="user">
        <!-- <a class="logout_user" href="#" title="Logout">Logout</a> -->
    </div>
Ejemplo n.º 13
0
 public function pesquisaDocenteNotas()
 {
     $id = $this->docente->pesquisar(Session::get('pessoa'));
     $t = $this->dm->listagem($id->getId());
     echo json_encode($t);
 }