<?php /* /www/wwwroot/jian/resources/views/Admin/user-list.blade.php */ ?>
<?php $__env->startSection('admin'); ?>

<div class="content-wrapper" style="min-height: 810px;">
    <section class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h4>用户列表</h4>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="/admin/index">首页</a></li>
              <li class="breadcrumb-item active">用户管理</li>
              <li class="breadcrumb-item active">用户列表</li>
            </ol>
          </div>
        </div>
      </div><!-- /.container-fluid -->
    </section>
    <div class="col-xs-3">
        <a href="javascript:window.location.href='/admin/vip/list'" class="btn btn-success" style="margin-left:17px;margin-bottom:15px"> 查看会员</a>
    </div>
    
    <!-- Main content -->
    <section class="content">
      <div class="container-fluid">
        <div class="row">
          <div class="col-md-12">

            <div class="card">
              <!-- /.card-header -->
              <div class="card-body p-0">
                <table class="table table-condensed">
                  <tbody>

                  <tr style="text-align:center">
                    <th>头像</th>
                    <th>昵称</th>
                    <th>状态</th>
                  </tr>
                <?php $__currentLoopData = $user; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $val): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                  <tr style="text-align:center">
                    <input type="hidden" value="<?php echo e($val -> id); ?>">
                    <td><img src="<?php echo e($val -> header); ?>" style="height:40px;width:40px"></td>
                    <td><?php echo e($val -> nickname); ?></td>
                    <td>
                        <?php if($val -> status == 1): ?>
                        <a href="javascript:void(0)" onclick="status(<?php echo e($val -> id); ?>)"><span class="badge bg-success">正常</span></a>
                        <?php else: ?>
                        <a href="javascript:void(0)" onclick="status(<?php echo e($val -> id); ?>)"><span class="badge bg-danger">冻结</span></a>
                        <?php endif; ?>
                    </td>
                  </tr>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody></table>
                
              </div>
              
            </div>
            <span class="pull-right"><?php echo e($user -> appends($a->page) -> links()); ?></span>
          </div>
        </div>
    </section>
  </div>
<script src="/admin/plugins/jquery/jquery.min.js"></script>
<script src="/admin/layer-v3.1.1/layer/layer.js"></script>
<script>
    function status(id)
    {
        if(!id){
            layer.msg('参数错误');
            return false;
        }
        layer.confirm('确认操作吗？', {
            btn: ['确认','取消'] //按钮
            }, function(){
                $.get('/admin/user/status',{id:id},function(res){
                    if(res.code == '1000'){
                        layer.msg(res.msg);
                        window.location.reload();
                    }else{
                        layer.msg(res.msg);
                    }
                })
        });  
    }
</script>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('title','用户列表'); ?>
<?php $__env->startSection('user','menu-open'); ?>
<?php $__env->startSection('user2','active'); ?>
<?php $__env->startSection('user-list','active'); ?>
<?php echo $__env->make('Public.index', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>