public function index() { $this->setTela('Relatório'); $groupBy = $this->getParametro('group', 'ano'); $codUsuario = $this->getUsuario()->getCodUsu(); $tarefa = new Tarefa(); $tarefa->setConexao(Conexao::getInstancia()->getConexao()); $report = $tarefa->getRelatorioPeloUsuario($codUsuario, $groupBy); return ['group' => $groupBy, 'relatorio' => $report]; }
public function concluir() { if ($this->isPost()) { try { // Recupera a tarefa $tarefa = new Tarefa(); $tarefa->setConexao(Conexao::getInstancia()->getConexao()); $tarefa->getTarefa($this->getParametro('CodTar')); switch ($this->getParametro('acao')) { case 'salvar': case 'finalizar': $this->salvar($tarefa); break; case 'excluir': $this->excluir($tarefa); break; } } catch (\Exception $e) { $this->setMensagemErro('Erro ao alterar a tarefa: ' . $e->getMessage()); } } $this->redirecionar('/'); }