<?php if (!defined('THINK_PATH')) exit(); /*a:2:{s:89:"C:\phpStudy\PHPTutorial\WWW\aqm-web\public/../application/admin\view\admingroup\form.html";i:1557480234;s:75:"C:\phpStudy\PHPTutorial\WWW\aqm-web\application\admin\view\layout\home.html";i:1557480234;}*/ ?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <title>安全猫官网</title>
        <meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
        <!-- Bootstrap 3.3.7 -->
        <link rel="stylesheet" href="<?php echo PLUGINS_SITE_ROOT; ?>/layui/css/layui.css">
        <link rel="stylesheet" href="<?php echo ADMIN_SITE_ROOT; ?>/css/admin.css">
        <link rel="stylesheet" href="<?php echo ADMIN_SITE_ROOT; ?>/iconfont/iconfont.css">
        <script src="<?php echo PLUGINS_SITE_ROOT; ?>/jquery-2.1.4.min.js"></script>
        <script src="<?php echo ADMIN_SITE_ROOT; ?>/js/admin.js"></script>
        <script type="text/javascript" src="<?php echo PLUGINS_SITE_ROOT; ?>/layui/layui.js"></script>
        <script type="text/javascript">
            var BASESITEROOT = "<?php echo BASE_SITE_ROOT; ?>";
            var ADMINSITEROOT = "<?php echo ADMIN_SITE_ROOT; ?>";
            var BASESITEURL = "<?php echo BASE_SITE_URL; ?>";
            var HOMESITEURL = "<?php echo HOME_SITE_URL; ?>";
            var ADMINSITEURL = "<?php echo ADMIN_SITE_URL; ?>";
            layui.use('layer', function () {
                var layer = layui.layer;
            });
        </script>
    </head>
    <body>
        
<form method="post">
    <div class="layui-tab layui-tab-card">
        <div class="layui-tab-content page-tab-content">
            <div class="layui-tab-item layui-show ">
                <div class="layui-form-item">
                    <label class="layui-form-label"><?php echo \think\Lang::get('admin_group_name'); ?></label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input field-name" name="group_name" id="group_name"
                               value="<?php echo (isset($group_info['group_name']) && ($group_info['group_name'] !== '')?$group_info['group_name']:''); ?>" lay-verify="group_name" autocomplete="off"
                               placeholder="<?php echo lang('ds_please_enter'); ?><?php echo lang('admin_group_name'); ?>" required/>
                    </div>
                </div>
                <table class="ds-default-table">
                    <thead>
                    <tr class="space">
                        <th><input id="limitAll" value="1" type="checkbox">&nbsp;&nbsp;<?php echo \think\Lang::get('admin_group_set_limt'); ?></th>
                    </tr>
                    </thead>
                    <tbody>
                    <?php if(is_array($limit) || $limit instanceof \think\Collection || $limit instanceof \think\Paginator): if( count($limit)==0 ) : echo "" ;else: foreach($limit as $k=>$v): ?>
                    <tr>
                        <td>
                            <label style="width:100px"><?php echo (isset($v['nav']) && ($v['nav'] !== '')?$v['nav']:''); ?></label>
                            <input id="limit<?php echo $k; ?>" type="checkbox" onclick="selectLimit('limit<?php echo $k; ?>')">
                            <label for="limit<?php echo $k; ?>"><b><?php echo $v['name']; ?></b></label>
                            <?php if(is_array($v['child']) || $v['child'] instanceof \think\Collection || $v['child'] instanceof \think\Paginator): if( count($v['child'])==0 ) : echo "" ;else: foreach($v['child'] as $xk=>$xv): if($admin_array == 'add'): ?>
                            <label><input dstype='limit' class="limit<?php echo $k; ?>" type="checkbox" name="permission[]" value="<?php echo $xv['action']; ?>"><?php echo $xv['name']; ?>&nbsp;</label>
                            <?php else: ?>
                            <label><input dstype="limit<?php echo $k; ?>" class="limit<?php echo $k; ?>" type="checkbox" name="permission[]" value="<?php echo $xv['action']; ?>" <?php if(in_array(substr($xv['action'],0,($t=strpos($xv['action'],'|'))?$t:100),$group_info['group_limits'])){ echo "checked=\"checked\""; }?>><?php echo $xv['name']; ?>&nbsp;</label>
                            <?php endif; endforeach; endif; else: echo "" ;endif; ?>
                        </td>
                    </tr>
                    <?php endforeach; endif; else: echo "" ;endif; ?>
                    </tbody>
                </table>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="submit" class="layui-btn layui-btn-normal" lay-submit value="<?php echo lang('ds_submit'); ?>"/>
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>
<script>
    function selectLimit(name) {
        if ($('#' + name).prop('checked')) {
            $('.' + name).prop('checked', true);
        } else {
            $('.' + name).prop('checked', false);
        }
    }
    $(function () {
        $('#limitAll').on('click', function () {
            if ($(this).prop('checked')) {
                $(this).parents('table').find('input:checkbox').prop('checked', true);
            } else {
                $(this).parents('table').find('input:checkbox').prop('checked', false);
            }
        });
    });
    layui.use('form', function () {
        var form = layui.form;
    });
</script>

    </body>
</html>



