Example #1
0
 public function ajaxDesfazerInteresseAction()
 {
     if (!$this->autenticacao(true)) {
         return;
     }
     if ($this->getRequest()->isPost()) {
         $sessao = Zend_Auth::getInstance()->getIdentity();
         $idPessoa = $sessao["idPessoa"];
         $model = new Application_Model_EventoDemanda();
         $id = (int) $this->getRequest()->getPost('id_evento');
         try {
             $where = array("evento = ?" => $id, "id_pessoa = ?" => $idPessoa);
             $model->delete($where);
             $this->view->ok = true;
             $this->view->msg = _('Bookmark successfully removed.');
         } catch (Exception $e) {
             $this->view->ok = false;
             $this->view->error = _('An unexpected error ocurred.<br/> Details:&nbsp;') . $e->getMessage();
         }
     } else {
         $this->view->ok = false;
         $this->view->error = _("The request can not be completed.");
     }
 }