예제 #1
0
 public function viewGetHocHamName($id = 0)
 {
     if ($id) {
         $hochamModel = new Front_Model_Hocham();
         $hoc_ham = $hochamModel->fetchRow('hh_id=' . $id . ' and hh_status=1');
         if ($hoc_ham) {
             return $hoc_ham->hh_name;
         }
         return '';
     }
     return '';
 }
예제 #2
0
 public function deleteAction()
 {
     $layoutPath = APPLICATION_PATH . '/templates/' . TEMPLATE_USED;
     $option = array('layout' => 'hethong/layout', 'layoutPath' => $layoutPath);
     Zend_Layout::startMvc($option);
     $translate = Zend_Registry::get('Zend_Translate');
     $this->view->title = 'Quản lý học hàm - ' . $translate->_('TEXT_DEFAULT_TITLE');
     $this->view->headTitle($this->view->title);
     $id = $this->_getParam('id', 0);
     $hochamModel = new Front_Model_Hocham();
     $error_message = array();
     $hh_info = $hochamModel->fetchRow('hh_id=' . $id);
     if (!$hh_info) {
         $error_message[] = 'Không tìm thấy thông tin.';
     }
     if ($this->_request->isPost()) {
         $del = $this->getRequest()->getPost('del');
         if ($del == 'Yes') {
             $id = $this->getRequest()->getPost('id');
             $hochamModel->delete('hh_id=' . $id);
         }
         $this->_redirect('hethong/hocham/index/page/' . $this->_page);
     }
     $this->view->hh_info = $hh_info;
     $this->view->error_message = $error_message;
 }