<x-app-layout>
    <x-slot name="header">
        <div class="row">
            <div class="col-6">
                <h4 class="" title><i class="circular icon fa fa-list"></i> {{ __('boarding_pases')  }} </h4>
            </div>
         
        </div>
    </x-slot>
    <div class="row">
        <div class="col-12">
            <div class="card">
                 <div class="card-body">
                    <form method="get">
                        <div class="row">
                            <div class="col-3 form-group">
                                <label class="control-label" for="o">{{ __('code boarding_passes') }}</label>

                                <input type="text"  name="code" for="from" class="form-control date" value={{ old('from', Request::get('code'))}}>
                            </div>
                            
                            <div class="col-3 form-group">
                                   <label class="control-label" for="o">{{ __('ticket_number') }}</label>

                                <input type="text"  name="ticket_number" for="from" class="form-control date" value={{ old('from', Request::get('ticket_number'))}}>
                            </div>
                       
                            <div class="col-3 form-group">
                                 <label class="control-label" for="o">{{ __('fullName') }}</label>
                                <input type="text"  name="fullName" for="from" class="form-control date" value={{ old('from', Request::get('fullName'))}}>
                            </div>
                       
                       
                            <div class="col-3 form-group">
                                <label class="control-label" for="o">{{ __('passport') }}</label>
                                <input type="text"  name="passport" for="from" class="form-control date" value={{ old('from', Request::get('passport'))}}>
                            </div>
                       
                            
                            <div class="col-3 form-group">
                                <label class="control-label" for="o">{{ __('cruises_number') }}</label>
                                <select name="cruise_id" for="o" class="form-control">
                                    @foreach(App\Models\Cruise::all() as $cruise)
                                        <option value="{{ $cruise->id }}" @if($cruise->id ===intval(Request::get('cruise_id'))) selected @endif>
                                            {{ $cruise->cruise_number }}
                                        </option>
                                    @endforeach
                                </select>
                            </div>
                            <div class="col-3">
                                <label class="control-label">&nbsp;</label><br>
                                <button class="btn btn-primary" type="submit">{{ __('filter by date') }}</button>
                            </div>
                        </div>
                    </form>
                </div>

            </div>
        </div>  
    </div>
     <div class="card">
    
        <div class="card-body">
            <div class="row">
                 <table class="table table-bordered table-hover">
                     <tr>
                        <th>{{ __('number_curiser') }}</th>
                        <th>{{ __('FullName') }}</th>
                        <th>{{ __('passport') }}</th>
                        <th>{{ __('ticket_number') }}</th>
                        <th>{{ __('code') }}</th>
                        <th>{{ __('checked_at') }}</th>
                        <th>{{ __('created_at') }}</th>
                        <th>{{ __('Action') }}</th>
                    
                     </tr>
                   
                        @foreach ($boarding_pases as $boarding_pase)
                                    <tr>
                                        <td>{{$boarding_pase->ticket->segment->cruise->cruise_number }}</td>
                                        <td>{{$boarding_pase->ticket->FullName }}</td>
                                        <td>{{$boarding_pase->ticket->passport }}</td>
                                        <td>{{$boarding_pase->ticket->ticket_number }}</td>
                                        <td>{{$boarding_pase->code }}</td>
                                        <td>{{ $boarding_pase->checked_at }}</td>
    
                                        <td>{{ $boarding_pase->created_at->format('Y/m/d') }}</td>
                                        <td>
                                            <a   class="btn btn-primary btn-sm browse-link"> <i class="fa fa-eye"></i> </a>
                                        </td>
                                       
                                    </tr>   
                        @endforeach
                 </table>
                 
            </div>
            <div>
                {{$boarding_pases->withQueryString()->links()}}
            </div>
    
    
    
        </div>
    </div>



    <x-slot name="after_script">
        <script>
                var app = new Vue({
                    el: '#app',
                    mounted:function(){
                        this.$root.load = false;
                    }
                })
        </script>
        
    </x-slot>
</x-app-layout>
