@extends('cp.web.layouts.admin')

@section('content')
    <div class="row">
        <div class="col-lg-12">
            <h1 class="page-header">书籍列表</h1>
        </div>
        <!-- /.col-lg-12 -->
    </div>
    <div class="panel">
        @if (session('message'))
            <div class="alert alert-success" role="alert">{{session('message')}}</div>
        @endif

        @if(($errors->has('message')))
            <div class="alert alert-danger" role="alert">{{$errors->first('message')}}</div>
        @endif
        <form action='{{url("book/except")}}' method="get">
            <div class="form-group">
                <label>cp</label>
                <input class="form-control" name="cp" value="{{ @$params['book_name'] }}">
            </div>
            <button type="submit" class="btn btn-success">查询</button>
            <a type="button" class="btn btn-success" href="{{url('book/exceptadd')}}">添加</a>
        </form>
    </div>

    <div class="panel panel-default">

        <div class="panel-heading">
            列表
        </div>
        <!-- /.panel-heading -->
        <div class="panel-body">
            <div class="dataTable_wrapper">
                <table class="table table-striped table-bordered table-hover" id="dataTables-example" style="text-align: center">
                    <tr>
                        <th>cp</th>
                        <th>bid</th>
                        <th>书名</th>
                        <th>操作</th>
                    </tr>
                    @foreach ($data as $record)
                        <tr >
                            <td>{{ $record->username }}</td>
                            <td>{{ $record->bid }}</td>
                            <td>{{ $record->book_name }}</td>
                            <td><a  class="btn btn-danger"  href="{{url('book/deleteExcept?id='.$record->id)}}">删除</a></td>
                        </tr>
                    @endforeach
                </table>
            </div>
            <div class="paging">
                总计：{{ $data->total() }}
                {{ $data->appends($param)->links() }}
            </div>
        </div>
    </div>
    <script>

    </script>
@endsection
