@extends('admin.layouts.app') @section('title', 'Booking Report') @section('content')
BOOKINGS ANALYTICS
{!! $bookingHistory->html() !!}
BOOKINGS REPORTS
  • Today Bookings
    {{ $tBookings }}
  • @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $month = $localTime->format('M'); echo $month; @endphp Month's Bookings
    {{ $mBookings }}
  • Yearly Bookings
    {{ $yBookings }}
    @foreach ($routes as $x => $route)
  • @php $pA = \App\Models\Route::where(['id' => $route->id])->first()->start_point; $pB = \App\Models\Route::where(['id' => $route->id])->first()->end_point; $pointA = \App\Models\Cities::where(['id' => $pA])->first()->city; $pointB = \App\Models\Cities::where(['id' => $pB])->first()->city; echo $pointA .' - '.$pointB; @endphp
    @php $localTime = new \DateTime("now", new \DateTimeZone('Africa/Dar_es_Salaam')); $kifuaDate = $localTime->format('Y-m-d'); $today = $localTime->format('Y-m-d'); $bookings = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '>', 2) ->where('routes.id', '=', $route->id) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->count(); $mauzo = \Illuminate\Support\Facades\DB::table('booking_histories') ->leftJoin('sub_routes', function ($join) { $join->on('sub_routes.id', '=', 'booking_histories.sub_route_id'); }) ->leftJoin('routes', function ($join) { $join->on('routes.id', '=', 'sub_routes.route'); }) ->where('booking_histories.company', '=', \Illuminate\Support\Facades\Auth::user()->company) ->where('booking_histories.booking_date', $today) ->where('booking_histories.status', '>', 2) ->where('routes.id', '=', $route->id) ->select('booking_histories.fullname as passenger', 'booking_histories.msisdn', 'booking_histories.status', 'booking_histories.booking_date') ->sum('booking_histories.fare'); echo 'Tickets: '.$bookings.' Sales: '.number_format($mauzo); @endphp
  • @endforeach
@foreach($bs as $i => $booking) @endforeach
SN Full Name Mobile Gender Schedule Seat Agent Status Route Class Booking Date
{{$i+1}} {{$booking->fullname}} {{$booking->msisdn}} {{$booking->gender}} @php $trip_date = \App\Models\Schedule::where(['id' => $booking->schedule_id])->first()->trip_date; echo $trip_date; @endphp {{ \App\Models\BusSeat::where(['id' => $booking->seat_id])->first()->naming }} @if($booking->agent_id == 0) WEB TECHNOLOGIES @else {{ \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name }} @endif @if($booking->status == 2) Booking @elseif($booking->status == 3) PAID CASH @elseif($booking->status == 4) PAID ONLINE @else N/A @endif @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; $pointA = \App\Models\Cities::where(['id' => $pA])->first()->city; $pointB = \App\Models\Cities::where(['id' => $pB])->first()->city; echo $pointA .' - '.$pointB; }else{ $from = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointA; $to = \App\Models\SubRoute::where(['id' => $booking->sub_route_id])->first()->pointB; echo $from .' - '.$to; } @endphp @php $route = \App\Models\Schedule::where(['id' => $booking->schedule_id])->first()->route_id; $class = \App\Models\Route::where(['id' => $route])->first()->class; @endphp @if($class == 1) VVIP @elseif($class == 2) VIP @elseif($class == 3) LUXURY @elseif($class == 4) SEMI-LUXURY @else ORDINARY @endif {{$booking->booking_date}}
{!! \ConsoleTVs\Charts\Facades\Charts::scripts() !!} {!! $bookingHistory->script() !!} @endsection