コード例 #1
0
 public function editAction()
 {
     $id = $this->getRequest()->getParam("id");
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $data["id"] = $id;
             $db = new Global_Model_DbTable_DbTeacher();
             $db->updateTeacher($data);
             Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/global/lecturer");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("EDIT_FAIL");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $db = new Global_Model_DbTable_DbTeacher();
     $row = $db->getTeacherById($id);
     $tsub = new Global_Form_FrmTeacher();
     $frm_techer = $tsub->FrmTecher($row);
     Application_Model_Decorator::removeAllDecorator($frm_techer);
     $this->view->frm_techer = $frm_techer;
     $dbs = new Application_Model_GlobalClass();
     $this->view->subject_opt = $dbs->getsunjectOption();
     $this->view->teacher_subject = $db->getallSubjectTeacherById($id);
 }
コード例 #2
0
 public function editTeacherAction()
 {
     $id = $this->getRequest()->getParam("id");
     $db = new Global_Model_DbTable_DbTeacher();
     $row = $db->getTeacherById($id);
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $data["id"] = $id;
             $db = new Global_Model_DbTable_DbTeacher();
             $db->updateTeacher($data);
             Application_Form_FrmMessage::Sucessfull("EDIT_SUCCESS", "/global/index/teacher-list");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("EDIT_FAIL");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $obj = new Global_Form_FrmTeacher();
     $frm_update = $obj->FrmTecher($row);
     $this->view->update_teacher = $frm_update;
     Application_Model_Decorator::removeAllDecorator($frm_update);
 }
コード例 #3
0
 function editAction()
 {
     $db = new Global_Model_DbTable_DbGroup();
     if ($this->getRequest()->isPost()) {
         try {
             $data = $this->getRequest()->getPost();
             $db->AddNewGroup($data);
             if (!empty($data['save_close'])) {
                 Application_Form_FrmMessage::Sucessfull("ការ​បញ្ចូល​ជោគ​ជ័យ !", '/global/group');
             }
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​ជោគ​ជ័យ !");
         } catch (Exception $e) {
             Application_Form_FrmMessage::message("ការ​បញ្ចូល​មិន​ជោគ​ជ័យ");
             $err = $e->getMessage();
             Application_Model_DbTable_DbUserLog::writeMessageError($err);
         }
     }
     $id = $this->getRequest()->getParam("id");
     $this->view->row = $db->getGroupById($id);
     $db = new Application_Model_DbTable_DbGlobal();
     $this->view->degree = $db->getAllDegree();
     $faculty = $db->getAllMajor();
     array_unshift($faculty, array('id' => -1, 'name' => 'Add New'));
     $this->view->faculty = $faculty;
     $room = $db->getAllRoom();
     array_unshift($room, array('id' => -1, 'name' => 'Add New'));
     $this->view->room = $room;
     $db = new Application_Model_GlobalClass();
     $this->view->subject_opt = $db->getTeachersunjectOption();
     $tsub = new Global_Form_FrmTeacher();
     $frm_techer = $tsub->FrmTecher();
     Application_Model_Decorator::removeAllDecorator($frm_techer);
     $this->view->frm_techer = $frm_techer;
 }