@extends('admin.layouts.app')
@section('panel')
    <div class="row mb-none-30 justify-content-center">
        <div class="col-xl-4 col-md-6 mb-30">
            <div class="card overflow-hidden box--shadow1">
                <div class="card-body">
                    <h5 class="card-title pb-2 text-muted">@lang('Passenger Information')</h5>
                    <ul class="list-group">
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Name')
                            <div>
                                @if($booking?->user)
                                    <span class="fw-bold">{{ __($booking?->user?->fullname) }}</span>
                                    <br>
                                    <span class="small"> <a href="{{ route('admin.users.detail', $booking->user_id) }}"><span>@</span>{{ __($booking?->user?->username) }}</a> </span>
                                @else
                                    <span class="fw-bold">
                                        <a href="{{ route('admin.walking.users.index') }}?search={{ $booking?->guestUser?->mobile }}">
                                            <span>@</span>{{ __($booking?->guestUser?->name) }}
                                        </a>
                                    </span>
                                @endif
                            </div>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Mobile')
                            <span class="fw-bold">{{ __($booking?->user?->mobile ?? $booking?->guestUser?->mobile) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Email')
                            <span class="fw-bold">{{ __($booking?->user?->email ?? $booking?->guestUser?->email) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Gender')
                            <span class="fw-bold">{{ $booking?->user?->genderText ?? $booking?->guestUser?->genderText }}</span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
        <div class="col-xl-4 col-md-6 mb-30">
            <div class="card overflow-hidden box--shadow1">
                <div class="card-body">
                    <h5 class="card-title pb-2 text-muted">@lang('Booking Information')</h5>
                    <ul class="list-group">
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Trip')
                            <span class="fw-bold">
                                <a href="{{ route('admin.trip.index') }}?search={{ $booking?->trip?->title }}&departure_date={{ showDateTime($booking->date_of_journey, "F d, Y") }}">
                                    {{ __(strLimit($booking?->trip?->title, 40)) }}
                                </a>
                            </span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Route')
                            <span class="fw-bold">{{ __($booking?->trip?->route->name) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('PNR Number')
                            <span class="fw-bold">{{ __($booking->pnr_number) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Date of Journey')
                            <span class="fw-bold">{{ showDateTime($booking->date_of_journey, "F d, Y") }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Pickup Point')
                            <span class="fw-bold">{{ __($booking?->pickup?->name) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Dropping Point')
                            <span class="fw-bold">{{ __($booking?->drop?->name) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Boarding Point')
                            <span class="fw-bold">{{ __($booking?->boarding?->name) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Total Tickets')
                            <span class="fw-bold">{{ __($booking->ticket_count) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Seats')
                            <span class="fw-bold">{{ __(implode(',', $booking->seats)) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Unit Price')
                            <span class="fw-bold">{{ showAmount($booking->unit_price) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Subtotal')
                            <span class="fw-bold">{{ showAmount($booking->sub_total) }}</span>
                        </li>
                        <li class="list-group-item d-flex justify-content-between align-items-center">
                            @lang('Status')
                            <span class="fw-bold">
                                @php
                                    echo $booking->statusBadge;
                                @endphp
                            </span>
                        </li>
                    </ul>
                </div>
            </div>
        </div>

        @if($booking?->bookedDeposite)
            <div class="col-xl-4 col-md-6 mb-30">
                <div class="card overflow-hidden box--shadow1">
                    <div class="card-body">
                        <h5 class="mb-20 text-muted">@lang('Payment Via') @if($booking->bookedDeposite->method_code < 5000) {{ __($booking->bookedDeposite->gateway->name) }} @else @lang('Google Pay') @endif</h5>
                        <ul class="list-group">
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Date')
                                <span class="fw-bold">{{ showDateTime($booking->bookedDeposite->created_at) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Transaction Number')
                                <span class="fw-bold">
                                    <a href="{{ route('admin.deposit.successful') }}?search={{ $booking->bookedDeposite->trx }}">{{ $booking->bookedDeposite->trx }}</a>
                                </span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Username')
                                <span class="fw-bold">
                                    <a href="{{ route('admin.users.detail', $booking->bookedDeposite->user_id) }}"><span>@</span>{{ $booking->bookedDeposite->user->username }}</a>
                                </span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Method')
                                <span class="fw-bold">
                                    @if($booking->bookedDeposite->method_code < 5000)
                                        {{ __($booking->bookedDeposite->gateway->name) }}
                                    @else
                                        @lang('Google Pay')
                                    @endif
                                </span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Amount')
                                <span class="fw-bold">{{ showAmount($booking->bookedDeposite->amount) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Charge')
                                <span class="fw-bold">{{ showAmount($booking->bookedDeposite->charge) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('After Charge')
                                <span class="fw-bold">{{ showAmount($booking->bookedDeposite->amount+$booking->bookedDeposite->charge) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Rate')
                                <span class="fw-bold">1 {{__(gs('cur_text'))}}
                                    = {{ showAmount($booking->bookedDeposite->rate,currencyFormat:false) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('After Rate Conversion')
                                <span class="fw-bold">{{ showAmount($booking->bookedDeposite->final_amount,currencyFormat:false) }} {{__($booking->bookedDeposite->method_currency)}}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Status')
                                @php echo $booking->bookedDeposite->statusBadge @endphp
                            </li>
                            @if($booking->bookedDeposite->admin_feedback)
                                <li class="list-group-item">
                                    <strong>@lang('Admin Response')</strong>
                                    <br>
                                    <p>{{__($booking->bookedDeposite->admin_feedback)}}</p>
                                </li>
                            @endif
                        </ul>
                    </div>
                </div>
            </div>
        @endif
        @if($booking?->counterManager)
            <div class="col-xl-4 col-md-6 mb-30">
                <div class="card overflow-hidden box--shadow1">
                    <div class="card-body">
                        <h5 class="mb-20 text-muted">@lang('Counter Information')</h5>
                        <ul class="list-group">
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Counter')
                                <span class="fw-bold">{{ __($booking?->counter?->name) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Counter Manager')
                                <span class="fw-bold">{{ __($booking?->counterManager?->fullname) }}</span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                @lang('Booking Time')
                                <span class="fw-bold">{{ showDateTime($booking?->created_at) }}</span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        @endif
    </div>
@endsection
