@extends('layouts/contentLayoutMaster')

@section('title', 'DataTables')

@section('vendor-style')
    {{-- vendor css files --}}
    <link rel="stylesheet" href="{{ asset(mix('vendors/css/tables/datatable/dataTables.bootstrap5.min.css')) }}">
    <link rel="stylesheet" href="{{ asset(mix('vendors/css/tables/datatable/responsive.bootstrap5.min.css')) }}">
    <link rel="stylesheet" href="{{ asset(mix('vendors/css/pickers/flatpickr/flatpickr.min.css')) }}">
    <link rel="stylesheet" href="{{ asset(mix('vendors/css/forms/select/select2.min.css')) }}">
@endsection

@section('page-style')
    {{-- Page Css files --}}
    <link rel="stylesheet" type="text/css" href="{{ asset('css/base/plugins/forms/pickers/form-flat-pickr.css') }}">

@endsection


@section('content')
    <section id="ajax-datatable">
        <div class="row">
            <div class="col-12">
                <div class="card">
                    <div class="card-header border-bottom d-flex " style="justify-content: space-between !important">
                        <h4 class="card-title">Hasil Perhitungan Semua Bantaran Sungai</h4>
                    </div>
                    <div class="card-datatable m-1">
                        <div class="table-responsive">
                            <table class=" table-hover   table-striped table tables-responsive" style="width:100% !important"
                                id="table" >
                                <thead>
                                    <tr>
                                        <th>#</th>
                                        <th class="bor text-center" colspan="4" >Bantaran Sungai</th>
                                        <th class="bor text-center" colspan="4"  >Hulu Sungai</th>
                                    </tr>
                                    <tr>
                                        {{-- bantaran    --}}
                                        <th></th>
                                        <th class="text-center">Nama</th>
                                        <th  class="text-center">Kecamatan</th>
                                        <th  class="text-center">Ketinggian Air</th>
                                        <th  class="text-center">Status</th>

                                        {{-- hulu --}}
                                        <th  class="text-center">Nama</th>
                                        <th  class="text-center">Ketinggian Air</th>
                                        <th  class="text-center">Status</th>
                                        <th  class="text-center">Waktu</th>
                                    </tr>
                                </thead>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>

@endsection


@section('vendor-script')
    {{-- vendor files --}}
    <script src="{{ asset(mix('vendors/js/tables/datatable/jquery.dataTables.min.js')) }}"></script>
    <script src="{{ asset(mix('vendors/js/tables/datatable/dataTables.bootstrap5.min.js')) }}"></script>
    <script src="{{ asset(mix('vendors/js/tables/datatable/dataTables.responsive.min.js')) }}"></script>
    <script src="{{ asset(mix('vendors/js/tables/datatable/responsive.bootstrap5.js')) }}"></script>
    <script src="{{ asset(mix('vendors/js/pickers/flatpickr/flatpickr.min.js')) }}"></script>
    <script src="{{ asset(mix('vendors/js/forms/select/select2.full.min.js')) }}"></script>
    <script src="{{ asset('vendors/js/charts/apexcharts.min.js') }}"></script>
@endsection

@section('page-script')
    {{-- Page js files --}}
    <script src="{{ asset(mix('js/scripts/tables/table-datatables-advanced.js')) }}"></script>
    <script src="{{ asset(mix('js/scripts/forms/form-select2.js')) }}"></script>
    <script src="{{ asset(mix('js/scripts/components/components-modals.js')) }}"></script>
    <script>
        $(document).ready(function() {
            $("#table").DataTable({
                processing: true,
                serverSide: true,
                ajax: "{{ url('hasil_pehitungan/ambil_perhitungan_bantaran') }}",
                columns: [{
                        data: "DT_RowIndex",
                        name: "DT_RowIndex",
                        orderable: false,
                        searchable: false
                    },
                    {
                        data: 'nama_bantaran',
                        name: 'nama_bantaran',
                        orderable: false
                    },
                    {
                        data: 'kecamatan',
                        name: 'kecamatan',
                        orderable: false
                    },
                    {
                        data: 'ketinggian_air_bantaran',
                        name: 'ketinggian_air_bantaran',
                        orderable: false
                    },
                    {
                        data: 'status_ketinggian_bantaran',
                        name: 'status_ketinggian_bantaran',
                        orderable: false
                    },
                    {
                        data: 'nama_hulu',
                        name: 'nama_hulu',
                        orderable: false
                    },
                    {
                        data: 'ketinggian_air_hulu',
                        name: 'ketinggian_air_hulu',
                        orderable: false
                    },
                    {
                        data: 'status_ketinggian_hulu',
                        name: 'status_ketinggian_hulu',
                        orderable: false
                    },
                    {
                        data: 'waktu',
                        name: 'waktu',
                        orderable: false
                    }
                ]
            });
        });
    </script>
@endsection
