Пример #1
0
 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);
 }
Пример #2
0
 public function indexAction()
 {
     //检查权限
     $admin = $this->verify(__METHOD__);
     $show['pagename'] = '选择课程列表';
     $MemberID = $this->getRequest()->getParam('MemberID', 0);
     $Grade = $this->getRequest()->getParam('Grade', 0);
     $SubjectID = $this->getRequest()->getParam('SubjectID', 0);
     $perpage = 20;
     $page = intval($this->getRequest()->getParam('page'));
     $page = $page ? $page : 1;
     $data = $count_opt = array();
     //个人信息
     $member_option = array('condition' => 'MemberID = ?', 'bind' => array($MemberID));
     $MemberInfo = Admin_MemberModel::instance()->fetchAll($member_option);
     $data['MemberInfo'] = $MemberInfo[0];
     $Grade = empty($Grade) ? $MemberInfo[0]['Grade'] : $Grade;
     //所选课程列表
     $option = array('order' => 'ChosenID desc,B.ClassNo asc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage));
     if (!empty($SubjectID)) {
         $option['condition'][] = 'B.SubjectID = ?';
         $option['bind'][] = $SubjectID;
     }
     if (!empty($Grade)) {
         $option['condition'][] = 'B.Grade = ?';
         $option['bind'][] = $Grade;
     }
     if (!empty($MemberID)) {
         $option['condition'][] = 'A.MemberID = ?';
         $option['bind'][] = $MemberID;
     }
     $option['condition'] = implode(' and ', $option['condition']);
     $count_opt['condition'] = $option['condition'];
     $count_opt['bind'] = $option['bind'];
     $data['ChosenList'] = Admin_ChosenModel::instance()->getChosenClassList($option);
     $count = Admin_ChosenModel::instance()->getChosenCount($count_opt);
     $data['count'] = $count[0]['count'];
     $data['grade'] = RThink_Config::get('app.grade');
     $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;
     $pagination = new Pagination();
     $data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic');
     $data['query'] = array('MemberID' => $MemberID, 'SubjectID' => $SubjectID, 'Grade' => $Grade);
     $this->setInvokeArg('layout', 'admin1_layout');
     $this->render($data);
 }
Пример #3
0
 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);
 }
Пример #4
0
 public function indexAction()
 {
     //检查权限
     $admin = $this->verify(__METHOD__);
     $show['pagename'] = '推荐课程列表';
     $MemberID = $this->getRequest()->getQuery('MemberID', 0);
     $SubjectID = $this->getRequest()->getQuery('SubjectID');
     $perpage = 20;
     $page = intval($this->getRequest()->getQuery('page'));
     $page = $page ? $page : 1;
     $data = $count_opt = array();
     $option = array('condition' => 'A.MemberID = ?', 'bind' => array($MemberID), 'order' => 'RecommendID desc', 'limit' => array('offset' => ($page - 1) * $perpage, 'count' => $perpage));
     if (!empty($SubjectID)) {
         $option['condition'] .= ' and B.SubjectID = ?';
         $option['bind'][] = $SubjectID;
     }
     $count_opt['condition'] = $option['condition'];
     $count_opt['bind'] = $option['bind'];
     $data['RecommendList'] = Admin_RecommendModel::instance()->getRecommendClassList($option);
     $data['count'] = Admin_RecommendModel::instance()->getRecommendCount($count_opt);
     $data['grade'] = RThink_Config::get('app.grade');
     $member_option = array('condition' => 'MemberID = ?', 'bind' => array($MemberID));
     $MemberInfo = Admin_MemberModel::instance()->fetchAll($member_option);
     $data['MemberInfo'] = $MemberInfo[0];
     $TeacherList = Admin_AdminModel::instance()->fetchAll(array());
     $TeacherList_tmp = array();
     foreach ($TeacherList as $key => $value) {
         $TeacherList_tmp[$value['id']] = $value;
     }
     $data['TeacherList'] = $TeacherList_tmp;
     $grade = $MemberInfo[0]['Grade'];
     $member_option = array('condition' => 'Grade = ?', 'bind' => array($grade));
     $data['SubjectList'] = Admin_SubjectModel::instance()->fetchAll($member_option);
     $pagination = new Pagination();
     $data['pagination'] = $pagination->maxnum($data['count'], $perpage)->show('page_metronic');
     $data['query'] = array('MemberID' => $MemberID, 'SubjectID' => $SubjectID);
     $this->setInvokeArg('layout', 'admin1_layout');
     $this->render($data);
 }
Пример #5
0
 public function indexAction()
 {
     //检查权限
     $this->verify(__METHOD__);
     $show['pagename'] = '学员列表';
     $grade = $this->getRequest()->getQuery('Grade');
     $mobile = $this->getRequest()->getQuery('Mobile');
     $name = $this->getRequest()->getQuery('Name');
     $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($mobile)) {
         $conditionArr[] = "mobile = ?";
         $bindArr[] = $mobile;
     }
     if (!empty($name)) {
         $conditionArr[] = "name like ?";
         $bindArr[] = "%{$name}%";
     }
     $option['condition'] = $count_opt['condition'] = implode(' and ', $conditionArr);
     $option['bind'] = $count_opt['bind'] = $bindArr;
     $data['memberList'] = Admin_MemberModel::instance()->fetchAll($option);
     $data['count'] = Admin_MemberModel::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['query'] = array('Mobile' => $mobile, 'Grade' => $grade, 'Name' => $name);
     $this->setInvokeArg('layout', 'admin1_layout');
     $this->render($data);
 }
Пример #6
0
 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);
 }
Пример #7
0
 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);
 }