<?php define('ROOT', dirname($_SERVER['SCRIPT_FILENAME'])); require ROOT . "/include/admin-init.php"; if (!is_login()) { die(html_jump('login.php')); } set_page_type('user', 'user_manage'); set_page_power(array(1)); set_title("用户管理"); $all_user = new user_info(); $all_user->get_all_user(); $all_group = new group(); $all_group->get_id_list(); if (isset($_GET['status']) && $_GET['status'] != 'OK') { add_footer_str('<script language="javascript">error_notic("' . $_GET['status'] . '","");</script>'); } get_admin_header(); ?> <div id="user-manage"> <h2 class="center">用户管理中心</h2> <table border="0" align="center" cellpadding="0" cellspacing="0"> <tr class="title"><th>ID</th><th>用户名</th><th>姓名</th><th>专业</th><th>班级</th><th>年级</th><th>分组</th><th>电话</th><th>QQ</th><th>邮箱</th><th>权限</th><th>状态</th><th>操作</th></tr> <?php $i = 0; foreach ($all_user->all as $id => $v) { echo "<tr class=\"list-", $i++ % 2, "\">", "<td>", $v['id'], "</td>", "<td>", $v['user'], "</td>", "<td>", $v['name'], "</td>", "<td>", $v['major'], "</td>", "<td>", $v['class'], "</td>", "<td>", $v['grade'], "</td>", "<td>", $all_group->id_list[$v['group']], '-', $v['group'], "</td>", "<td>", $v['tel'], "</td>", "<td>", $v['qq'], "</td>", "<td>", $v['email'], "</td>", '<td><a href="user-manage.php?act=chang-power&id=', $v['id'], '" title="修改权限">', get_power_name($v['power']), "</a></td>", "<td>", $v['active'] == 1 ? '<a href="user-action.php?act=unactive&id=' . $v['id'] . '" title="取消激活">激活</a>' : '<a href="user-action.php?act=active&id=' . $v['id'] . '" title="激活">未激活</a>', "</td>", '<td><a href="user-edit-info.php?id=', $v['id'], '">编辑</a> <a href="user-action.php?act=del&id=', $v['id'], '">删除</a></td>', "</tr>\n"; } ?> </table> </div>
</table> <input name="id" type="hidden" value="<?php echo $_GET['id']; ?> "> <input type="hidden" name="act" value="edit-user-group"> <p class="submit"><button type="submit">编辑分组</button></p> </form> <?php } ?> </div> <?php } if (isset($_GET['id']) && isset($_GET['act']) && $_GET['act'] == 'del' && is_number($_GET['id']) && $_GET['id'] > 0) { $group->get_id_list(); ?> <div id="edit-user-group"> <h2 class="center">删除分组 <?php echo $group->id_list[$_GET['id']]; ?> </h2> <?php if (!isset($group->id_list[$_GET['id']])) { echo '<p class="error">分组ID不存在或者ID有误</p>'; } else { ?> <form action="user-action.php" method="post"> <table> <tr><th>移动用户到</th><td><select name="group"> <option value=""></option>