public function listAdmin() { //管理员列表 $roleid = trim($_GET['roleid']); $keywords = trim(urldecode($_GET['keywords'])); $page = intval($_GET['page']) ? intval($_GET['page']) : 1; $where = ''; if ($roleid && $roleid > 0) { $where .= ($where ? ' AND ' : '') . " roleid='{$roleid}' "; } if ($keywords) { $where .= ($where ? ' AND ' : '') . " username LIKE '%{$keywords}%' OR realname LIKE '%{$keywords}%' "; } $M = M('admin'); $size = 10; $list = $M->listinfo($where, 'userid DESC', $page, $size); $roles = getcache('role', 'commons'); foreach ($list as $k => $v) { $list[$k]['rolename'] = $roles[$v['roleid']] ? $roles[$v['roleid']] : ''; if ($v['roleid'] == 10) { $list[$k]['schoolname'] = getSchoolnameByUserid($v['userid']); } } $pages = $this->getPagesArr($M->number, $size, $page); $this->jsonResult(array('list' => $list, 'pages' => $pages, 'currentPage' => $page)); }
?> animate.css" /> </head> <body ms-controller="menu" class="yahei"> <div id="header"> <h1><?php echo $sys_title['attr_value']; ?> </h1> <div class="control yahei"> <a class="t0" hideFocus> <?php if ($_SESSION['roleid'] == 10) { ?> <?php echo getSchoolnameByUserid($_SESSION['userid']); ?> 的 管理员: <?php } elseif ($_SESSION['roleid'] == 11) { ?> <?php echo getXiangzhenByUserid($_SESSION['userid']); ?> 的 管理员: <?php } else { ?> <?php } ?>