Exemplo n.º 1
0
 public function editedAction()
 {
     // action body
     $ag_id = $this->getRequest()->getParam('ag_id');
     $ag_id = empty($ag_id) ? 0 : $ag_id;
     $pro = new Application_Model_DbTable_DbProvinces();
     $this->view->provinces = $pro->getProvinceListAll();
     $db_agent = new Application_Model_DbTable_DbAgents();
     $this->view->agent_edit = $db_agent->getAgentEditedById($ag_id);
     if ($this->getRequest()->isPost()) {
         $agentdata = $this->getRequest()->getPost();
         try {
             $db = $db_agent->updateAgent($agentdata);
             Application_Form_FrmMessage::Sucessfull('ការ​បញ្ចូល​​ជោគ​ជ័យ', self::REDIRECT_URL);
         } catch (Exception $e) {
             $this->view->msg = 'ការ​បញ្ចូល​មិន​ជោគ​ជ័យ';
         }
     }
 }