public function visualizar($id) { $v = $this->_getValidacao(); $v->setRules($id, 'required', 'ID'); $v->validar(); $objUsu = \model\factory\Factory::montar('usuario'); $objUsu->setId($id); return $this->_getRepositorio()->visualizar($objUsu); }
public function getObjetoPermissao() { try { return \model\factory\Factory::montar('controladorpermissao')->visualizar($this->perm_id); } catch (\lib\validacao\Excecao $e) { throw new \lib\validacao\Excecao($e->getMesage()); } catch (\model\permissao\Excecao $e) { throw new \model\permissao\Excecao($e->getMesage()); } catch (\model\conexao\Excecao $e) { throw new \model\conexao\Excecao($e->getMesage()); } }
public function alterar(Modulo $objModulo) { $v = $this->_getValidacao(); $v->setRules($objModulo->getId(), 'required', 'ID'); $v->setRules($objModulo->getNome(), 'required', 'NOME'); $v->setRules($objModulo->getStatus(), 'required', 'STATUS'); $v->validar(); $this->_getRepositorio()->alterar($objModulo); $arrModulos = self::listarAtivos(); $arrPermissao = \model\factory\Factory::montar('controladorpermissao')->listarAtivos(); return \lib\auxiliar\Auxiliar::geraConstantesConfig($arrModulos, $arrPermissao); }
public function visualizar($id) { $v = $this->_getValidacao(); $v->setRules($id, 'required', 'ID'); $v->validar(); $objPer = \model\factory\Factory::montar('perfil'); $objPer->setId($id); $retorno = $this->_getRepositorio()->visualizar($objPer); if ($retorno->getId() == null) { throw new \model\perfil\Excecao('Perfil não existe'); } return $retorno; }
public function getObjetoAcoes() { try { $objPerfil = \model\factory\Factory::montar('perfil'); $objPerfil->setId($this->id); return \model\factory\Factory::montar('controladoracao')->listarPorPerfil($objPerfil); } catch (\lib\validacao\Excecao $e) { throw new \model\validacao\Excecao($e->getMesage()); } catch (\model\perfil\Excecao $e) { throw new \model\perfil\Excecao($e->getMesage()); } catch (\model\conexao\Excecao $e) { throw new \model\conexao\Excecao($e->getMesage()); } }
public function getObjetoPerfil() { try { return \model\factory\Factory::montar('controladorperfil')->visualizar($this->perfil); } catch (\lib\validacao\Excecao $e) { die($e->getMesage()); } catch (\model\perfil\Excecao $e) { die($e->getMesage()); } catch (\model\conexao\Excecao $e) { die($e->getMesage()); } }
private function _getRepositorio() { return \model\factory\Factory::montar('repositorioacao'); }
private function _getConn() { return \model\factory\Factory::montar('conexao')->getConn(); }
<label for="strConfirmeSenha">Status</label> <select id="intStatus" class="form-control required" name="intStatus"> <option value="1" <?php echo $objPerfil->getStatus() == 1 ? 'selected="selected"' : ''; ?> >Ativo</option> <option value="0" <?php echo $objPerfil->getStatus() == 0 ? 'selected="selected"' : ''; ?> >Inativo</option> </select> </div> <?php foreach ($arrModulo as $objModulo) { $arrAcao = \model\factory\Factory::montar('controladoracao')->listarPorPerfileModulo($objPerfil, $objModulo); $arrAcoesSelcionadas = array(); foreach ($arrAcao as $objAcao) { $arrAcoesSelcionadas[] = $objAcao->getPermId(); } ?> <div class="form-group col-md-3"> <label for="intModulo[<?php echo $objModulo->getId(); ?> ][]"><?php echo $objModulo->getNome(); ?> </label> <select class="form-control" name="intModulo[<?php echo $objModulo->getId();
<?php \model\usuario\Controlador::redirectLogin(); if (!\lib\auxiliar\Auxiliar::validarAcesso(\lib\constante\Constante::CONTATO, \lib\constante\Constante::ALTERAR)) { \config\Rotas::redirect('home/'); } try { $obj = \model\factory\Factory::montar('controladorcontato')->visualizar($id1); } catch (\lib\validacao\Excecao $e) { die($e->getMessage()); } catch (\model\contato\Excecao $e) { die($e->getMessage()); } catch (\model\conexao\Excecao $e) { die($e->getMessage()); } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; $modulo = 'contato'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Contato </h1> </section> <!-- Main content --> <section class="content"> <div class="row">
<?php \model\usuario\Controlador::redirectLogin(); try { $acao = isset($_POST['action']) ? strtolower($_POST['action']) : ''; if (!empty($acao)) { $obj = \model\factory\Factory::montar('usuario'); $retorno = \model\factory\Factory::montar('controladorusuario'); if ($acao == 'adicionar') { $obj->setNome($_POST['strNome']); $obj->setLogin($_POST['strLogin']); $obj->setEmail($_POST['strEmail']); $obj->setPerfil($_POST['intPerfil']); if (!empty($_POST['strSenha']) && !empty($_POST['strConfirmeSenha'])) { $obj->setSenha($_POST['strSenha']); } if ($_POST['strSenha'] != $_POST['strConfirmeSenha']) { $arrResp = array('status' => 'alert', 'msg' => 'Campo SENHA e COMFIRME SENHA devem ser iguais'); } else { $retorno->adicionar($obj); $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); } } else { if ($acao == 'alterar') { $obj->setId($_POST['intId']); $obj->setNome($_POST['strNome']); $obj->setLogin($_POST['strLogin']); $obj->setEmail($_POST['strEmail']); if (!empty($_POST['intPerfil'])) { $obj->setPerfil($_POST['intPerfil']); }
<?php try { $arrFed = array('status' => 'ok', 'msg' => 'Sucesso!'); $u = \model\factory\Factory::montar('controladorusuario')->logar($_POST['strLogin'], $_POST['strSenha']); } catch (\model\usuario\Excecao $e) { $arrFed = array('status' => 'erro', 'msg' => '' . $e->getMessage() . ''); } catch (\lib\validacao\Excecao $e) { $arrFed = array('status' => 'alert', 'msg' => '' . $e->getMessage() . ''); } catch (\mobel\conexao\Excecao $e) { $arrFed = array('status' => 'erro', 'msg' => '' . $e->getMessage() . ''); } catch (\Exception $e) { $arrFed = array('status' => 'erro', 'msg' => '' . $e->getMessage() . ''); } header('Content-Type: application/json'); echo json_encode($arrFed);
<?php \model\usuario\Controlador::redirectLogin(); try { $acao = isset($_POST['action']) ? strtolower($_POST['action']) : ''; if (!empty($acao)) { $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); $objPer = \model\factory\Factory::montar('permissao'); $retorno = \model\factory\Factory::montar('controladorpermissao'); if ($acao == 'adicionar') { $objPer->setNome($_POST['strNome']); $objPer->setStatus($_POST['intStatus']); $retorno->adicionar($objPer); } else { if ($acao == 'alterar') { $objPer->setId($_POST['intId']); $objPer->setNome($_POST['strNome']); $objPer->setStatus($_POST['intStatus']); $retorno->alterar($objPer); } else { if ($acao == 'apagar') { $objPer->setId($_POST['intId']); $retorno->apagar($objPer); } else { $arrResp = array('status' => 'erro', 'msg' => 'Ação desconhecida'); } } } } } catch (\lib\validacao\Excecao $e) { $arrResp = array('status' => 'alert', 'msg' => '' . $e->getMessage() . '');
<?php \model\usuario\Controlador::redirectLogin(); if (!\lib\auxiliar\Auxiliar::validarAcesso(\lib\constante\Constante::USUARIO, \lib\constante\Constante::ADICIONAR)) { \config\Rotas::redirect('home/'); } try { $arrPerfil = \model\factory\Factory::montar('controladorperfil')->listarAtivos(); } catch (\lib\validacao\Excecao $e) { die($e->getMessage()); } catch (\model\usuario\Excecao $e) { die($e->getMessage()); } catch (\model\conexao\Excecao $e) { die($e->getMessage()); } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; $modulo = 'usuario'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Usuários </h1> </section> <!-- Main content --> <section class="content"> <div class="row">
<?php \model\usuario\Controlador::redirectLogin(); try { $objUsu = \model\factory\Factory::montar('controladorusuario')->visualizar($id1); } catch (\lib\validacao\Excecao $e) { die($e->getMessage()); } catch (\model\usuario\Excecao $e) { die($e->getMessage()); } catch (\model\conexao\Excecao $e) { die($e->getMessage()); } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Meus dados </h1> <ol class="breadcrumb"> <li><a href="<?php echo BASE_URL; ?> /home/"><i class="fa fa-dashboard"></i><?php echo TITULO; ?> </a></li> <li><a href="<?php
} $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); } else { if ($acao == 'alterar') { $obj->setId($_POST['intId']); $obj->setNome($_POST['strNome']); $obj->setStatus($_POST['intStatus']); if ($mod) { \model\factory\Factory::montar('controladoracao')->apagar($obj); foreach ($_POST['intModulo'] as $k => $v) { $objM = \model\factory\Factory::montar('modulo'); $objM->setId($k); foreach ($_POST['intModulo'][$k] as $acao) { $objPerm = \model\factory\Factory::montar('permissao'); $objPerm->setId($acao); \model\factory\Factory::montar('controladoracao')->adicionar($obj, $objM, $objPerm); } } } $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); } else { if ($acao == 'apagar') { $obj->setId($_POST['intId']); $retorno->apagar($obj); } else { $arrResp = array('status' => 'erro', 'msg' => 'Ação desconhecida'); } } } } } catch (\lib\validacao\Excecao $e) {
<?php \model\usuario\Controlador::redirectLogin(); try { $arrUsuarios = \model\factory\Factory::montar('controladorusuario')->listarAtivos(); } catch (\model\usuario\Excecao $e) { $arrUsuarios = null; } catch (\model\conexao\Excecao $e) { $arrUsuarios = null; } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Usuários cadastrados </h1> <ol class="breadcrumb"> <li><a href="<?php echo BASE_URL; ?> /home/"><i class="fa fa-dashboard"></i> Home</a></li> <li><a href="<?php echo BASE_URL; ?> /usuario/">Usuário</a></li> <li class="active">Listando</li> </ol>
<?php \model\usuario\Controlador::redirectLogin(); if (!\lib\auxiliar\Auxiliar::validarAcesso(\lib\constante\Constante::PERMISSAO, \lib\constante\Constante::LISTAR)) { \config\Rotas::redirect('home/'); } try { $arr = \model\factory\Factory::montar('controladorpermissao')->listarAtivos(); $modulo = 'permissao'; } catch (\model\permissao\Excecao $e) { $arr = null; } catch (\model\conexao\Excecao $e) { $arr = null; } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Permissões - <a href="<?php echo BASE_URL; ?> /<?php echo $modulo; ?> /adicionar.php">Adicionar</a> </h1> </section>
<?php \model\usuario\Controlador::redirectLogin(); try { $acao = isset($_POST['action']) ? strtolower($_POST['action']) : ''; if (!empty($acao)) { $obj = \model\factory\Factory::montar('contato'); $retorno = \model\factory\Factory::montar('controladorcontato'); if ($acao == 'adicionar') { $obj->setNome($_POST['strNome']); $obj->setEmail($_POST['strEmail']); $obj->setTelefone($_POST['strTelefone']); $obj->setObservacao($_POST['strObservacao']); $obj->setStatus($_POST['intStatus']); $retorno->adicionar($obj); $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); } else { if ($acao == 'alterar') { $obj->setId($_POST['intId']); $obj->setNome($_POST['strNome']); $obj->setEmail($_POST['strEmail']); $obj->setTelefone($_POST['strTelefone']); $obj->setObservacao($_POST['strObservacao']); $obj->setStatus($_POST['intStatus']); $retorno->alterar($obj); $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso'); } else { if ($acao == 'apagar') { $obj->setId($_POST['intId']); $retorno->apagar($obj); $arrResp = array('status' => 'ok', 'msg' => 'Comando executado com sucesso');
<?php \model\usuario\Controlador::redirectLogin(); if (!\lib\auxiliar\Auxiliar::validarAcesso(\lib\constante\Constante::MODULO, \lib\constante\Constante::LISTAR)) { \config\Rotas::redirect('home/'); } try { $arr = \model\factory\Factory::montar('controladormodulo')->listarAtivos(); } catch (\model\modulo\Excecao $e) { $arr = null; } catch (\model\conexao\Excecao $e) { $arr = null; } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; $modulo = 'modulo'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Módulos - <a href="<?php echo BASE_URL; ?> /<?php echo $modulo; ?> /adicionar.php">Adicionar</a> </h1> </section>
<?php \model\usuario\Controlador::redirectLogin(); if (!\lib\auxiliar\Auxiliar::validarAcesso(\lib\constante\Constante::PERMISSAO, \lib\constante\Constante::ALTERAR)) { \config\Rotas::redirect('home/'); } try { $objPerm = \model\factory\Factory::montar('controladorpermissao')->visualizar($id1); } catch (\lib\validacao\Excecao $e) { die($e->getMessage()); } catch (\model\permissao\Excecao $e) { die($e->getMessage()); } catch (\model\conexao\Excecao $e) { die($e->getMessage()); } include BASE_INCLUDES . DS . 'inc.topo.php'; include BASE_INCLUDES . DS . 'inc.menu.php'; $modulo = 'permissao'; ?> <aside class="right-side"> <!-- Content Header (Page header) --> <section class="content-header"> <h1> Permissão </h1> </section> <!-- Main content --> <section class="content"> <div class="row">