@extends('layouts.main') 
@section('title', 'Calling 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>{{ __('Calling 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">{{ __('Calling Input')}}</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <div class="row clearfix">
            <div class="col-md-12">
                
                <form class="forms-sample"  method='POST' action="{{ route('getfilteredcallingreport') }}" >
                        @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='cd4' {{ $master == 'cd4' ? 'selected' : '' }}>CD4</option>
                                        <option value='tld' {{ $master == 'tld' ? 'selected' : '' }}>TLD</option>
                                        <option value='due_date' {{ $master == 'due_date' ? 'selected' : '' }}>Due Date Call</option>
                                        <option value='tb_follow' {{ $master == 'tb_follow' ? 'selected' : '' }}>TB Follow up</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 == 'cd4' || $master == 'tld')
                                        {{ $name->cd4_ci_outcome }}
                                        @elseif($master == 'due_date')
                                        {{ $name->due_date_outcome }}
                                        @elseif($master == 'tb_follow')
                                        {{ $name->tb_outcome }}
                                        @else
                                        {{ $name->lfu_ci_outcome }}
                                        @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
