@extends($activeTemplate . 'layouts.frontend')
@section('content')
    <!-- booking history Starts Here -->
    <section class="dashboard-section padding-top padding-bottom">
        <div class="container">
            <div class="dashboard-wrapper">
                <div class="row justify-content-center gy-2">
                    <div class="col-md-8 d-flex justify-content-between">
                        <a href="{{ (url()->previous() == route('user.home')) ? route('user.home') : route('user.ticket.history') }}" class="btn btn-outline--success mb-2"><i class="las la-angle-left"></i>@lang('Back')</a>
                        @if($bookedTicket->status == Status::BOOKED_APPROVED)
                            <a href="{{ route('user.ticket.print', $bookedTicket->id) }}" target="_blank" class="btn btn--base mb-2 me-2">
                                <i class="las la-file-download la-lg"></i>
                                @lang('Download Ticket')
                            </a>
                        @endif
                    </div>
                    <div class="col-md-8">
                        <table class="booking-table">
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Trip')</th>
                                <td>{{ __($bookedTicket?->trip?->title) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Route')</th>
                                <td>{{ __($bookedTicket?->trip?->route?->name) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('PNR Number')</th>
                                <td>{{ __($bookedTicket->pnr_number) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('AC / Non-Ac')</th>
                                <td>{{ __($bookedTicket?->trip?->fleetType->has_ac ? 'AC' : 'Non-Ac') }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Starting Point')</th>
                                <td>{{ __($bookedTicket?->pickup?->name) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Boarding Point')</th>
                                <td>{{ __($bookedTicket?->boarding?->name) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Dropping Point')</th>
                                <td>{{ __($bookedTicket?->drop?->name) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Journey Date')</th>
                                <td>{{ showDateTime($bookedTicket->date_of_journey, 'd M, Y') }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Pickup Time')</th>
                                <td>{{ showDateTime($bookedTicket?->trip?->start_time, 'h:i a') }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Booked Seats')</th>
                                <td>{{ __(implode(',', $bookedTicket->seats)) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Status')</th>
                                <td>
                                    @php
                                        echo $bookedTicket->statusBadge
                                    @endphp
                                </td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Trip Status')</th>
                                <td>
                                    @php
                                        echo $bookedTicket?->trip?->statusBadge;
                                    @endphp
                                </td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Fare')</th>
                                <td>{{ showAmount($bookedTicket->unit_price) }}</td>
                            </tr>
                            <tr>
                                <th class="text-start ps-3 ps-md-5">@lang('Total Fare')</th>
                                <td>{{ showAmount($bookedTicket->sub_total) }}</td>
                            </tr>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </section>
    <!-- booking history end Here -->
@endsection
