@foreach ($operators as $x => $operator)
@php
$currentTime = \Carbon\Carbon::parse($operator->departure);
if ($currentTime->between(\Carbon\Carbon::createFromTime(0, 0), \Carbon\Carbon::createFromTime(11, 59))) {
$timeOfDay = 'morning';
} elseif ($currentTime->between(\Carbon\Carbon::createFromTime(12, 0), \Carbon\Carbon::createFromTime(16, 59))) {
$timeOfDay = 'afternoon';
} elseif ($currentTime->between(\Carbon\Carbon::createFromTime(17, 0), \Carbon\Carbon::createFromTime(23, 59))) {
$timeOfDay = 'evening';
} else {
$timeOfDay = null;
}
$departure_t = ($timeOfDay) ? '
': ''
@endphp
{{-- @if($operator->class == 1)--}}
{{--
--}}
{{-- @elseif($operator->class == 2)--}}
{{--
--}}
{{-- @elseif($operator->class == 3)--}}
{{--
--}}
{{-- @elseif($operator->class == 4)--}}
{{--
--}}
{{-- @else--}}
{{--
--}}
{{-- @endif--}}
{{ $operator->bus_reg_no }}
{{-- via : {{ $operator->via }}--}}
{{-- {{ $date }}--}}
@php
echo date("g:ia", strtotime($operator->departure)).''.$departure_t;
@endphp
@php
$pA = \App\Models\Cities::where(['id' => $operator->start_point])->first()->city;
$pB = \App\Models\Cities::where(['id' => $operator->end_point])->first()->city;
$class = \App\Models\Route::where(['id' => $operator->route_id])->first()->class;
$fare = \App\Models\SubRoute::where(['route' => $operator->route_id, 'class' => $class, 'company' => $operator->company, 'pointA' => $pA, 'pointB' => $pB])->value('fare');
echo number_format($fare);
@endphp
@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')
@elseif($busService == 'TV')
@elseif($busService == 'AC')
@elseif($busService == 'Soft Drinks & Snacks')
@endif
@endforeach
{!! Form::open(array(
'style' => 'display: inline-block;',
'method' => 'GET',
'route' => ['Bus Manifest',
\Illuminate\Support\Facades\Crypt::encrypt($operator->scheduleId),
\Illuminate\Support\Facades\Crypt::encrypt($operator->name),
\Illuminate\Support\Facades\Crypt::encrypt($operator->bus_reg_no),
\Illuminate\Support\Facades\Crypt::encrypt($operator->departure),
\Illuminate\Support\Facades\Crypt::encrypt($fare),
\Illuminate\Support\Facades\Crypt::encrypt($operator->approximate_hours),
\Illuminate\Support\Facades\Crypt::encrypt($operator->class),
\Illuminate\Support\Facades\Crypt::encrypt($from),
\Illuminate\Support\Facades\Crypt::encrypt($to),
\Illuminate\Support\Facades\Crypt::encrypt($date),
])) !!}
{!! Form::submit((__('BOOK TICKET')), array('class' => 'button button-primary button-xs button-no-shadow')) !!}
{!! Form::close() !!}
{{--
--}}