public function index($subject_category_id = 0) { if (!$this->check_power('subject_category_list, subject_category_manage')) { return; } $subject_category_id = intval($subject_category_id); $subject_category_id && ($subject_category = SubjectCategoryModel::get_subject_category($subject_category_id)); if (empty($subject_category)) { message('学科分类不存在'); } $param = array(); $page = intval($this->input->get('page')); $per_page = intval($this->input->get('per_page')); $page = $page ? $page : 1; $page = 0; $per_page = $per_page ? $per_page : 20; $query = array('subject_category_id' => $subject_category_id); $order_by = 'ctime asc'; $select_what = '*'; $list = SubjectCategoryModel::get_method_tactic_list($query, $page, $per_page, $order_by, $select_what); foreach ($list as &$row) { $row['has_relate_info'] = $this->_has_relate_info($row['id']); } $data['subject_category'] = $subject_category; $data['subject_category_id'] = $subject_category_id; $data['list'] = $list; $data['priv_manage'] = $this->check_power('subject_category_manage', FALSE); $data['priv_delete'] = $this->check_power('subject_category_delete', FALSE); // 分页 $purl = site_url('admin/method_tactic/index/' . $subject_category_id . '/') . (count($param) ? '?' . implode('&', $param) : ''); $total = SubjectCategoryModel::count_method_tactic_lists($query); $data['pagination'] = multipage($total, $per_page, $page, $purl); // 模版 $this->load->view('method_tactic/index', $data); }
function site_story_list() { global $story_process; $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; $state = MooGetGPC('state', 'integer', 'G') ? MooGetGPC('state', 'integer', 'G') : 1; $where = " WHERE `state` = " . $state; $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}story {$where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}story {$where} ORDER BY `sid` DESC LIMIT {$offset},{$limit}"; $ret_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); //最上面一条 可上移 if ($page != 1) { $upable = 1; $preoffset = $offset - 1; $sql = "SELECT `sid` FROM {$GLOBALS['dbTablePre']}story {$where} ORDER BY `sid` DESC LIMIT {$preoffset},1"; $pre_ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } //最下面一条 可下移 if ($page != ceil($total['num'] / $limit)) { $downable = 1; $nextoffset = $offset + $limit; $sql = "SELECT `sid` FROM {$GLOBALS['dbTablePre']}story {$where} ORDER BY `sid` DESC LIMIT {$nextoffset},1"; $next_ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } $currenturl = "index.php?action=site_story&h=list&state=" . $state; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'story', '查看成功故事列表', $GLOBALS['adminid']); require adminTemplate('site_story_list'); }
function site_loveclinic_list() { $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; $type = MooGetGPC('type', 'integer', 'G') ? MooGetGPC('type', 'integer', 'G') : 1; $where = " WHERE sid > '0' and type = " . $type; $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}love_clinic {$where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}love_clinic {$where} ORDER BY sort DESC LIMIT {$offset},{$limit}"; $ret_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); //最上面一条 可上移 if ($page != 1) { $upable = 1; $preoffset = $offset - 1; $sql = "SELECT id,sort FROM {$GLOBALS['dbTablePre']}love_clinic {$where} ORDER BY sort DESC LIMIT {$preoffset},1"; $pre_ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } //最下面一条 可下移 if ($page != ceil($total['num'] / $limit)) { $downable = 1; $nextoffset = $offset + $limit; $sql = "SELECT id,sort FROM {$GLOBALS['dbTablePre']}love_clinic {$where} ORDER BY sort DESC LIMIT {$nextoffset},1"; $next_ret = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); } $currenturl = "index.php?action=site_loveclinic&h=list&type=" . $type; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'love_clinic', '查看情感问题列表', $GLOBALS['adminid']); require adminTemplate('site_loveclinic_list'); }
function transfer_list() { $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 16; $offset = ($page - 1) * $limit; $uid = MooGetGPC('uid', 'integer', 'P'); $sid = MooGetGPC('sid', 'integer', 'P'); $s_str = $and = ''; if ($uid > 0) { $s_str .= 'uid like \'%' . $uid . '%\''; $and = ' AND '; } if ($sid > 0) { $s_str .= $and . 'sid=' . $sid; } if (!empty($s_str)) { $s_str = ' WHERE ' . $s_str; } $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}members_transfer {$s_str} ORDER BY id DESC LIMIT {$offset},{$limit}"; $transfer = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $total = getcount('members_transfer', $s_str); $currenturl = "index.php?action=other_members_transfer&h=list"; $pages = multipage($total, $limit, $page, $currenturl); require_once adminTemplate('transfer_list'); }
public function index() { if (!$this->check_power('subject_category_list, subject_category_manage')) { return; } $param = array(); $page = intval($this->input->get('page')); $per_page = intval($this->input->get('per_page')); $page = $page ? $page : 1; $page = 0; $per_page = $per_page ? $per_page : 20; $query = array(); $order_by = 'ctime asc'; $select_what = '*'; $list = SubjectCategoryModel::get_subject_category_list($query, $page, $per_page, $order_by, $select_what); foreach ($list as $k => &$row) { $subjects = SubjectCategoryModel::get_subject_category_subjects($row['id'], true); $tmp_subject = array(); foreach ($subjects as $subject) { $tmp_subject[] = $subject['subject_name']; } $row['subject'] = trim(implode('、', $tmp_subject), '、'); $row['has_relate_info'] = $this->_has_relate_info($row['id']); } $data['list'] = $list; $data['priv_manage'] = $this->check_power('subject_category_manage', FALSE); $data['priv_delete'] = $this->check_power('subject_category_delete', FALSE); // 分页 $purl = site_url('admin/subject_category/index/') . (count($param) ? '?' . implode('&', $param) : ''); $total = SubjectCategoryModel::count_subject_category_lists($query); $data['pagination'] = multipage($total, $per_page, $page, $purl); // 模版 $this->load->view('subject_category/index', $data); }
public function index() { $param['pr_subjectid'] = self::$pr_subjectid; $param['knowledge_name'] = trim($this->input->get('knowledge_name')); $param['pr_knowledgeid'] = implode(',', $this->input->get('pr_knowledgeid')); $size = C('default_perpage_num'); $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $total = ProfessionRelatedModel::professionRelatedListCount($param); if ($total) { $data['list'] = ProfessionRelatedModel::professionRelatedList($param, $page, $size); $profession_ids = array(); foreach ($data['list'] as &$item) { $item['pr_professionid'] = json_decode($item['pr_professionid'], true); $profession_ids = array_merge($profession_ids, $item['pr_professionid']); } $profession_id_str = implode(',', array_unique($profession_ids)); $data['profession'] = ProfessionModel::professionInfo($profession_id_str); } // 分页 $purl = site_url('admin/vocational_aptitude/index/') . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); $data['search'] = $param; $data['priv_edit'] = $this->check_power_new('vocational_aptitude_edit', FALSE); $data['priv_delete'] = $this->check_power_new('vocational_aptitude_remove', FALSE); $this->load->view('vocational_aptitude/index', $data); }
/** * * @version $Id: arcpagelist.lib.php 1 9:29 2010年7月6日Z tianya $ * @package DedeCMS.Taglib * @copyright Copyright (c) 2007 - 2010, DesDev, Inc. * @license http://help.dedecms.com/usersguide/license.html * @link http://www.dedecms.com */ function lib_arcpagelist(&$ctag, &$refObj) { global $dsql; $attlist = "tagid|,style|1"; FillAttsDefault($ctag->CAttribute->Items, $attlist); extract($ctag->CAttribute->Items, EXTR_SKIP); $row = $dsql->GetOne("SELECT * FROM #@__arcmulti WHERE tagid='{$tagid}'"); if (is_array($row)) { $ids = explode(',', $row['arcids']); $totalnum = count($ids); $pagestr = '<div id="page_' . $tagid . '">'; if ($row['pagesize'] < $totalnum) { $pagestr .= multipage($totalnum, 1, $row['pagesize'], $tagid); } else { $pagestr .= '共1页'; } $pagestr .= '</div>'; return $pagestr; } else { $pagestr = '<div id="page_' . $tagid . '">'; $pagestr .= '没有检索到对应分页'; $pagestr .= '</div>'; return $pagestr; } }
function cooperation_search() { $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 20; $offset = ($page - 1) * $limit; $where = array(); $where['sid'] = MooGetGPC('sid', 'integer', 'P'); $where['activities'] = MooGetGPC('activities', 'string', 'P'); $where['cooperation'] = MooGetGPC('cooperation', 'integer', 'P'); if (!empty($where)) { foreach ($where as $key => $value) { if (!empty($value)) { $where[$key] = '`' . $key . '`=\'' . $value . '\''; } else { unset($where[$key]); } } } $where = empty($where) ? '' : 'where ' . implode(' and ', $where); $count = $GLOBALS['_MooClass']['MooMySQL']->getOne('SELECT COUNT(`id`) AS num FROM ' . $GLOBALS['dbTablePre'] . 'cooperation ' . $where); $data = $GLOBALS['_MooClass']['MooMySQL']->getAll('SELECT * FROM ' . $GLOBALS['dbTablePre'] . 'cooperation ' . $where . ' ORDER BY id DESC LIMIT ' . $offset . ',' . $limit); $currenturl = 'http://' . $_SERVER['SERVER_NAME'] . ':' . $_SERVER["SERVER_PORT"] . $_SERVER["REQUEST_URI"]; $currenturl2 = preg_replace("/(&page=\\d+)/", "", $currenturl); $total['num'] = isset($total['num']) && $total['num'] ? $total['num'] : 0; $pages = multipage($total['num'], $limit, $page, $currenturl); $page_num = ceil($total['num'] / $limit); $cooperation_config = $GLOBALS['cooperation_config']; $activities = $GLOBALS['activities']; $activitie = MooGetGPC('activities', 'string', 'P'); $sids = MooGetGPC('sid', 'integer', 'P'); serverlog(1, $GLOBALS['dbTablePre'] . 'cooperation', "{$GLOBALS['username']}查看志愿者合作列表", $GLOBALS['adminid']); require adminTemplate('active_cooperation_list'); exit; }
/** * 列表页面 * * @return void */ public function index() { /** 搜索 */ $search = array(); $search['status != '] = '-1'; $get = $this->input->get(); if (!empty($get['begin_time'])) { $search['create_time >='] = strtotime($get['begin_time'] . "00:00:00"); } if (!empty($get['end_time'])) { $search['create_time <='] = strtotime($get['end_time'] . "23:59:59"); } if (!empty($get['keyword'])) { $search['title like'] = '%' . trim($get['keyword']) . '%'; } $data = array(); /** 分页连接 */ $total = EvaluationStandardModel::get_count(array('status != ' => '-1')); $current_page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $per_page = 15; $purl = current_url(); $data['pagination'] = multipage($total['count'], 15, $current_page, $purl); /** 获取数据 */ $limit = $per_page * ($current_page - 1) . ',' . $per_page; $data['list'] = EvaluationStandardModel::get_multiterm($search, '*', $limit); $data['search'] = $get; $this->load->view('interview/evaluation_standard_index', $data); }
public function index($exam_pid = 0) { if (!$exam_pid) { message('请指定考试期次!'); } $exam = ExamModel::get_exam_by_id($exam_pid); if (!$exam) { message('考试期次不存在!'); } $data = array(); $cond_param['exam_pid'] = $exam_pid; $cond_param['ct_name'] = trim($this->input->get('ct_name')); $cond_param['stu_name'] = trim($this->input->get('stu_name')); $cond_param['subject_id'] = intval($this->input->get('subject_id')); $page = intval($this->input->get('page')); $page = $page ? $page : 1; $perpage = C('default_perpage_num'); $total = TeacherStudentModel::teacherStudentListCount($cond_param); if ($total) { $data['list'] = TeacherStudentModel::teacherStudentList('*', $cond_param, $page, $perpage); } $purl = site_url('admin/teacher_student/index/' . $exam_pid) . ($cond_param ? '?' . implode('&', $cond_param) : ''); $data['pagination'] = multipage($total, $perpage, $page, $purl); $data['search'] = $cond_param; $data['exam'] = $exam; $data['subject'] = C('subject'); $this->load->view('teacher_student/index', $data); }
/** * ription 角色列表 * * @author * * @final * * @param int $trash * 是否回收站 * @param int $group_id */ public function index() { if (!$this->check_power('role_manage')) { return; } // 查询条件 $where = array(); $param = array(); $search = array(); $trash = intval($this->input->get('trash')); $search['trash'] = $trash; if ($trash) { $where[] = "is_delete=1"; $param[] = "trash=1"; } if ($search['group_id'] = intval($this->input->get('group_id'))) { $where[] = "group_id='{$search['group_id']}'"; $param[] = "group_id={$search['group_id']}"; } $where = $where ? implode(' AND ', $where) : ' 1 '; // 统计数量 $sql = "SELECT COUNT(*) nums FROM {pre}role WHERE {$where}"; $res = $this->db->query($sql); $row = $res->row_array(); $total = $row['nums']; /* * 分页读取数据列表,并处理相关数据 */ $size = 15; $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; if ($total) { /* 查看所有角色下的管理员 */ $sql = "SELECT * FROM {pre}admin_role group by role_id"; $res = $this->db->query($sql); $temp = array(); foreach ($res->result_array() as $row) { $temp[$row['role_id']] = $row['admin_id']; } $sql = "SELECT * FROM {pre}role\n WHERE {$where} ORDER BY role_id DESC LIMIT {$offset},{$size}"; $res = $this->db->query($sql); $list = array(); foreach ($res->result_array() as $row) { /* 判断该角色是否已分配管理员 */ $row['is_delete'] = empty($temp[$row['role_id']]) ? 1 : 0; $list[] = $row; } } $data['list'] = $list; $data['search'] = $search; $data['priv_delete'] = $this->check_power('cpuser_delete', FALSE); $data['priv_role'] = $this->check_power('cpuser_role', FALSE); $data['priv_import_cpuser'] = $this->check_power('import_cpuser', FALSE); // 分页 $purl = site_url('admin/role/index') . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); // 模版 $this->load->view('role/index', $data); }
public function index($mode = '') { if (!$this->check_power('comparison_list,comparison_manage')) { return; } $size = C('admin_page_size'); $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $order_by = 'cmp_type_id DESC'; $select_what = 'cmp_type_id,cmp_type_name,grade_id,class_id,subject_id,cmp_type_flag,updatetime,addtime'; $query = $param = $search = array(); // 查询条件 $mode = $mode == 'trash' ? 'trash' : ''; $search['type_flag'] = $this->input->get('type_flag'); if ($mode == 'trash') { $query['cmp_type_flag'] = -1; } else { if (strlen($search['type_flag'])) { $query['cmp_type_flag'] = intval($search['type_flag']); } else { $query['cmp_type_flag'][] = array('>', -1); } } if ($search['grade_id'] = (int) $this->input->get('grade_id')) { $param[] = "grade_id=" . $search['grade_id']; $query['grade_id'] = $search['grade_id']; } if ($search['class_id'] = (int) $this->input->get('class_id')) { $param[] = "class_id=" . $search['class_id']; $query['class_id'] = $search['class_id']; } if ($search['subject_id'] = (int) $this->input->get('subject_id')) { $param[] = "subject_id=" . $search['subject_id']; $query['subject_id'] = $search['subject_id']; } if ($search['keyword'] = trim($this->input->get('keyword'))) { $param[] = "keyword=" . urlencode($search['keyword']); $query['keyword'] = $search['keyword']; } // 获取数据 $total = ComparisonTypeModel::get_comparison_type_count($query); $list = array(); if ($total) { $list = ComparisonTypeModel::get_comparison_type_list($query, $page, $size, $order_by, $select_what); } $data['mode'] =& $mode; $data['list'] =& $list; $data['search'] =& $search; // 分页 $purl = site_url('admin/comparison_type/index/') . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); // 学科、类型 $data['grades'] = C('grades'); $data['subjects'] = CpUserModel::get_allowed_subjects(); $data['class_list'] = ClassModel::get_class_list(); $data['priv_manage'] = $this->check_power('comparison_manage', FALSE); // 模版 $this->load->view('comparison_type/index', $data); }
function active_rightbottom_message() { $type = MooGetGPC('type', 'string'); $sql_where = ' WHERE 1=1 '; //note 显示全部 if (isset($_GET['type']) == 'all') { $sql_where .= ""; //note 显示已处理过的 } else { if ((isset($_GET['type']) ? $_GET['type'] : '') == 'dealed') { $sql_where .= " AND dealstate = '1'"; //note 显示未处理过的 } else { $sql_where .= " AND dealstate = '0'"; } } //分页 $page_per = 20; $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 20; $offset = ($page - 1) * $limit; //所管理的客服id列表 $myservice_idlist = get_myservice_idlist(); if (empty($myservice_idlist)) { $sql_where .= " AND sid IN({$GLOBALS['adminid']})"; } elseif ($myservice_idlist == 'all') { //all为客服主管能查看所有的 } else { $sql_where .= " AND sid IN({$myservice_idlist})"; } if (isset($_GET['id'])) { $id = MooGetGPC('id', 'integer', 'G'); $sql = "UPDATE {$GLOBALS['dbTablePre']}admin_remark SET status=1 WHERE id='{$id}'"; $GLOBALS['_MooClass']['MooMySQL']->query($sql); salert('操作成功', 'index.php?action=other_rightbottom&h=message'); } $total = getcount('admin_remark', $sql_where); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_remark {$sql_where} ORDER BY id DESC LIMIT {$offset},{$limit}"; $remark_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); //note 获得当前的url 去除多余的参数 /* $currenturl = 'http://'.$_SERVER['SERVER_NAME'].':'.$_SERVER["SERVER_PORT"].$_SERVER["REQUEST_URI"]; $currenturl = preg_replace("/(&page=\d+)/","",$currenturl); $currenturl = preg_replace("/(&type=undealed)/","",$currenturl); $currenturl = preg_replace("/(&type=dealed)/","",$currenturl); $currenturl = preg_replace("/(&type=all)/","",$currenturl); $currenturl2 = $currenturl; $currenturl = $currenturl."&type=$type"; echo $currenturl; */ $currenturl = "index.php?action=other_rightbottom&h=message&type={$type}"; //note 跳转到某一页 $page_num = ceil($total / $limit); $page_links = multipage($total, $page_per, $page, $currenturl); //note 调用模板 require adminTemplate('other_rightbottom_message'); }
/** * @description 产品分类管理列表 * @param int $pc_id 产品分类id * @param int $keyword 关键字 */ public function index($mode = '') { if (!$this->check_power_new('production_category_index')) { return; } // 查询条件 $where = array(); $param = array(); $search = array(); $query = array(); $data = array(); if ($search['keyword'] = trim($this->input->get('keyword'))) { $escape_keyword = $this->db->escape_like_str($search['keyword']); $param[] = "keyword=" . urlencode($search['keyword']); $query['keyword'] = "pc_name LIKE '%" . $escape_keyword . "%'"; } if ($search['pc_id'] = intval($this->input->get('pc_id'))) { $query = array(); $param[] = "pc_id={$search['pc_id']}"; $query['pc_id'] = intval($search['pc_id']); } /* * 统计所有学生数量 */ $res = CommonModel::get_list($query, 'rd_product_category', 'count(*) AS count'); $total = $res[0]['count']; /* *分页读取数据列表,并处理相关数据 */ $size = 15; $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $list = array(); if ($total) { $res = CommonModel::get_list($query, 'rd_product_category', '*', $page, $size, 'pc_id desc'); foreach ($res as $row) { $row['p_c_time'] = $row['p_c_time'] > 0 ? date('Y-m-d H:i:s', $row['p_c_time']) : date('Y-m-d H:i:s', time()); $query = array(); $query['pc_id'] = $row['pc_id']; $res = CommonModel::get_list($query, 'v_trans_log_count', 'pt_id_count'); $row['p_id_count'] = $res[0]['pt_id_count']; $list[] = $row; } } $data['list'] = $list; // 分页 $purl = site_url('admin/production_category/index/') . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); $data['search'] = $search; // 模版 $this->load->view('production_category/index', $data); }
function system_adminuser_list() { global $adminid; //echo $adminid; //echo getGroupID($adminid); $sql_where = ''; $page_per = 15; $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; $currenturl = "index.php?action=system_adminuser&h=list"; $username = MooGetGPC('username', 'string'); $usercode = MooGetGPC('usercode', 'string'); if (!empty($username)) { $currenturl = "index.php?action=system_adminuser&h=list&username={$username}"; $sql_where = " WHERE username LIKE '{$username}%'"; } if (!empty($uid)) { $currenturl = "index.php?action=system_adminuser&h=list&uid={$uid}"; $sql_where = " WHERE uid LIKE '{$uid}%'"; } $choose = MooGetGPC('choose', 'string', 'P'); $content = trim(MooGetGPC('content', 'string', 'P')); if ($choose == 'username') { $sql_where = " WHERE username LIKE '{$content}%'"; $currenturl = "index.php?action=system_adminuser&h=list&username={$content}"; } elseif ($choose == 'usercode') { $sql_where = " WHERE usercode LIKE '{$content}%'"; $currenturl = "index.php?action=system_adminuser&h=list&usercode={$content}"; } /* * if(!empty($username)){ $sql_where = " WHERE username LIKE * '{$username}%'"; } */ $sql = "SELECT COUNT(uid) AS COUNT FROM {$GLOBALS['dbTablePre']}admin_user {$sql_where}"; $admin_user = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $total = $admin_user['COUNT']; if ($choose == 'username') { $sql_where = " WHERE a.username LIKE '{$content}%'"; } elseif ($choose == 'userid') { $sql_where = " WHERE a.uid LIKE '{$content}%'"; } $sql = "SELECT a.*,b.groupname FROM {$GLOBALS['dbTablePre']}admin_user as a \n \t\tLEFT JOIN {$GLOBALS['dbTablePre']}admin_group as b \n \t\tON a.groupid=b.groupid {$sql_where} ORDER BY a.uid DESC\n \t\tLIMIT {$offset},{$limit}"; $adminuser_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); /* $url = "http://".$_SERVER['SERVER_NAME'].$_SERVER['REQUEST_URI']; echo $url; */ $pages = multipage($total, $page_per, $page, $currenturl); $page_num = ceil($total / $limit); require_once adminTemplate('adminuser_list'); serverlog(1, $GLOBALS['dbTablePre'] . 'admin_user', "{$GLOBALS['adminid']}号客服{$GLOBALS['username']}查看会员管理员列表", $GLOBALS['adminid']); }
/** Helper - setup paging **/ function setup_threadlog_pages($uid, $threads, &$start) { global $mybb; $threadlog_url = htmlspecialchars_uni("misc.php?action=threadlog&uid=" . $uid); $per_page = intval($mybb->settings['rpgsuite_threadlog_perpage']); $page = $mybb->get_input('page', MyBB::INPUT_INT); if ($page && $page > 0) { $start = ($page - 1) * $per_page; } else { $start = 0; $page = 1; } return multipage(count($threads), $per_page, $page, $threadlog_url); }
public function index($place_id = 0) { if (!$this->check_power('exam_list,exam_manage')) { return; } // 查询条件 $where = array(); $param = array(); $search = array(); $place_id = intval($place_id); if ($place_id) { $query = $this->db->select('p.place_id,p.place_name,p.address,e.exam_id,e.exam_name,sch.school_id,sch.school_name')->from('exam_place p')->join('exam e', 'p.exam_pid=e.exam_id')->join('school sch', 'p.school_id=sch.school_id')->where('p.place_id', $place_id)->get(); $place = $query->row_array(); } if (empty($place)) { message('考场信息不存在', 'admin/exam/index'); return; } //控制考场只能在未开始考试操作 $place['no_start'] = ExamPlaceModel::place_is_no_start($place_id); $where[] = "ps.place_id={$place_id}"; $where = $where ? ' WHERE ' . implode(' AND ', $where) : ''; // 统计数量 $sql = "SELECT COUNT(*) nums FROM {pre}exam_place_invigilator ps {$where}"; $res = $this->db->query($sql); $row = $res->row_array(); $total = $row['nums']; // 读取数据 $size = 15; $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $list = array(); if ($total) { $sql = "SELECT ps.id, i.invigilator_email,i.invigilator_name,i.invigilator_memo, i.invigilator_flag\n FROM {pre}exam_place_invigilator ps\n LEFT JOIN {pre}invigilator i ON ps.invigilator_id=i.invigilator_id\n {$where} LIMIT {$offset},{$size}"; $res = $this->db->query($sql); foreach ($res->result_array() as $row) { $list[] = $row; } } // 分页 $purl = site_url('admin/place_invigilator/index/' . $place_id) . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); $data['place'] =& $place; $data['list'] =& $list; $data['priv_manage'] = $this->check_power('exam_manage', FALSE); // 模版 $this->load->view('place_invigilator/index', $data); }
function site_lovequestion_list() { global $love_type; $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; $sql = "SELECT COUNT(lid) num FROM {$GLOBALS['dbTablePre']}love_question"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT lid,title,qid,ty_pe,ask1,ask2,ask3,ask3,ask4,ask5 FROM {$GLOBALS['dbTablePre']}love_question ORDER BY lid DESC LIMIT {$offset},{$limit}"; $title_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = "index.php?action=site_lovequestion&h=list"; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'love_question', '查看爱情测试题列表', $GLOBALS['adminid']); require adminTemplate('site_lovequestion_list'); }
function site_media_list() { $page = max(1, MooGetGPC('page', 'integer')); $limit = 10; $offset = ($page - 1) * $limit; $type = MooGetGPC('type', 'string', 'G'); $type = $type ? $type : 'new'; $sql = "SELECT COUNT(1) num FROM {$GLOBALS['dbTablePre']}media WHERE type = '{$type}'"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT id,sid,type,title,content,addtime,source FROM {$GLOBALS['dbTablePre']}media WHERE type = '{$type}' ORDER BY id DESC LIMIT {$offset},{$limit}"; $media_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = "index.php?action=site_media&h=list&type={$type}"; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'media', '查看媒体报道列表', $GLOBALS['adminid']); require adminTemplate('site_media_list'); }
function hntest_result_list() { global $hntest_cache; $page_size = 16; $table = $GLOBALS['dbTablePre'] . 'test_result'; $parent = MooGetGPC('parent', 'integer', 'G'); $page = max(1, MooGetGPC('page', 'integer', 'G')); $offset = ($page - 1) * $page_size; $sql = "SELECT COUNT(*) AS c FROM {$table} "; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $total = (int) $total['c']; $sql = "SELECT * FROM {$table} \n\t\tORDER BY 'tc_id' ASC \n\t\tLIMIT {$offset},{$page_size}"; $lists = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = 'index.php?action=hntest&h=result_list'; $page_links = multipage($total, $page_size, $page, $currenturl); require adminTemplate('hntest_result_list'); }
function active_chat_list() { //note 处理搜索会员聊天 if ($_GET['action'] == 'active_chat') { $choose = MooGetGPC('choose', 'string'); $keyword = MooGetGPC('keyword', 'string'); $where = ''; if (!empty($choose) && !empty($keyword)) { if ($choose == 's_content') { $where = " WHERE {$choose} like '%{$keyword}%'"; } else { $where = " WHERE {$choose} = '{$keyword}'"; } } } //note 登陆系统后客服显示自己范围内的, 主管显示全部 $return_arr = active_chat_loginlist($where, $keyword); $where = $return_arr['where']; $member_arr = $return_arr['members']; //note 分页处理 $page = max(1, MooGetGPC('page', 'integer')); $limit = 15; $offset = ($page - 1) * $limit; //note 查询语句 if ($where != '1') { //note 只查询属于该客服下的用户 //note 数据库查询 $sql = "SELECT COUNT(*) num FROM {$GLOBALS['dbTablePre']}service_chat {$where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}service_chat {$where} ORDER BY s_id DESC LIMIT {$offset},{$limit}"; $user_arr = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); } //note 搜索分页处理 if (!empty($choose) && !empty($keyword)) { $currenturl = "index.php?action=active_chat&h=list&choose={$choose}&keyword=" . urlencode($keyword); } else { $currenturl = "index.php?action=active_chat&h=list"; } $pages = multipage($total['num'], $limit, $page, $currenturl); //note 跳转到某一页 $page_num = ceil($total['num'] / $limit); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'service_chat', "{$GLOBALS['username']}查看聊天记录列表", $GLOBALS['adminid']); //note 调用模板 require adminTemplate('active_chat_list'); }
public function index() { $size = C('default_perpage_num'); $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $total = LearnStyleModel::learnStyleListCount(); if ($total) { $data['list'] = LearnStyleModel::learnStyleList(); } // 分页 $purl = site_url('admin/learn_style/index/'); $data['pagination'] = multipage($total, $size, $page, $purl); $data['priv_edit'] = $this->check_power_new('learn_style_edit', FALSE); $data['priv_delete'] = $this->check_power_new('learn_style_remove', FALSE); $data['priv_attr_manage'] = $this->check_power_new('learn_style_attribute_list', FALSE); $this->load->view('learn_style/index', $data); }
function site_lovetype_list() { global $love_type; $page = max(1, MooGetGPC('page', 'integer')); $limit = 10; $offset = ($page - 1) * $limit; $sql = "SELECT COUNT(id) num FROM {$GLOBALS['dbTablePre']}love_type"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); // $sql = "SELECT t.* , lt.title FROM {$GLOBALS['dbTablePre']}love_type t LEFT JOIN {$GLOBALS['dbTablePre']}love_test lt ON t.pid = lt.qid ORDER BY t.id DESC LIMIT {$offset},{$limit}"; // original file $sql = "SELECT t.id, t.bgcounts, t.endcounts, t.results, lt.title FROM {$GLOBALS['dbTablePre']}love_type t LEFT JOIN {$GLOBALS['dbTablePre']}love_test lt ON t.pid = lt.qid ORDER BY t.id DESC LIMIT {$offset},{$limit}"; // updated file $ret_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $currenturl = "index.php?action=site_lovetype&h=list"; $pages = multipage($total['num'], $limit, $page, $currenturl); //note 插入日志 serverlog(1, $GLOBALS['dbTablePre'] . 'love_type', '查看测试评分列表', $GLOBALS['adminid']); require adminTemplate('site_lovetype_list'); }
function music_list() { $where = ''; $uid = MooGetGPC('uid', 'integer'); if ($uid > 0) { $where = "WHERE uid=" . $uid; } $currenturl = "index.php?action=diamondmusic&h=list"; $page = max(1, MooGetGPC('page', 'integer')); $limit = 18; $offset = ($page - 1) * $limit; $sql = "SELECT COUNT(1) AS c FROM {$GLOBALS['dbTablePre']}art_music {$where}"; $total = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $total = $total['c']; $sql = "SELECT mid,uid,title,note FROM {$GLOBALS['dbTablePre']}art_music \n\t\t\t{$where}\n\t\t\tORDER BY mid DESC \n\t\t\tLIMIT {$offset},{$limit}"; $music = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $pages = multipage($total, $limit, $page, $currenturl); require adminTemplate('diamond_music_list'); }
/** * 评估模板页面 * * @return void */ public function index($template_type = 0) { $page = intval($this->input->get('page')); $page = $page ? $page : 1; $per_page = intval($this->input->get('per_page')); $per_page = $per_page ? $per_page : 15; $param = array('template_type' => $template_type); /* 模板类型 0:综合 1:学科 2:面试 3:面试综合 */ $data['list'] = EvaluateTemplateModel::get_evaluate_template_list($param, $page, $per_page); $data['subject'] = C('subject'); $data['template_type'] = $template_type; $this->session->set_userdata($param); // 分页 $purl = site_url("admin/evaluate_template/index/{$template_type}"); $total = EvaluateTemplateModel::get_evaluate_template_list_count($param); $data['pagination'] = multipage($total, $per_page, $page, $purl); $data['template_type_name'] = self::$template_type_name; $this->load->view('evaluate_template/index', $data); }
public function index() { Fn::ajax_call($this, 'removeExamRelate', 'setExamRelateFlag'); $data = array(); $cond_param = array('er_exampid' => 0); $size = 15; $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $list = array(); $total = ZmossModel::examRelatelistCount($cond_param); if ($total) { $list = ZmossModel::examRelatelist($cond_param, $page, $size); $er_exampid = array(); foreach ($list as $k => $val) { $er_exampid[] = $val['er_examid']; unset($list[$k]); $list[$val['er_examid']] = $val; } $cond_param['er_exampid'] = implode(',', $er_exampid); $list2 = ZmossModel::examRelatelist($cond_param); $zmoss_examid = array(); foreach ($list2 as $item) { $list[$item['er_exampid']]['child'][] = $item; $zmoss_examid[] = $list[$item['er_exampid']]['er_zmoss_examid']; } $zmoss_examid = array_unique($zmoss_examid); $data['examrelatelist'] = ZmossModel::examlist('*', array('exam_id' => implode(',', $zmoss_examid))); } $data['list'] = $list; $data['admin_list'] = CpUserModel::get_cpuser_list(); // 分页 $purl = site_url('admin/zmoss/index/'); $data['pagination'] = multipage($total, $size, $page, $purl); $data['er_flag'] = array('未同步', '进行中', '同步失败', '同步成功'); $data['is_setexamrelate_priv'] = $this->check_power_new('zmoss_setexamrelate', false); $data['is_setexamrelatequestion_priv'] = $this->check_power_new('zmoss_setexamrelatequestion', false); $data['is_sync_result_priv'] = $this->check_power_new('zmoss_sync', false); $data['is_remove_priv'] = $this->check_power_new('zmoss_remove', false); $data['is_showresult_priv'] = $this->check_power_new('exam_index', false); // 模版 $this->load->view('zmoss/index', $data); }
public function index() { $param['profession_name'] = trim($this->input->get('profession_name')); $param['profession_emerging'] = implode(',', $this->input->get('profession_emerging')); $size = C('default_perpage_num'); $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $offset = ($page - 1) * $size; $total = ProfessionModel::professionListCount($param); if ($total) { $data['list'] = ProfessionModel::professionList($param, $page, $size); } // 分页 $purl = site_url('admin/profession/index/') . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); $data['search'] = $param; $data['priv_edit'] = $this->check_power_new('profession_edit', FALSE); $data['priv_delete'] = $this->check_power_new('profession_remove', FALSE); $data['priv_import'] = $this->check_power_new('profession_import', FALSE); $this->load->view('profession/index', $data); }
function system_adminaction_list() { $page_per = 20; $page = max(1, MooGetGPC('page', 'integer', 'G')); $limit = 20; $offset = ($page - 1) * $limit; $where = ''; $navcode = MooGetGPC('navcode', 'string', 'G'); if ($navcode) { $where = " WHERE navcode = '{$navcode}'"; } //note 得出总数 $sql = "SELECT count(1) as count FROM {$GLOBALS['dbTablePre']}admin_action {$where}"; $query = $GLOBALS['_MooClass']['MooMySQL']->getOne($sql); $total = $query['count']; //note 翻页地址 $currenturl = "index.php?action=system_adminaction&h=list&navcode={$navcode}"; $sql = "SELECT * FROM {$GLOBALS['dbTablePre']}admin_action {$where} ORDER BY id DESC LIMIT {$offset},{$limit}"; $action_list = $GLOBALS['_MooClass']['MooMySQL']->getAll($sql); $page_links = multipage($total, $page_per, $page, $currenturl); require_once adminTemplate('adminaction_list'); }
function site_skin_list() { global $_MooClass, $dbTablePre; //分页 $count = $_MooClass['MooMySQL']->getOne("select count(*) as c from {$dbTablePre}members_skin"); $page_per = 20; $limit = 20; $page = max(1, MooGetGPC('page', 'integer', 'G')); $total = $count['c']; $offset = ($page - 1) * $limit; $myurl = explode('|', getUrl()); $page_links = multipage($total, $page_per, $page, $myurl[1]); $skiname = MooGetGPC('skiname', 'string', 'P'); if ($skiname) { $sql_where = "where skiname='{$skiname}'"; } else { $sql_where = ''; } $sql = "select * from {$dbTablePre}members_skin {$sql_where} limit {$offset},20"; $site_skin_list = $_MooClass['MooMySQL']->getAll($sql); require adminTemplate('site_skin_list'); }
public function index($type_id = 0) { if (!$this->check_power('comparison_list,comparison_manage')) { return; } if ($type_id = intval($type_id)) { $type_detail = ComparisonTypeModel::get_comparison_type_by_id($type_id); } if (empty($type_detail)) { message('对比信息分类不存在!', site_url('admin/comparison_type/index')); } $size = C('admin_page_size'); $page = isset($_GET['page']) && intval($_GET['page']) > 1 ? intval($_GET['page']) : 1; $order_by = 'cmp_info_year DESC'; $select_what = 'cmp_info_id,cmp_info_year,cmp_info_score,updatetime,addtime'; // 查询条件 $condition = $param = $search = array(); $condition['cmp_type_id'] = $type_id; // 获取数据 $total = ComparisonInfoModel::get_comparison_info_count($condition); $list = array(); if ($total) { $list = ComparisonInfoModel::get_comparison_info_list($condition, $page, $size, $order_by, $select_what); } $data['type_detail'] =& $type_detail; $data['list'] =& $list; $data['search'] =& $search; // 分页 $purl = site_url('admin/comparison_info/index/' . $type_id) . ($param ? '?' . implode('&', $param) : ''); $data['pagination'] = multipage($total, $size, $page, $purl); // 学科、类型 $data['subjects'] = CpUserModel::get_allowed_subjects(); $data['class_list'] = ClassModel::get_class_list(); $data['priv_manage'] = $this->check_power('comparison_manage', FALSE); // 模版 $this->load->view('comparison_info/index', $data); }