public function indexAction() { //检查权限 $this->verify(__METHOD__); $show['pagename'] = '科目列表'; $grade = $this->getRequest()->getQuery('grade', ''); $perpage = 20; $page = intval($this->getRequest()->getQuery('page')); $page = $page ? $page : 1; $data = $count_opt = array(); $option = array('condition' => '', 'order' => 'Grade asc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage)); if (!empty($grade)) { $option['condition'] .= "grade = ?"; $option['bind'] = array($grade); $count_opt = array('condition' => "grade = ?", 'bind' => array($grade)); } $data['subjectList'] = Admin_SubjectModel::instance()->fetchAll($option); $data['count'] = Admin_SubjectModel::instance()->count($count_opt); $data['grade'] = RThink_Config::get('app.grade'); $pagination = new Pagination(); $data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic'); $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $this->setInvokeArg('layout', 'admin1_layout'); $this->render($data); }
public function indexAction() { $id = $this->getRequest()->getParam('id'); $admin = $this->session->get('admin_user'); $admin = unserialize($admin); if ($id != $admin['id']) { $admin = $this->verify(__METHOD__); } $data = array(); $data['self'] = 1; /* 取全部管理组 */ // $show['group_list'] = db_admin_group::get_admin_group_list(' id desc ', 'all'); $data['group_list'] = Admin_GroupModel::instance()->fetchAll(array('order' => 'id desc')); /* 取全部项目 */ // $show['porject_list'] = db_fqa_project::get_fqa_project_list(); $data['project_list'] = Admin_ProjectModel::instance()->fetchAll(); if (empty($id)) { $data['pagename'] = '添加管理员'; $data['url'] = '/admin/user/list'; } else { $data['pagename'] = '编辑管理员'; // $data['info'] = db_admin::get_admin_by_id($id); $data['info'] = Admin_AdminModel::instance()->fetchRow(array('condition' => 'id = ?', 'bind' => array($id))); $data['info']['gid'] = explode(',', $data['info']['gid']); $data['info']['project_id'] = explode(',', $data['info']['project_id']); if ($data['info']['id'] == $admin['id']) { $data['self'] = 0; } $data['id'] = $id; $data['url'] = $this->getRequest()->getParam('url'); } $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $this->setInvokeArg('layout', 'admin2_layout'); $this->render($data); }
public function indexAction() { // $this->verify(__METHOD__); //@todo $this->verify(__METHOD__); $data = array(); $data['list'] = Admin_GroupModel::instance()->fetchAll(array('order' => 'group_name asc')); $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $this->setInvokeArg('layout', 'admin2_layout'); $this->render($data); }
public function indexAction() { // // $show['menu_list'] = db_admin_menu::get_admin_menu_list(array(),'orders asc','all'); // $show['menu_list'] = $this->load_fun('tree',$show['menu_list'],'parent_id'); // //$this->cache->flush('admin_menu'); // $this->display($show); // var_dump($this->getRequest()->getModuleName(), $this->getRequest()->getControllerName()); // exit; // /** 验证是否登录 **/ // $this->verify(__METHOD__); //@todo $this->verify(__METHOD__); $data = array(); $data['tips'] = '请在添加、修改、排序菜单全部完成后,更新菜单缓存'; $data['menu_list'] = Admin_MenuModel::instance()->getAdminMenuList(array(), 'orders asc'); $data['menu_list'] = Widget_Admin_MenuModel::tree($data['menu_list'], 'parent_id'); $data['menu'] = Admin_MenuModel::instance()->getAdminHeaderMenu($data['menu_list'], $this->getRequest()->getModuleName(), $this->getRequest()->getControllerName()); $this->setInvokeArg('layout', 'admin1_layout'); $this->render($data); }
public function indexAction() { //检查权限 $this->verify(__METHOD__); $show['pagename'] = '章节列表'; $grade = $this->getRequest()->getQuery('Grade', ''); $subjectID = $this->getRequest()->getQuery('SubjectID', ''); $perpage = 20; $page = intval($this->getRequest()->getQuery('page')); $page = $page ? $page : 1; $data = $count_opt = array(); $option = array('condition' => '', 'order' => 'Grade asc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage)); $conditionArr = $bindArr = array(); if (!empty($grade)) { $conditionArr[] = "Grade = ?"; $bindArr[] = $grade; } if (!empty($subjectID)) { $conditionArr[] = "SubjectID = ?"; $bindArr[] = $subjectID; } $option['condition'] = $count_opt['condition'] = implode(' and ', $conditionArr); $option['bind'] = $count_opt['bind'] = $bindArr; $data['ChapterList'] = Admin_ChapterModel::instance()->fetchAll($option); $subject = Admin_SubjectModel::instance()->fetchAll(array()); $subjectList = array(); foreach ($subject as $key => $value) { if (!isset($subjectList[$value['Grade']])) { $subjectList[$value['Grade']] = array(); } array_push($subjectList[$value['Grade']], $value); } $data['subjectList'] = $subjectList; $data['count'] = Admin_ChapterModel::instance()->count($count_opt); $data['grade'] = RThink_Config::get('app.grade'); $pagination = new Pagination(); $data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic'); $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $this->setInvokeArg('layout', 'admin1_layout'); $this->render($data); }
public function indexAction() { // $this->verify(__METHOD__); //@todo $this->verify(__METHOD__); $data = array(); $id = $this->getRequest()->getParam('id'); $data['menu_list'] = Admin_MenuModel::instance()->fetchAll(array('condition' => 'no_verify = 0', 'order' => 'id desc')); $data['menu_list'] = Widget_Admin_MenuModel::tree($data['menu_list'], 'parent_id'); if (!empty($id)) { $data['info'] = Admin_GroupModel::instance()->fetchRow(array('condition' => 'id = ? and status = 1', 'bind' => array($id))); $data['info']['menu_id'] = explode(',', $data['info']['menu_id']); $data['info']['menu_id'] = array_unique($data['info']['menu_id']); $data['info']['menu_id'] = array_flip($data['info']['menu_id']); $data['pagename'] = '编辑账号组'; } else { $data['pagename'] = '添加账号组'; } $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $this->setInvokeArg('layout', 'admin2_layout'); $this->render($data); }
public function indexAction() { //检查权限 $this->verify(__METHOD__); $show['pagename'] = '课程列表'; $grade = $this->getRequest()->getQuery('Grade'); $subject = $this->getRequest()->getQuery('SubjectID'); $chapter = $this->getRequest()->getQuery('Chapter'); $classno = $this->getRequest()->getQuery('ClassNo'); $memberID = $this->getRequest()->getQuery('MemberID'); $perpage = 20; $page = intval($this->getRequest()->getQuery('page')); $page = $page ? $page : 1; $data = $count_opt = array(); $option = array('condition' => '', 'order' => 'ClassNo asc,Grade asc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage)); $data['count'] = Admin_AdminModel::instance()->count($count_opt); $conditionArr = $bindArr = array(); if (!empty($grade)) { $conditionArr[] = "grade = ?"; $bindArr[] = $grade; } if (!empty($subject)) { $conditionArr[] = "subjectid = ?"; $bindArr[] = $subject; } if (!empty($classno)) { $conditionArr[] = "classno = ?"; $bindArr[] = $classno; } if (!empty($chapter)) { $conditionArr[] = "chapter = ?"; $bindArr[] = $chapter; } $option['condition'] = $count_opt['condition'] = implode(' and ', $conditionArr); $option['bind'] = $count_opt['bind'] = $bindArr; // print_r($option);exit; $data['classList'] = Admin_ClassesModel::instance()->fetchAll($option); $data['count'] = Admin_ClassesModel::instance()->count($count_opt); $data['grade'] = RThink_Config::get('app.grade'); $pagination = new Pagination(); $data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic'); $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $data['query'] = array('ClassNo' => $classno, 'Grade' => $grade, 'SubjectID' => $subject, 'Chapter' => $chapter, 'MemberID' => $memberID); $subject = Admin_SubjectModel::instance()->fetchAll(array()); $subjectList = array(); foreach ($subject as $key => $value) { if (!isset($subjectList[$value['Grade']])) { $subjectList[$value['Grade']] = array(); } array_push($subjectList[$value['Grade']], $value); } $data['subjectList'] = $subjectList; $recommendClassIds = array(); if (!empty($memberID)) { $recommend_option = array('fields' => 'ClassID', 'condition' => 'MemberID = ?', 'bind' => array($memberID), 'order' => 'ClassID desc', 'limit' => ''); $recommendClasses = Admin_RecommendModel::instance()->fetchAll($recommend_option); foreach ($recommendClasses as $key => $value) { $recommendClassIds[] = $value['ClassID']; } } $data['recommendClassIds'] = $recommendClassIds; $this->setInvokeArg('layout', 'admin1_layout'); $this->render($data); }
public function indexAction() { //检查权限 $this->verify(__METHOD__); $show['pagename'] = '管理员列表'; $username = $this->getRequest()->getQuery('username', ''); $perpage = 20; $page = intval($this->getRequest()->getQuery('page')); $page = $page ? $page : 1; $project_list = Admin_ProjectModel::instance()->fetchAll(); $project_list_tmp = array(); foreach ($project_list as $val) { $project_list_tmp[$val['id']] = $val; } $option = array('condition' => 'status = 1', 'order' => 'id desc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage)); if (!empty($username)) { $option['condition'] .= " and username like ?"; $option['bind'] = array("%{$username}%"); } $data['list'] = Admin_AdminModel::instance()->fetchAll($option); $gids = array(); foreach ($data['list'] as $val) { $gids[] = $val['gid']; } $gids = join(',', $gids); $gids = explode(',', $gids); $group_list_tmp = array(); if (!empty($gids[0])) { // $gids = array_unique($gids); // $group_list = db_admin_group::get_admin_group_by_ids($gids); $group_list = Admin_GroupModel::instance()->getAdminGroupByIds($gids); foreach ($group_list as $key => $val) { $group_list_tmp[$val['id']] = $val; } foreach ($data['list'] as $key => $val) { $val['gid'] = explode(',', $val['gid']); foreach ($val['gid'] as $val2) { $data['list'][$key]['group'][] = isset($group_list_tmp[$val2]['group_name']) ? $group_list_tmp[$val2]['group_name'] : ''; } $val['project_id'] = explode(',', $val['project_id']); foreach ($val['project_id'] as $val2) { //var_dump($val['project_id'], $val2, $val['gid']);exit; $data['list'][$key]['project'][] = isset($project_list_tmp[$val2]['project_name']) ? $project_list_tmp[$val2]['project_name'] : ''; } $data['list'][$key]['project'] = implode(' , ', $data['list'][$key]['project']); $data['list'][$key]['group'] = implode(' , ', $data['list'][$key]['group']); } } if (!empty($username)) { $count_opt = array('condition' => "username like ? and status = 1", 'bind' => array("%{$username}%")); } else { $count_opt = array('condition' => 'status = 1'); } $data['count'] = Admin_AdminModel::instance()->count($count_opt); $pagination = new Pagination(); $data['page'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic'); $data['menu'] = Widget_Admin_MenuModel::headerMenu(); $data['username'] = $username; $data['url'] = rawurlencode($this->getRequest()->getServer('REQUEST_URI')); $this->setInvokeArg('layout', 'admin2_layout'); $this->render($data); }