| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182 |
- <?php
- /**
- * 管理员组列表
- *
- * @createtime 2018/03/01
- * @author 空竹
- * @copyright 芝麻开发(http://www.zhimawork.com)
- */
- require_once('admin_init.php');
- require_once('admincheck.php');
- $POWERID = '9001';//权限
- Admin::checkAuth($POWERID, $ADMINAUTH);
-
- ?>
- <!DOCTYPE html>
- <html>
- <head>
- <?php include('htmlhead.inc.php');?>
- <title>管理员组 - 管理设置 - 管理系统</title>
- </head>
- <body>
- <div id="header">
- <?php include('top.inc.php');?>
- <?php
- $FLAG_TOPNAV = 'system';//主菜单焦点
- include('nav.inc.php');
- ?>
- </div>
- <div id="container">
- <?php
- $FLAG_LEFTMENU = 'admingroup_list';//左侧子菜单焦点
- include('admin_menu.inc.php');
- ?>
- <div id="maincontent">
- <div class="zm_handle">
- <div class="btns">
- <input type="button" class="btn-handle btn-yellow" id="btn_order" value="保存排序"/>
- <input type="button" class="btn-handle" id="btn_add" value="添加管理员组"/>
- </div>
- </div>
- <div class="tablelist">
- <table>
- <tr>
- <th>组ID</th>
- <th>组名称</th>
- <th>排序</th>
- <th>操作</th>
- </tr>
- <?php
- $rows = Admingroup::getList();
- if(!empty($rows)){
- foreach($rows as $row){
- $isSuperGroup = 0;
- if($row['id'] == 1) $isSuperGroup = 1;//超级管理员组
- ?>
- <tr>
- <td class="center"><?php echo $row['id'];?></td>
- <td><?php echo $row['name'];?></td>
- <td class="center">
- <?php
- if($isSuperGroup == 1) {
- echo '<input type="text" class="order-input" name="order_super" value="'.$row['order'].'" disabled="disabled">';
- }else{
- echo '<input type="text" class="order-input" name="order" value="'.$row['order'].'">';
- echo '<input type="hidden" value="'.$row['id'].'" name="rowid"/>';
- }
- ?>
-
- </td>
- <td class="center">
- <?php
- if($isSuperGroup == 0){
- ?>
- <a href="admingroup_auth.php?id=<?php echo $row['id']?>" title="设置权限"><i class="fa fa-cog"></i></a>
- <a href="javascript:edit(<?php echo $row['id'];?>)" title="修改"><i class="fa fa-edit"></i></a>
- <a href="javascript:del(<?php echo $row['id'];?>)" title="删除"><i class="fa fa-remove"></i></a>
- <?php }?>
- </td>
- </tr>
- <?php
- }
- }else{
- echo '<tr><td colspan="4" class="center">没有数据</td></tr>';
- }
- ?>
- </table>
- <div id="pagelist">
- <div class="pageinfo">
- <span class="table_info">共<?php echo count($rows);?>条数据</span>
- </div>
- </div>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- <?php include('footer.inc.php');?>
- <script type="text/javascript">
- $(function(){
- //添加
- $('#btn_add').click(function(){
- layer.open({
- type: 2,
- title: '添加管理员组',
- shadeClose: true,
- shade: 0.3,
- area: ['500px', '300px'],
- content: 'admingroup_add.php'
- });
- });
-
- //排序
- $('#btn_order').click(function(){
- var orderList = $('input[name="order"]').map(function(){ return $(this).val(); }).get().toString();
- var idList = $('input:hidden[name="rowid"]').map(function(){ return $(this).val(); }).get().toString();
- $.getJSON('admingroup_do.php?act=order',{order:orderList, id:idList},function(data){
- var code = data.code;
- var msg = data.msg;
- switch(code){
- case 1:
- layer.alert(msg, {icon: 6}, function(index){
- location.reload();
- });
- break;
- default:
- layer.alert(msg, {icon: 5});
- }
- });
- });
- });
- //修改
- function edit(id){
- layer.open({
- type: 2,
- title: '修改管理员组',
- shadeClose: true,
- shade: 0.3,
- area: ['500px', '300px'],
- content: 'admingroup_edit.php?id='+id
- });
- }
- //删除
- function del(id){
- layer.confirm('确认删除该管理员组吗?', {
- btn: ['确认','取消']
- }, function(){
- var index = layer.load(0, {shade: false});
- $.ajax({
- type : 'POST',
- data : {
- id : id
- },
- dataType : 'json',
- url : 'admingroup_do.php?act=del',
- success : function(data){
- layer.close(index);
- var code = data.code;
- var msg = data.msg;
- switch(code){
- case 1:
- layer.alert(msg, {icon: 6}, function(index){
- location.reload();
- });
- break;
- default:
- layer.alert(msg, {icon: 5});
- }
- }
- });
- }, function(){}
- );
- }
- </script>
- </body>
- </html>
|