<!doctype html>
<html class="no-js">
<head>

<include file="Common/head" />

    <style type="text/css">
        a.am-text-secondary:visited{color:#3bb4f2;}
        a.am-text-danger:visited{color:#dd514c;}
        .am-btn-default {background-color: #fff;}
        th {text-align:center;}
        tr td{text-align:center;}
        select{padding: 4px;border: 1px solid #ccc;}
        .am-popup-bd {background:#fff;}
        .am-popup-bd img {max-width: 100%}
        .am-u-sm-2 {border-top: 1px solid #ddd;margin-top: 10px;}
        .am-u-sm-10 {border-left: 1px solid #ddd;margin-top: 10px;}
    </style>
</head>
<body>

<include file="Common/header" />

<div class="am-cf admin">

    <!-- sidebar start -->
    <include file="Common/sidebar" nav="auth"/>
    <!-- sidebar end -->

    <!-- Start right Content here -->
    <div class="content-page" style="background: white;">
        <!-- Start content -->
        <div class="content">
            <div class="am-cf am-padding am-padding-bottom-0">
                <div class="am-fl am-cf">
                    <strong class="am-text-primary am-text-lg">首页</strong> / <small>分组</small>
                </div>
            </div>
            <hr>
            <div class="am-g">
                <div class="am-u-sm-12">
                    <form class="am-form" action="" method="POST" enctype="multipart/form-data">
                        <input type="hidden" name="id" value="{$info.id}"/>
                        <fieldset>
                            <legend>{$legend}</legend>

                            <div class="am-form-group">
                                <label for="groupname">组名</label>
                                <input type="text" name="groupname" class="" id="groupname" value="{$info.groupname}"/>
                            </div>

                             <label>
                                    权限
                                    <input type="button" id="chooseAll" class="am-btn am-btn-default" value="全选">
                                    <input type="button" id="cancalAll" class="am-btn am-btn-default" value="全部取消">
                            </label>
                            <hr/>

                            <?php foreach ($node_list as $vo) : ?>
                            <div class="am-form-group">
                                <div>
                                    <label class="am-checkbox-block">
                                        <input type="checkbox" name="auth[]" value="{$vo.auth_name}" class="toBeUsed" id="{$vo.auth_name}" <?php if(in_array($vo['auth_name'], $auth_list)){echo "checked";}?>>
                                        {$vo.title}<?php if (!empty($vo['remark'])) : ?>（{$vo.remark}）<?php endif;?>
                                    </label>
                                    <br>
                                    <?php foreach ($vo['menu_list'] as $vv) : ?>
                                    <label class="am-checkbox-inline">
                                        <input type="checkbox" name="auth[]" value="{$vv.auth_name}" class="toBeUsed" id="{$vv.auth_name}" <?php if(in_array($vv['auth_name'], $auth_list)){echo "checked";}?>>
                                        {$vv.title}<?php if (!empty($vv['remark'])) : ?>（{$vv.remark}）<?php endif;?>
                                    </label>
                                    <?php endforeach;?>
                                </div>
                            </div>
                            <hr>
                           <?php endforeach;?>
                            <p>
                                <button type="submit" class="am-btn am-btn-success">提交</button>
                                <input type="reset" class="am-btn am-btn-info" value="重置" style="margin-left:20px" />
                                <!-- <a href="javascript:location.href=history.back();">
                                    <input type="button" class="am-btn am-btn-default" value="返回" style="margin-left:20px" />
                                </a> -->
                            </p>
                        </fieldset>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <!-- content end -->
</div>

<include file="Common/footer" />

<script type="text/javascript">
    $(function(){
        //全选
        $("#chooseAll").click(function(event) {
            $(".toBeUsed").prop('checked', true);
        });
        //取消全选
        $("#cancalAll").click(function(event) {
            $(".toBeUsed").prop('checked', false);
        });
    });
</script>
</body>
</html>