<div class="card mb-2  border-primary">
    <h6 class="card-header  bg-primary text-white py-2" data-toggle="collapse" data-target="#collapseLeadBooking" aria-expanded="false" aria-controls="collapseLeadBooking">
        <strong style="line-height: 1.6em">Buchung
            <span class="badge badge-secondary">{{ $lead->bookings->count()}} </span>
        </strong>
    </h6>
    <div class="collapse" id="collapseLeadBooking">
        <div class="card-body">
            <div class="row">
                <div class="col-sm-12"><hr></div>
                <div class="col-sm-12">
                    <table class="table table-striped table-sm">
                        <thead>
                        <tr>
                            <th style="max-width: 60px;">BuchnungsID</th>
                            <th>{{__('Reiseland')}}</th>
                            <th>{{__('Programm')}}</th>
                            <th>{{__('Anreise')}}</th>
                            <th>{{__('Abreise')}}</th>
                            <th>{{__('Sachbearbeiter')}}</th>
                            <th>{{__('Status')}}</th>
                            <th>{{__('Datum')}}</th>

                        </tr>
                        </thead>
                        <tbody>
                            @if($lead->bookings)
                            @foreach ($lead->bookings as $booking)
                            <tr>
                                <th scope="row">
                                    <a href="{{ route('booking_detail', [$booking->id]) }}" class="btn icon-btn btn-sm btn-primary">
                                        <span class="fa fa-edit"></span>
                                    </a>
                                    {{  $booking->id }}
                                </th>
                                <td>
                                    @if($booking->travel_country_id && $booking->travel_country) 
                                        {{ $booking->travel_country->name }}
                                    @endif
                                </td>
                                <td>
                                    @if($booking->travelagenda_id && $booking->travel_agenda) 
                                        {{ $booking->travel_agenda->name }}
                                    @endif
                                </td>
                                <td>{{ _format_date($booking->start_date) }}</td>
                                <td>{{ _format_date($booking->end_date) }}</td>
                                <td>
                                    @if($booking->sf_guard_user_id && $booking->sf_guard_user) 
                                        {{ $booking->sf_guard_user->first_name }} {{ $booking->sf_guard_user->last_name }}
                                    @endif
                                </td>
                                <td>
                                    @if($booking->lead)
                                     {!! $booking->lead->getStatusBadge($booking) !!}
                                    @endif
                                </td>
                                <td>
                                    {{ _format_date($booking->booking_date) }}
                                </td>    
                            </tr>
                            @endforeach
                            @endif

                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>