/** * Deletar um Curso */ public function excluirAction() { if ($this->getRequest()->isPost()) { if ($this->getRequest()->getPost('cancelar') == '') { $id = $this->getRequest()->getPost('id'); $oCursos = new Application_Model_DbTable_Cursos(); $oCursos->excluirCurso($id); $this->_helper->flashMessenger->addMessage(utf8_encode('Exclusão realizada com sucesso!')); } $this->_helper->redirector('index'); } else { $id = $this->_getParam('id', 0); $oCursos = new Application_Model_DbTable_Cursos(); $this->view->oCursos = $oCursos->getCursos($id); $this->cursosPopulaUniversidadeSelectView(); } }
/** * Chamada ajax para popular o campo de cursos de acordo com a universidade setada */ public function getAjaxContentAction() { $oCursos = new Application_Model_DbTable_Cursos(); $this->view->cursos = $oCursos->getCursosPorUniversidade($this->getRequest()->getPost('universidade_id')); }