@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">

                        <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="picture">图片</th>
                                <th class="sorting" data-sort="order_id">订单信息</th>
                                <th class="sorting" data-sort="description"> 评分</th>
                                <th class="sorting" data-sort="picture"> 评价内容</th>
                            </tr>
                            </thead>
                            <tbody>
                            @if(isset($list))
                                @foreach($list as $key => $item)
                                    <tr>

                                        <td>{{ $item->id }}</td>
                                        <td><span style="cursor: pointer" onclick="layer.open({type: 2,area: ['80%', '90%'],title:'图片',content: '{{ U('Album/Review/picture',['id'=>$item->id])}}'});" class="label label-default">查看图片</span></td>
                                        <td>
                                            客户：{{ $item->order->customer_name }}<br/>
                                            订单号：{{ $item->order->sno }}<br/>
                                            下单时间：{{ $item->order->created_at }}<br/>
                                        </td>
                                        <td>
                                            客 服：{{ $item->verifier_review() }} <br/>
                                            生产部：{{ $item->producer_review() }} <br/>
                                            包装部：{{ $item->packer_review() }} <br/>
                                        </td>

                                        <td>{{ $item->description }}</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