{include file="common/header"/}
<div class="lemo-container">
    <div class="lemo-main">
        <fieldset class="layui-elem-field layui-field-title">
            <legend>{:lang('admin')}{:lang('list')}</legend>

            <blockquote class="layui-elem-quote">
                <div class="lemo-table">
                    <div class="layui-inline">
                        <input type="text" name="keys" id="keys" lay-verify="required" placeholder="请输入" autocomplete="off" class="layui-input">

                    </div>
                    <button class="layui-btn data-add-btn layui-btn-sm" lay-submit="" lay-filter="search" id="search">搜索</button>
                    <a data-href='{:url("adminAdd")}' href="javascript:;" class="layui-btn layui-btn-sm layui-btn-warm add">{:lang('add')}{:lang('admin')}</a>

                </div>

            </blockquote>

        </fieldset>

        <table class="layui-table" id="list" lay-filter="list"></table>
    </div>
</div>
{include file="common/footer"/}

<script type="text/html" id="action">
    <a data-href="{:url('adminEdit')}?id={{d.id}}" class="layui-btn layui-btn-xs" lay-event="edit">{:lang('edit')}</a>
    {{# if(d.id==1){ }}
    <a href="#" class="layui-btn layui-btn-xs layui-btn-disabled">{:lang('del')}</a>
    {{# }else{  }}
    <a data-href="{:url('adminDel')}" class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">{:lang('del')}</a>
    {{# } }}
</script>
<script type="text/html" id="status">
    {{# if(d.id==1){ }}
    <input data-href="{:url('adminState')}" type="checkbox" disabled name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" checked>
    {{# }else{  }}
    <input data-href="{:url('adminState')}" type="checkbox" name="status" value="{{d.id}}" lay-skin="switch" lay-text="开启|关闭" lay-filter="status" {{ d.status == 1 ? 'checked' : '' }}>
    {{# } }}
</script>
<script>
    var tableIn;
    layui.config({
        base: "/static/admin/js/",
        version: true
    }).extend({
        Admin: 'Admin'
    }).use(['element', 'layer', 'Admin'], function () {
        var $ = layui.jquery,
            form = layui.form,
            table = layui.table;
        tableIn = table.render({
            elem: '#list',
            url: '{:url("adminList")}',
            method:'post',
            title:'{:lang("admin")}{:lang("list")}',
            cols: [[
                {field:'id', title: 'ID', width:60,fixed: true}
                ,{field:'username', title: '用户名', width:180}
                ,{field:'title', title: '{:lang("adminGroup")}', width:100}
                ,{field:'email', title: '{:lang("email")}', width:200}
                ,{field:'mobile', title: '{:lang("mobile")}', width:150}
                ,{field:'ip', title: '{:lang("ip")}',width:150,hide:true}
                ,{field:'status', title: '{:lang("status")}',width:150,toolbar: '#status'}
                ,{title:'操作',width:150, toolbar: '#action',align:"center"}
            ]]
        });

    });
</script>
