Ejemplo n.º 1
0
 public function indexAction()
 {
     $db_dept = new Global_Model_DbTable_DbDept();
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         $search = array('title' => $_data['title'], 'status' => $_data['status_search']);
         $limit = $dept_session->limit;
     } else {
         $search = '';
     }
     $rs_rows = $db_dept->getAllFacultyList($search);
     $glClass = new Application_Model_GlobalClass();
     $rs_rows = $glClass->getImgActive($rs_rows, BASE_URL, true);
     $list = new Application_Form_Frmtable();
     $collumns = array("FACULTY_ENNAME", "FACULTY_KHNAME", "SHORTCUT", "MODIFY_DATE", "STATUS", "BY_USER");
     $link = array('module' => 'global', 'controller' => 'faculty', 'action' => 'edit');
     $this->view->list = $list->getCheckList(0, $collumns, $rs_rows, array('en_name' => $link));
     $frm = new Global_Form_FrmSearchMajor();
     $frm = $frm->FrmDepartment();
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->frm_search = $frm;
     $frm = new Application_Form_FrmOther();
     $frm = $frm->FrmAddDept(null);
     Application_Model_Decorator::removeAllDecorator($frm);
     $this->view->add_dept = $frm;
 }
 public function editMajorAction()
 {
     $id = $this->getRequest()->getParam("id");
     if ($this->getRequest()->isPost()) {
         try {
             $_data = $this->getRequest()->getPost();
             $_dbmodel = new Global_Model_DbTable_DbDept();
             $_dbmodel->updatMajorById($_data);
             Application_Form_FrmMessage::Sucessfull("ការកែប្រែដោយជោគជ័យ", "/global/index/major-list");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("Application Error");
             Application_Model_DbTable_DbUserLog::writeMessageError($e->getMessage());
         }
     }
     if (!empty($id)) {
         $frm = new Application_Form_FrmOther();
         $db_model = new Global_Model_DbTable_DbDept();
         $row = $db_model->getMajorById($id);
         $frm->FrmAddMajor($row);
         Application_Model_Decorator::removeAllDecorator($frm);
         $this->view->frm_major = $frm;
     } else {
     }
 }
Ejemplo n.º 3
0
 function addmajorAction()
 {
     if ($this->getRequest()->isPost()) {
         $_data = $this->getRequest()->getPost();
         $_dbmodel = new Global_Model_DbTable_DbDept();
         $_data['dept_id'] = $_data['facultyid'];
         $_data['major_enname'] = $_data['major_en'];
         $_data['major_khname'] = $_data['major_kh'];
         $_data['shortcut'] = $_data['shortcut'];
         $_data['status'] = 1;
         $_id = $_dbmodel->AddNewMajor($_data);
         print_r(Zend_Json::encode($_id));
         exit;
     }
 }