public function xoaTaiKhoanAction() { $id = $this->params('id'); $user_table = $this->getServiceLocator()->get('Permission\\Model\\UserTable'); $user = $user_table->getUserByArrayConditionAndArrayColumn(array('user_id' => $id, 'state' => 1), array()); if (!$user) { $this->flashMessenger()->addErrorMessage('Tài khoản không tồn tại'); return $this->redirect()->toRoute('tai_khoan'); } else { $user_moi = new User(); $user_moi->exchangeArray($user[0]); $user_moi->setState(0); $user_table->saveUser($user_moi); $this->flashMessenger()->addSuccessMessage('Chúc mừng, xóa tài khoản thành công!'); return $this->redirect()->toRoute('tai_khoan'); } }