@extends('admin.layouts.app') @section('title', 'Bookings') @section('content') @include('admin.includes.alerts')
{{-- --}} {{-- --}} {{-- --}} @if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 2) @endif @foreach($bookings as $index => $booking) {{-- --}} {{-- --}} {{-- --}} {{-- --}} @if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 2) @endif @endforeach
SN Full Name MobileGenderAgeIdentitySchedule Seat Agent Status Route Amount Class Reference Bus BookingCompanyAction
{{$index + $bookings->firstItem()}}{{$index + 1}}{{$booking->fullname}} {{$booking->msisdn}}{{$booking->gender}}{{$booking->age}}{{$booking->ID_no}}{{ !empty($booking->schedule->trip_date) ? $booking->schedule->trip_date:'N/A' }} {{ !empty($booking->schedule->departure) ? $booking->schedule->departure:'N/A'}} {{ !empty(\App\Models\BusSeat::where(['id' => $booking->seat_id])->first()->naming) ? \App\Models\BusSeat::where(['id' => $booking->seat_id])->first()->naming:'N/A' }} @if($booking->agent_id == 0) ONLINE @else @if($booking->agent_id == 1) {{ \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name }} @else {{ \App\Models\Agent::where(['id' => $booking->agent_id])->first()->name }} @endif @endif @if($booking->status == 2) Booking @elseif($booking->status == 3) PAID CASH @elseif($booking->status == 4) PAID ONLINE @elseif($booking->status == 5) On-Hold @elseif($booking->status == 6) LIPA # @elseif($booking->status == 1) Available @else N/A @endif @php if($booking->sub_route_id == null){ $pA = \App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->start_point; $pB = \App\Models\Route::where(['id' => $booking->schedule->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; }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 {{$booking->fare}} @if(!empty($booking->schedule->trip_date)) @if(!empty(\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 1) ? (\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 1):'') VVIP @elseif(!empty(\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 2) ? (\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 2):'') VIP @elseif(!empty(\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 3) ? (\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 3):'') LUXURY @elseif(!empty(\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 4) ? (\App\Models\Route::where(['id' => $booking->schedule->route_id])->first()->class == 4):'') SEMI-LUXURY @else ORDINARY @endif @else N/A @endif {{$booking->reference}} {{ !empty($booking->schedule->label) ? $booking->schedule->label:'N/A'}} {{$booking->created_at}}{{ \App\Models\Company::where(['id' => $booking->company])->first()->name }} @if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 11) {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'route' => ['SMS Passenger', $booking->id])) !!} {!! Form::submit('SMS', array('class' => 'btn btn-sm btn-info')) !!} {!! Form::close() !!} @endif @if(\Illuminate\Support\Facades\Auth::user()->role == 1) {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'POST', 'onsubmit' => "return confirm('".trans("Are sure you want to Cancel Ticket")."');", 'route' => ['Cancel Booking', $booking->id])) !!} {!! Form::submit('Cancel', array('class' => 'btn btn-sm btn-danger')) !!} {!! Form::close() !!} @endif @if(\Illuminate\Support\Facades\Auth::user()->role == 1 || \Illuminate\Support\Facades\Auth::user()->role == 2) @if($booking->status == 2) @if($booking->is_deleted == 0) {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'onsubmit' => "return confirm('".trans("Are sure you want to Cancel Booking")."');", 'route' => ['Cancel Booking', $booking->id])) !!} {!! Form::submit('Cancel', array('class' => 'btn btn-sm btn-danger')) !!} {!! Form::close() !!} @else {!! Form::open(array( 'style' => 'display: inline-block;', 'method' => 'GET', 'onsubmit' => "return confirm('".trans("Are sure you want to Enable")."');", 'route' => ['Enable Booking', $booking->id])) !!} {!! Form::submit('Enable', array('class' => 'btn btn-sm btn-success')) !!} {!! Form::close() !!} @endif @endif @endif
{{ $bookings->links() }}
@endsection