@extends('adminlte::page')
@section('title_prefix', ($model->custom_list) ? $customListOptions[$model->custom_list].'｜' : '')
@section('title', 'Staff2000引当データ一覧')
@section('content_header')
    <h1>Staff2000引当データ一覧</h1>
    <ol class="breadcrumb">
        <li>
            <a href="{{ url('home') }}">
                <span class="glyphicon glyphicon-home"></span>Home
            </a>
        </li>
        <li class="active">Staff2000引当データ一覧</li>
    </ol>
@stop
@section('content')
    <div class="box">
        <div class="box-body">
            {{ Form::open(['id' => 'search-form', 'method' => 'POST']) }}
            @include('elements.tools', ['fnc' => 'staff2000_allocation', 'search' => $model])
            @include('elements.searcher_modal')
            {{ Form::close() }}
        </div>
    </div>
    <div class="box">
        <div class="box-header with-border">
            <h3 class="box-title">Staff2000引当データ管理</h3>
            <div class="pull-right">
                <a href="{{url('staff2000_allocation/import')}}" class="btn btn-default"><i class="fa fa-fw fa-upload"></i>CSVアップロード</a>
            </div>
        </div>
        <div class="margin btn-toolbar">
            <div class="pull-left">
                {{ $staff2000_allocations->total() }}件中 {{ $staff2000_allocations->firstItem() }}-{{ $staff2000_allocations->lastItem() }}件
            </div>
            {{ $staff2000_allocations->links() }}
        </div>
        <div class="box-body table-responsive no-padding">
            <table class="table table-striped table-highlight">
                <thead>
                <tr>
                    <th>詳細</th>
                    <th class="{{ $model->getSortClass('2or_code') }}" data-field="{{'2or_code'}}">ｵｰﾀﾞｰｺｰﾄﾞ</th>
                    <th>契約ステータス</th>
                    @foreach($model->custom_list_fields as $field)
                        <th class="{{ $model->getSortClass($field['field']) }}" data-field="{{$field['field']}}">
                            {{ $model::FIELD_NAME[$field['field']] }}
                        </th>
                    @endforeach
                </tr>
                </thead>
                <tbody>
                @foreach ($staff2000_allocations as $staff2000_allocation)
                    <tr>
                        <td><a href="{{ url('staff2000_allocation/view/' . $staff2000_allocation['2or_code']) }}" target="_blank">詳細</a></td>
                        <td>{{ $staff2000_allocation->{'2or_code'} }}</td>
                        <td>{{ $staff2000_allocation->contract_status }}</td>
                        @foreach($model->custom_list_fields as $field)
                            <td>{!! $staff2000_allocation->getIndexAttribute($field['field']) !!}</td>
                        @endforeach
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>
        <div class="box-footer">
            <div class="pull-left">
                {{ $staff2000_allocations->total() }}件中 {{ $staff2000_allocations->firstItem() }}-{{ $staff2000_allocations->lastItem() }}件
            </div>
            {{ $staff2000_allocations->links() }}
        </div>
    </div>

@endsection

@section('js')
    <script src="{{ asset('js/app.js') }}"></script>
@endsection

@push('css')
    <link rel="stylesheet" href="{{asset('/css/app.css')}}"/>
@endpush
