Exemplo n.º 1
0
 public function addAction()
 {
     parent::addAction();
     if ($this->getRequest()->isPost()) {
         try {
             $data = (object) $this->getRequest()->getPost();
             $this->_entity = Advice::create();
             $this->__setData($data);
             $this->_entity->setProcessed(true);
             $this->_entity->save();
             $this->__goBack();
         } catch (Exception $e) {
             $this->view->showMessage($e);
         }
     }
 }
Exemplo n.º 2
0
 public function askQuestionAction()
 {
     $this->_setResponseJSON();
     $this->_result->status = 0;
     if ($this->getRequest()->isPost() && isset($this->_data)) {
         $data = $this->_data;
         $advice = Application_Model_Medical_Advice::create();
         try {
             $advice->setVisitorName($data->visitor_name);
             $advice->setVisitorEmail($data->visitor_email);
             $advice->setVisitorQuestion($data->visitor_question);
             $advice->setProcessed(false);
             $advice->save();
             $this->_result->status = 1;
         } catch (Exception $e) {
         }
     }
 }