@extends('admin.layout') 

@section('content')
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-title">
					<h5>轮播图列表</h5>
					<div class="ibox-tools">
						<a class="collapse-link"> <i class="fa fa-chevron-up"></i>
						</a>
					</div>
				</div>
				<div class="ibox-content">
				    <div class="row">
				        <form method="GET" action="" accept-charset="UTF-8">

				        <div class="col-sm-4">
				            <div class="input-group">
								<input type="text" value="{{Request::get('keyword')}}"	placeholder="id/排序号" name="keyword"class="input-sm form-control">
								<span class="input-group-btn">
									<button type="submit" class="btn btn-sm btn-primary">搜索</button>
								</span>
    						</div>
				        </div>
				        </form>
    					<div class="col-sm-3 pull-right">
    					   <a href="{{ U('setting/banner/create')}}" class="btn btn-sm btn-primary pull-right">添加</a>
    					</div>
					</div>
					
					<table class="table table-striped table-bordered table-hover dataTables-example dataTable">
						<thead>
    						<tr>
								
            <th class="sorting" data-sort="id">id  </th>
            <th class="sorting" data-sort="value"> 图片 </th>
            <th class="sorting" data-sort="sort"> 排序 </th>
            <th class="sorting" data-sort="status"> 状态 </th>
        						<th width="22%">相关操作</th>
        					</tr>
						</thead>
						<tbody>
						@if(isset($list))
							@foreach($list as $key => $item)							<tr>
								
            <td>{{ $item->id }}</td>
            <td>
				<a href="{{ $item->value }}" target="_blank">
					<img style="width: 80px" src="{{ $item->value }}" alt="">
				</a>
			</td>
            <td>{{ $item->sort }}</td>
			<td>
				@if($item->status == 0)
					<button class="btn btn-sm btn-danger">禁用</button>
					@else
					<button class="btn btn-sm btn-success">启用</button>
				@endif
			</td>
								<td>
									<div class="btn-group">
										<button data-toggle="dropdown"
											class="btn btn-warning btn-sm dropdown-toggle"
											aria-expanded="false">
											操作 <span class="caret"></span>
										</button>
										<ul class="dropdown-menu">


											<li><a href="{{ U('setting/banner/update',['id'=>$item->id])}}" class="font-bold">修改</a></li>

											<li class="divider"></li>
											<li><a href="{{ U('setting/banner/destroy',['id'=>$item->id])}}" onclick="return confirm('你确定执行删除操作？');">删除</a></li>

										</ul>
									</div>
								</td>
							</tr>
							@endforeach
							@endif
						</tbody>
					</table>
					<div class="row">
						<div class="col-sm-6">
							<div class="dataTables_info" id="DataTables_Table_0_info"
								role="alert" aria-live="polite" aria-relevant="all">每页{{ $list->count() }}条，共{{ $list->lastPage() }}页，总{{ $list->total() }}条。</div>
						</div>
						<div class="col-sm-6">
						<div class="dataTables_paginate paging_simple_numbers" id="DataTables_Table_0_paginate">
						{!! $list->setPath('')->appends(Request::all())->render() !!}
						</div>
						</div>
					</div>
				</div>
			</div>
		</div>
	</div>
</div>
@endsection