@extends('layouts.main') 
@section('title', 'Client Register 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>{{ __('Client Register Data') }}</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">{{ __('Client Register')}}</li>
                        </ol>
                    </nav>
                </div>
            </div>
        </div>
        
        <?php
        use App\User;
        $id = Auth::user()->id;
        $user  = User::with('roles','permissions')->find($id);
        ?>
        
        <div class="row clearfix">
            <div class="col-md-12">
                @if(session()->has('success'))
                <div class="box no-border">
                    <div class="box-tools">
                        <p class="alert alert-success alert-dismissible">
                            {{ session()->get('success') }}
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        </p>
                    </div>
                </div>
                @endif
                @if(session()->has('error'))
                <div class="box no-border">
                    <div class="box-tools">
                        <p class="alert alert-danger alert-dismissible">
                            {{ session()->get('error') }}
                            <button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                        </p>
                    </div>
                </div>
                @endif
                <div class="card">
                    <div class="card-header">
                        <div class="col-md-9 pl-0">
                            <h3>{{ __('Client Registration Data Table') }}</h3>
                        </div>
                        <!--<div class="col-md-3 text-right">-->
                        <!--    <a href="{{'upload-patient'}}" class='btn btn-primary'>{{__('Import Client Register')}}</a>-->
                        <!--</div>-->
                    </div>
                    <div class="card-body table-responsive">
                        <table id="myAdvancedTable" class="table p-3">
                            <thead>
                                <tr>
                                    <th style="display: none;">{{ __('State Code') }}</th>
                                    <th style="display: none;">{{ __('Dist Code') }}</th>
                                    <th>{{ __('Staff Code') }}</th>
                                    <th style="display: none;">{{ __('ART Center Code') }}</th>
                                    <th style="display: none;">{{ __('Client UID') }}</th>
                                    <th>{{ __('Date of Entry') }}</th>
                                    <th>{{ __('Pre ART REG Num') }}</th>
                                    <th>{{ __('ART REG Num') }}</th>
                                    <th>{{ __('Client Name') }}</th>
                                    <th style="display: none;">{{ __('Client DOB') }}</th>
                                    <th style="display: none;">{{ __('Client Age') }}</th>
                                    <th style="display: none;">{{ __('Client Sex') }}</th>
                                    <th>{{ __('Mobile Num') }}</th>
                                    <th style="display: none;">{{ __('Alternate Num') }}</th>
                                    <th style="display: none;">{{ __('Client District') }}</th>
                                    <th style="display: none;">{{ __('Client City') }}</th>
                                    <th style="display: none;">{{ __('Client Subdistrict- Mandal/Block') }}</th>
                                    <th style="display: none;">{{ __('Client Address') }}</th>
                                    <th style="display: none;">{{ __('Client Pincode') }}</th>
                                    <th style="display: none;">{{ __('Client Status') }}</th>
                                    <th>{{ __('Action') }}</th>
                                </tr>
                            </thead>
                            <tbody>
                                 @foreach ($getdata as $getdatas)
                                <tr>
                                    <td style="display: none;">{{ $getdatas->state_code }}</td>
                                    <td style="display: none;">{{ $getdatas->dist_code }}</td>
                                    <td>{{ $getdatas->emp_code }}</td>
                                    <td style="display: none;">{{ $getdatas->art_centre }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_uid }}</td>
                                    <td>{{ $getdatas->doe }}</td>
                                    <td>{{ $getdatas->pre_art_reg_num }}</td>
                                    <td>{{ $getdatas->art_reg_num }}</td>
                                    <td>{{ $getdatas->pat_name }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_dob }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_age }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_sex }}</td>
                                    <td>{{ $getdatas->pat_mobile }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_alternate_mobile }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_district }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_city }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_mandal }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_address }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_pincode }}</td>
                                    <td style="display: none;">{{ $getdatas->pat_status }}</td>
                                    <td>
                                        @if(\Session::get('loggindata')->client_reg_modify == 'Yes')
                                        <a href='{{'editpatient/'.$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
