@extends('layouts.app3') @section('title', 'HAPPY NATION') @section('content') @if(sizeof($operators) == 0)
@else
@if($operators ?? '') @foreach ($operators as $x => $operator) {{-- @if($operator->label != "NAMBA 1" && $operator->route_id == 4 && $date > "2022-01-01" && $date < "2022-01-21")--}} {{-- @else--}}
  • {{ $operator->name }}
    @if($operator->class == 1) VVIP @elseif($operator->class == 2) VIP @elseif($operator->class == 3) Luxury @elseif($operator->class == 4) Semi-Luxury @else Ordinary @endif
    {{__('text.class')}}
    @php $busServices = \Illuminate\Support\Facades\DB::table('bus_services')->where('bus_id', $operator->bus_id)->pluck('service'); @endphp @foreach($busServices as $busService) @if($busService == 'USB & Charging System') USB & Charging System @elseif($busService == 'TV') TV @elseif($busService == 'AC') AC @elseif($busService == 'Soft Drinks & Snacks') Soft Drinks & Snacks @endif @endforeach
    {{__('text.service')}}
    @php $available = \Illuminate\Support\Facades\DB::table('bookings') ->where('schedule_id', $operator->scheduleId) ->select('bookings.*', \Illuminate\Support\Facades\DB::raw("count(bookings.status) AS available_seats")) ->where('bookings.status', 1) ->where('bookings.status', 1) ->count(); echo $available; @endphp
    {{__('text.available_seat')}}

    {{ $from }}
    {{__('text.from')}}
    {{--
    --}} {{--
    @php--}} {{-- $available = \Illuminate\Support\Facades\DB::table('bookings')--}} {{-- ->where('schedule_id', $operator->scheduleId)--}} {{-- ->select('bookings.*',--}} {{-- \Illuminate\Support\Facades\DB::raw("count(bookings.status) AS available_seats"))--}} {{-- ->where('bookings.status', 1)--}} {{-- ->count();--}} {{-- echo $available;--}} {{-- @endphp
    --}} {{-- {{__('text.available_seat')}}--}} {{--
    --}}
    {{__('text.date_trip')}} : {{ $date }}
    {{__('text.departure')}} : @php echo date("g:ia", strtotime($operator->departure)); @endphp
    {{__('text.bus')}}: {{ $operator->bus_reg_no }} {{__('text.label')}}: {{ $operator->label }} via : {{ $operator->via }}
    {{ $to }}
    {{__('text.to')}}
{{-- @endif--}} @endforeach {{ $operators->links() }} @else @endif
@endif @endsection