@extends('layouts.app')

@section('title', '区画別利用状況')

@section('content')
<div class="content-header">
    <div class="container-fluid">
        <div class="row mb-2">
            <div class="col-lg-6">
                <h1 class="m-0 text-dark">区画別利用状況</h1>
            </div>
            <div class="col-lg-6">
                <ol class="breadcrumb float-sm-right text-sm">
                    <li class="breadcrumb-item"><a href="{{ route('home') }}">ホーム</a></li>
                    <li class="breadcrumb-item active">区画別利用状況</li>
                </ol>
            </div>
        </div>
    </div>
</div>

<section class="content">
    <div class="container-fluid">
        <div class="card">
            <div class="card-body">
                <table id="area-table" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>区画名</th>
                            <th>駐輪場名</th>
                            <th>市区名</th>
                            <th>利用数</th>
                        </tr>
                    </thead>
                    <tbody></tbody>
                </table>
            </div>
        </div>
    </div>
</section>

@push('scripts')
<script>
$(function () {
    $('#area-table').DataTable({
        processing: true,
        serverSide: false,
        ajax: {
            url: "{{ route('periodical.areaListData') }}",
            dataSrc: 'data'
        },
        columns: [
            { data: 'area_name' },
            { data: 'parking_name' },
            { data: 'city_name' },
            { data: 'usage_count' }
        ]
    });
});
</script>
@endpush
@endsection
