{extend name="layout:home" /}
{block name="container"}
<div class="layui-tab layui-tab-card">
    {include file="layout/admin_items" /}
    <div class="layui-tab-content page-tab-content">
		<!-- 搜索框 -->
		<div class="search-form">
		<form action="" method="post" enctype="multipart/form-data" >
			<div class="layui-form-item">
				<div class="layui-inline">
					<input type="text" name="title"  placeholder="输入管理员名称" autocomplete="off" class="layui-input">
				</div>
				<div class="layui-inline">
					<select name="admingroupid" lay-verify="" class="layui-select layui-unselect layui-form-select">
						<option value="">管理组</option>
						{foreach name="admin_group" item="v"}
							<option value="{$v.group_id}">{$v.group_name}</option>
						{/foreach}
					</select>
				</div>
				<div class="layui-inline">
					<button type="submit" class="layui-btn search-subBtn">搜索</button>
				</div>
				<div class="layui-inline right-per" style="float: right;">
					<div class="button-group">
						<button type="button" class="layui-btn"><i class="layui-icon layui-icon-table"></i><span>导出数据</span></button>
					</div>
				</div>
			</div>
			
		</form>
		</div>
        <table class="layui-table lay-even">
            <colgroup>
                <col width="150">
                <col width="200">
                <col>
            </colgroup>
            <thead>
            <tr>
                <th>{$Think.lang.admin_name}</th>
                <th>{$Think.lang.admin_lgoin_num}</th>
                <th>{$Think.lang.admin_is_super}</th>
                <th>{$Think.lang.admin_login_time}</th>
                <th>{$Think.lang.admin_add_time}</th>
                <th>状态</th>
                <th>{$Think.lang.ds_operation}</th>
            </tr>
            </thead>
            <tbody>
            {if $admin_list}
            {volist name="admin_list" id="admin"}
            <tr>
                <td>{$admin.admin_name}</td>
                <td>{$admin.admin_login_num}</td>
                <td>{$admin.group_name}</td>
                <td>{if condition="$admin.admin_login_time eq 0"}{$Think.lang.ds_no_login}{else}{$admin.admin_login_time|date='Y-m-d H:i:s',###}{/if}
                </td>
                <td>{if condition="$admin.admin_add_time eq 0"}{$Think.lang.ds_no_login}{else}{$admin.admin_add_time|date='Y-m-d H:i:s',###}{/if}</td>
                <td>{if condition="$admin.admin_status eq 0"}停用{else}启用{/if}</td>
                <td>
                    {if condition="$admin.admin_id eq 1"}
                    {$Think.lang.admin_non_editable}
                    {else}
                    <?php if(array_intersect(explode(" ",str_replace("/", ".","admin/edit")),$allpower)){ ?>
                        <a href="javascript:dsLayerOpen('{:url('Admin/edit',['admin_id'=>$admin.admin_id])}','{$Think.lang.ds_edit}-{$admin.admin_name}')" class="layui-btn layui-btn-xs"><i class="layui-icon layui-icon-edit"></i>{$Think.lang.ds_edit}</a>
                    <?php } ?>
                    <?php if(array_intersect(explode(" ",str_replace("/", ".","admin/del")),$allpower)){ ?>
                        <a href="javascript:dsLayerConfirm('{:url('admin/del',['admin_id'=>$admin.admin_id])}','{$Think.lang.admin_confirm_del}')" class="layui-btn layui-btn-xs layui-btn-danger"><i class="layui-icon layui-icon-delete"></i>{$Think.lang.ds_del}</a>
                    <?php } ?>
                    {/if}
                </td>
            </tr>
            {/volist}
            {else}
            <td>无数据</td>
            {/if}
            </tbody>
        </table>
        {$show_page}
    </div>
</div>
<script type="text/javascript">
	layui.use('laydate', function(){
	  var laydate = layui.laydate;
	  
	  //执行一个laydate实例
	  laydate.render({
		elem: '#creatTime' //指定元素
	  });
		laydate.render({
			elem:'#timeRang',
			range:true,
			format: 'yyyy/MM/dd',
			done: function(value, date){
				/* 时间选择完成后的回调 */
			}
		})
	});
</script>
{/block}