示例#1
0
 public function editAction()
 {
     $id = $this->getRequest()->getParam("id");
     $db = new customer_Model_DbTable_DbCustomer();
     $row = $db->getCustomerById($id);
     $this->view->icon = $row["icon"];
     if ($this->getRequest()->isPost()) {
         $data = $this->getRequest()->getPost();
         //print_r($data);exit();
         if (isset($data['save'])) {
             $db->updat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/customer/index/edit/id/' . $id);
         }
         if (isset($data['save_add'])) {
             $db->updat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/customer/index/add');
         }
         if (isset($data['save_close'])) {
             $db->updat($data, $id);
             Application_Form_FrmMessage::message("ការកែប្រែបានជោគជ័យ");
             Application_Form_FrmMessage::redirectUrl('/customer');
         } elseif (isset($data["km"]) == 2) {
             $dbs = new Application_Model_DbTable_DbSiteLanguages();
             $ids = 2;
             $lang = $dbs->getbyid($ids);
             $session_lang = new Zend_Session_Namespace('lang');
             $session_lang->unlock();
             $session_lang->lang_id = $lang['id'];
             $session_lang->lang = $lang['language'];
             //print_r($lang);exit();
         } elseif (isset($data["en"]) == 1) {
             $dbs = new Application_Model_DbTable_DbSiteLanguages();
             $ids = 1;
             $lang = $dbs->getbyid($ids);
             $session_lang = new Zend_Session_Namespace('lang');
             $session_lang->unlock();
             $session_lang->lang_id = $lang['id'];
             $session_lang->lang = $lang['language'];
             //$this->_redirect('/login');
             //exit();
         }
     }
     $form = new customer_Form_FrmCustomer();
     $this->view->frmcate = $form->FrmCustomer($row);
 }
 public function addAction()
 {
     //$this->_helper->layout()->disableLayout();
     $frm = new customer_Form_FrmCustomer();
     $this->view->form = $frm->Frmcustomer();
 }
 function editAction()
 {
     $frm = new customer_Form_FrmCustomer();
     $this->view->form = $frm->Frmcustomer();
 }