@extends('admin.layouts.app') @section('title', 'Trips Report') @section('content') @include('admin.includes.alerts')
{{-- @php--}} {{-- if(!empty($class)){--}} {{-- $x = $class;--}} {{-- echo $x.' CLASS ';--}} {{-- }--}} {{-- @endphp--}}

TRIPS

@foreach($trips as $i => $trip)

@csrf @if(\Illuminate\Support\Facades\Auth::user()->role == 1) {{\App\Models\Company::where(['id' => $trip->company])->first()->name}} @endif

@endforeach
@foreach($bookings ?? '' as $i => $booking) @csrf @endforeach
# Abiria Jinsia Mawasiliano Siti Nauli Amelipia Wakala
{{$i+1}} {{$booking->fullname}} {{$booking->gender}} {{$booking->msisdn}} {{ \App\Models\BusSeat::where(['id' => $booking->seat_id])->first()->naming }} {{-- @php--}} {{-- if($booking->sub_route_id == null){--}} {{-- $route = \App\Models\Schedule::where(['id' => $booking->schedule_id])->first()->route_id;--}} {{-- $pA = \App\Models\Route::where(['id' => $route])->first()->start_point;--}} {{-- $pB = \App\Models\Route::where(['id' => $route])->first()->end_point;--}} {{-- $cA = \App\Models\Cities::where(['id' => $pA])->first()->city;--}} {{-- $cB = \App\Models\Cities::where(['id' => $pB])->first()->city;--}} {{-- $fare = \App\Models\SubRoute::where(['pointA' => $cA, 'pointB' => $cB, 'company' => $booking->company, 'route' => $route])->first()->fare;--}} {{-- echo $fare;--}} {{-- }else{--}} {{-- $fare = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->fare;--}} {{-- echo $fare;--}} {{-- }--}} {{-- @endphp--}} @php $schedule = \App\Models\Booking::where(['id' => $booking->id])->first()->schedule_id; $seat = \App\Models\Booking::where(['id' => $booking->id])->first()->seat_id; $tnxExists = \Illuminate\Support\Facades\DB::table('transactions')->where('schedule_id', $schedule)->where('seat_id', $seat)->count(); if($tnxExists > 0){ $amount = \App\Models\Transaction::where(['seat_id' => $seat, 'schedule_id' => $schedule])->first()->amount_in; echo $amount; }else{ $amount = \App\Models\Booking::where(['seat_id' => $seat, 'schedule_id' => $schedule])->first()->fare; echo $amount; } @endphp {{$booking->booking_date}} @if($booking->agent_id == 0 || $booking->agent_id == 1) website @else {{ \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name }} @endif
@endsection