public function deleteAction()
 {
     $this->getResponse()->setHeader('Content-Type', 'application/json');
     $this->_helper->viewRenderer->setNoRender(true);
     $this->_helper->layout()->disableLayout();
     $id = $this->_getParam('id');
     try {
         Application_Model_M_Feedback::delById($id);
         $out['errno'] = "0";
     } catch (Zend_Db_Exception $e) {
         $out['errno'] = "1";
     }
     Yy_Utils::jsonOut($out);
 }
Example #2
0
 public function feedbackAction()
 {
     $content = $this->_getParam('content');
     $contact = $this->_getParam('contact');
     if (!$content && !$contact) {
         $out['errno'] = '1';
         $out['msg'] = Yy_ErrMsg_More::getMsg('feedback', $out['errno']);
         Yy_Utils::jsonOut($out);
         return;
     }
     $feedback = new Application_Model_O_Feedback();
     $feedback->setContent($content)->setContact($contact)->setCtime(date('Y-m-d H:i:s'))->setStatus(1);
     try {
         Application_Model_M_Feedback::save($feedback);
         $out['errno'] = '0';
     } catch (Zend_Db_Exception $e) {
         echo $e->getMessage();
         $out['errno'] = '1';
     }
     $out['msg'] = Yy_ErrMsg_More::getMsg('feedback', $out['errno']);
     Yy_Utils::jsonOut($out);
 }
Example #3
0
 public function delete()
 {
     $where = 'id=' . $this->getId();
     return Application_Model_M_Feedback::delete($where);
 }