@extends('layouts.main') 
@section('title', 'Outreach Input Report')
@section('content')
    <!-- push external head elements to head -->
    @push('head')
        <link rel="stylesheet" href="{{ asset('plugins/DataTables/datatables.min.css') }}">
        <link rel="stylesheet" href="{{ asset('plugins/jquery-ui/jquery-ui.css') }}">
    @endpush

    
    <div class="container-fluid">
        <div class="page-header">
            <div class="row align-items-end">
                <div class="col-lg-8">
                    <div class="page-header-title">
                        <i class="ik ik-pie-chart bg-blue"></i>
                        <div class="d-inline">
                            <h5>{{ __('Outreach Input Report') }}</h5>
                        </div>
                    </div>
                </div>
                <div class="col-lg-4">
                    <nav class="breadcrumb-container" aria-label="breadcrumb">
                        <ol class="breadcrumb">
                            <li class="breadcrumb-item">
                                <a href="{{route('dashboard')}}"><i class="ik ik-home"></i></a>
                            </li>
                            
                           <li class="breadcrumb-item active" aria-current="page">{{ __('Outreach Input')}}</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <div class="row clearfix">
            <div class="col-md-12">
                
                <form class="forms-sample"  method='POST' action="{{ route('getfilteredoutreachreport') }}" >
                        @csrf
                            <div class="form-group row">
                                <div class="col-3">
                                    <select name='master_name' id='master' class='form-control' required>
                                        <option value="">Select Master</option>
                                        <option value='lfu' {{ $master == 'lfu' ? 'selected' : '' }}>LFU</option>
                                        <option value='mis' {{ $master == 'mis' ? 'selected' : '' }}>MIS</option>
                                        <option value='hd' {{ $master == 'hd' ? 'selected' : '' }}>Home Delivery</option>
                                        <option value='vl' {{ $master == 'vl' ? 'selected' : '' }}>VL</option>
                                    </select>
                                </div>
                                <div class="col-2">
                                    <button type="submit" id="submit" class="btn btn-primary mr-2">{{ __('Submit')}}</button>
                                </div>
                            </div>
                        </form>
                <div class="card">
                    <!--<div class="card-header">-->
                    <!--    <h3>{{ __('Outreach Input Report') }}</h3>-->
                    <!--</div>-->
                    
                    <div class="card-body table-responsive">
                        
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th>{{ __('Name') }}</th>
                                    @foreach($month_arr as $month)
                                    <th>{{date('M-Y',strtotime($month.'-01'))}}</th>
                                    @endforeach
                                </tr>
                            </thead>
                            <tbody>
                                 @foreach ($getdata as $name)
                                <tr>
                                    
                                    <td>
                                        @if($master == 'hd')
                                        {{ $name->hd_outcome }}
                                        @elseif($master == 'vl')
                                        {{ $name->vl_outcome }}
                                        @else
                                        {{ $name->lfumis_name }}
                                        @endif
                                    </td>
                                    @foreach($name->count_arr as $count)
                                    <th>{{$count}}</th>
                                    @endforeach
                                </tr>
                                @endforeach
                            </tbody>
                        </table>
                    </div>
                </div> 
            </div>
        </div>
    </div>

    <!-- push external js -->
    @push('script')
    <script src="{{ asset('plugins/jquery-ui/jquery-ui.min.js') }}"></script>
    <script src="{{ asset('plugins/DataTables/datatables.min.js') }}"></script>
    <!--get editable datatable script-->
    <script src="{{ asset('js/editable-datatable.js') }}"></script>
    @endpush
@endsection
