public function viewGetBangCapName($id = 0) { if ($id) { $bangcapModel = new Front_Model_Bangcap(); $bang_cap = $bangcapModel->fetchRow('bc_id=' . $id . ' and bc_status=1'); if ($bang_cap) { return $bang_cap->bc_name; } return ''; } return ''; }
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ý bằng cấp - ' . $translate->_('TEXT_DEFAULT_TITLE'); $this->view->headTitle($this->view->title); $id = $this->_getParam('id', 0); $bangcapModel = new Front_Model_Bangcap(); $error_message = array(); $bc_info = $bangcapModel->fetchRow('bc_id=' . $id); if (!$bc_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'); $bangcapModel->delete('bc_id=' . $id); } $this->_redirect('hethong/bangcap/index/page/' . $this->_page); } $this->view->bc_info = $bc_info; $this->view->error_message = $error_message; }