예제 #1
0
 public function editAction()
 {
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $_dbmodel = new Application_Model_DbTable_DbDept();
             $_dbmodel->UpdateDepartment($_data);
             Application_Form_FrmMessage::Sucessfull("ការកៃប្រែដោយជោគជ័យ !", "/global/faculty/index");
             //$this->_redirect("");
         } catch (Exception $e) {
             $err = $e->getMessage();
             Application_Form_FrmMessage::message("Application Error!");
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
             echo $e->getMessage();
             exit;
         }
     }
     $id = $this->getRequest()->getParam("id");
     $_db = new Application_Model_DbTable_DbGlobal();
     $_row = $_db->getDeptById($id);
     $frm = new Application_Form_FrmOther();
     $frm->FrmAddDept($_row);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_dept = $frm;
 }
예제 #2
0
 public function indexAction()
 {
     try {
         $_model = new Global_Model_DbTable_DbDept();
         if ($this->getRequest()->isPost()) {
             $_data = $this->getRequest()->getPost();
             //set value for display
             $search = array('txtsearch' => $_data['title'], 'title' => $_data['title'], 'status' => $_data['status_search']);
         } else {
             $search = '';
         }
         $rs_rows = $_model->getAllMajorList($search);
         $glClass = new Application_Model_GlobalClass();
         $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
         $list = new Application_Form_Frmtable();
         $collumns = array("PROGRAM_TITLE", "TYPE", "DISCRIPTION", "SHORTCUT", "MODIFY_DATE", "STATUS", "BY_USER");
         $link = array('module' => 'global', 'controller' => 'major', 'action' => 'edit');
         $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('major_enname' => $link, 'major_khname' => $link));
     } catch (Exception $e) {
         Application_Form_FrmMessage::message("Application Error");
         Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
     }
     $frm = new Application_Form_FrmOther();
     $frm_major = $frm->FrmAddMajor();
     Application_Model_Decorator::removeAllDecorator($frm_major);
     $this->view->add_major = $frm_major;
     $frm_search = new Global_Form_FrmSearchMajor();
     $frm_search = $frm_search->FrmMajors();
     Application_Model_Decorator::removeAllDecorator($frm_search);
     $this->view->frm_search = $frm_search;
     $frm_faculty = $frm->FrmAddDept(null);
     Application_Model_Decorator::removeAllDecorator($frm_faculty);
     $this->view->add_faculty = $frm_faculty;
 }