@extends('layouts.main') 
@section('title', 'Outreach Input Data')
@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 Data') }}</h5>
                            <!-- <span>{{ __('EJAF.') }}</span> -->
                        </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">
                <div class="card">
                    <div class="card-header">
                        <h3>{{ __('Outreach Input Data Table') }}</h3>
                    </div>
                    <div class="card-body table-responsive">
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th>{{ __('DATE OF ENTRY') }}</th>
                                    <th style="display: none;">{{ __('STATE CODE') }}</th>
                                    <th style="display: none;">{{ __('DIST CODE') }}</th>
                                    <th>{{ __('STAFF CODE') }}</th>
                                    <th style="display: none;">{{ __('Client ART Center Code') }}</th>
                                    <th style="display: none;">{{ __('Client Mobile') }}</th>
                                    <th>{{ __('Pre ART REG Number') }}</th>
                                    <th>{{ __('ART REG Number') }}</th>
                                    <th>{{ __('Client Name') }}</th>
                                    <th>{{ __('Linelist Received Date') }}</th>
                                    <th style="display: none;">{{ __('Due date of Visit to ARTC') }}</th>
                                    <th style="display: none;">{{ __('Date of last visit to ARTC') }}</th>
                                    <th>{{ __('CONTACT VISIT') }}</th>
                                    <th style="display: none;">{{ __('CONTACT DATE V1') }}</th>
                                    <th style="display: none;">{{ __('CONTACT MODE V1') }}</th>
                                    <th style="display: none;">{{ __('Reason for Calling/Visit V1') }}</th>
                                    <th style="display: none;">{{ __('Outcome of Calling/Visit V1') }}</th>
                                    <th style="display: none;">{{ __('LINELIST OTHER REASON V1') }}</th>
                                    <th style="display: none;">{{ __('CONTACT DATE V2') }}</th>
                                    <th style="display: none;">{{ __('CONTACT MODE V2') }}</th>
                                    <th style="display: none;">{{ __('Reason for Calling/Visit V2') }}</th>
                                    <th style="display: none;">{{ __('Outcome of Calling/Visit V2') }}</th>
                                    <th style="display: none;">{{ __('LINELIST OTHER REASON V2') }}</th>
                                    <th style="display: none;">{{ __('CONTACT DATE V3') }}</th>
                                    <th style="display: none;">{{ __('CONTACT MODE V3') }}</th>
                                    <th style="display: none;">{{ __('Reason for Calling/Visit V3') }}</th>
                                    <th style="display: none;">{{ __('Outcome of Calling/Visit V3') }}</th>
                                    <th style="display: none;">{{ __('LINELIST OTHER REASON V3') }}</th>
                                    <th style="display: none;">{{ __('CONTACT DATE V4') }}</th>
                                    <th style="display: none;">{{ __('CONTACT MODE V4') }}</th>
                                    <th style="display: none;">{{ __('Reason for Calling/Visit V4') }}</th>
                                    <th style="display: none;">{{ __('Outcome of Calling/Visit V4') }}</th>
                                    <th style="display: none;">{{ __('LINELIST OTHER REASON V4') }}</th>
                                    <th style="display: none;">{{ __('CONTACT DATE V5') }}</th>
                                    <th style="display: none;">{{ __('CONTACT MODE V5') }}</th>
                                    <th style="display: none;">{{ __('Reason for Calling/Visit V5') }}</th>
                                    <th style="display: none;">{{ __('Outcome of Calling/Visit V5') }}</th>
                                    <th style="display: none;">{{ __('LINELIST OTHER REASON V5') }}</th>
                                    <th style="display: none;">{{ __('FINAL OUTCOME') }}</th>
                                    <th style="display: none;">{{ __('FINAL OUTCOME NAME') }}</th>
                                    <th style="display: none;">{{ __('FINAL OUTCOME DATE') }}</th>
                                    <th>{{ __('Action') }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                 @foreach ($getdata as $getdatas)
                                <tr>
                                    <td>
                                        @if(isset($getdatas->doe))
                                        {{ date('d-m-Y',strtotime($getdatas->doe)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->state_code }}</td>
                                    <td style="display: none;">{{ $getdatas->dist_code }}</td>
                                    <td>{{ $getdatas->emp_code }}</td>

                                    <?php
                                    $getpatregdata = DB::table('patient_register')->where(['id'=>$getdatas->pat_uid])->first();
                                    ?>
                                    <td style="display: none;">{{ $getpatregdata->art_centre_code ?? '' }}</td>
                                    <td style="display: none;">{{ $getpatregdata->pat_mobile ?? '' }}</td>
                                    <td>{{ $getpatregdata->pre_art_reg_num ?? '' }}</td>
                                    <td>{{ $getpatregdata->art_reg_num ?? '' }}</td>
                                    <td>{{ $getpatregdata->pat_name ?? '' }}</td>
                                    <td>
                                        @if(isset($getdatas->linelist_date))
                                        {{ date('d-m-Y',strtotime($getdatas->linelist_date)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->dlva_date))
                                        {{ date('d-m-Y',strtotime($getdatas->dlva_date)) }}
                                        @endif
                                        </td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->ddva_date))
                                        {{ date('d-m-Y',strtotime($getdatas->ddva_date)) }}
                                        @endif
                                    </td>
                                    <td>{{ $getdatas->contact_visit }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->contact_date_v1))
                                        {{ date('d-m-Y',strtotime($getdatas->contact_date_v1)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->contact_mode_v1 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_v1 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_id_v1 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_other_reason_v1 }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->contact_date_v2))
                                        {{ date('d-m-Y',strtotime($getdatas->contact_date_v2)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->contact_mode_v2 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_v2 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_id_v2 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_other_reason_v2 }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->contact_date_v3))
                                        {{ date('d-m-Y',strtotime($getdatas->contact_date_v3)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->contact_mode_v3 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_v3 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_id_v3 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_other_reason_v3 }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->contact_date_v4))
                                        {{ date('d-m-Y',strtotime($getdatas->contact_date_v4)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->contact_mode_v4 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_v4 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_id_v4 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_other_reason_v4 }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->contact_date_v5))
                                        {{ date('d-m-Y',strtotime($getdatas->contact_date_v5)) }}
                                        @endif
                                    </td>
                                    <td style="display: none;">{{ $getdatas->contact_mode_v5 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_v5 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_reason_id_v5 }}</td>
                                    <td style="display: none;">{{ $getdatas->linelist_other_reason_v5 }}</td>
                                    <td style="display: none;">{{ $getdatas->final_outcome }}</td>
                                    <td style="display: none;">{{ $getdatas->final_outcome_id }}</td>
                                    <td style="display: none;">
                                        @if(isset($getdatas->final_outcome_date))
                                        {{ date('d-m-Y',strtotime($getdatas->final_outcome_date)) }}
                                        @endif
                                    </td>
                                    <td>
                                        @if(\Session::get('loggindata')->outreach_modify == 'Yes' && $getdatas->contact_visit < 6)
                                        <a href="{{'editoutreachinput/'.$getdatas->id}}" class='btn btn-success'>Edit</a> 
                                        @endif
                                    </td>
                                </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
