{extend name="layout:home" /}

{block name="container"}
<?php 
    if(empty($qxgroup_name)){
        $qxgroup_name="";
        echo $qxgroup_name;
    } 
    if(empty($qxgroup_id)){
        $qxgroup_id=0;
    }
    if(empty($suosgs)){
        $suosgs=0;
    }
?>
<form class="layui-form layui-form-pane" 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">{$Think.lang.admin_name}</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input field-name" name="admin_name" id="admin_name" value="{$admin.admin_name|default=''}" lay-verify="admin_name" autocomplete="off" placeholder="{:lang('ds_please_enter')}{:lang('admin_name')}" required />
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">{$Think.lang.admin_password}</label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input field-name" name="admin_password" id="admin_password" value=""  placeholder="{if $admin.add eq '1'} {:lang('ds_please_enter')}{:lang('admin_password')}{else}{:lang('admin_edit_password_keep')}{/if} " />
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label">{$Think.lang.admin_qxzmz}</label>
                    <div class="layui-input-block">
                        <select name="group_id" id="groups" lay-filter="groups">
                            <option value="{$qxgroup_id}">{if $qxgroup_name}{$qxgroup_name}{else /}请选择权限组{/if}</option>
                            {if $is_super==1}
                                {foreach name="admin_group" item="v"}
                                <option value="{$v.group_id}">{$v.group_name}</option>
                                {/foreach}
                            {else /}
                                <option value="3">客服</option>
                            {/if}
                        </select>
                    </div>
                </div>
                {if $is_super==1}
                <div class="layui-form-item" id="oajax">
                    <label class="layui-form-label">所属公司</label>
                    <div class="layui-input-block">
                        <select name="admin_pid" lay-filter="groups">
                            <option value="{$suosgs['admin_id']}"><?php if($suosgs){echo $suosgs['admin_name'];}else{echo "请选择所属公司";} ?></option>
                            {foreach name="jlzgsmz" item="vv"}
                            <option value="{$vv.admin_id}">{$vv.admin_name}</option>
                            {/foreach}
                        </select>
                    </div>
                    <p style="margin-left:110px;color:red">* 若选择客服必选所属公司,若选择经理组不必选择</p>
                </div>
                {/if}
                <div class="layui-form-item">
                    <label class="layui-form-label">是否启用</label>
                    <div class="layui-input-inline">
                        <input type="checkbox" name="admin_status" lay-skin="switch" lay-text="{$Think.lang.ds_yes}|{$Think.lang.ds_no}" value="1" {if condition="$admin.admin_status eq '1'"}checked{/if}>
                    </div>
                </div>
                <div class="layui-form-item">
                    <div class="layui-input-block">
                        <input type="submit" class="layui-btn layui-btn-normal" lay-submit value="{:lang('ds_submit')}" />
                    </div>
                </div>
            </div>
        </div>
    </div>
</form>

<script>
    layui.use('form', function() {
        var form = layui.form;
        form.on('select(groups)',function(data){
            
        });
    });
    
</script>
<script type="text/javascript" charset="utf-8">
    
</script>
{/block}
