<?php
if (Auth('admin')->User()->dashboard_style == 'light') {
    $text = 'dark';
    $bg = 'light';
} else {
    $bg = 'dark';
    $text = 'light';
}
?>


<?php $__env->startSection('title', $title ?? 'Flight Booking Details'); ?>

<?php $__env->startSection('content'); ?>
    <?php echo $__env->make('admin.topmenu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('admin.sidebar', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <div class="main-panel">
        <div class="content">
            <div class="page-inner">
                <div class="mt-2 mb-4">
                    <h1 class="title1 text-<?php echo e($text); ?>"><?php echo e($title ?? 'Flight Booking Details'); ?></h1>
                    <p class="text-muted mt-1">
                        Booking ID: FB-<?php echo e(str_pad($booking->id, 6, '0', STR_PAD_LEFT)); ?> |
                        Submitted <?php echo e($booking->formatted_created_at); ?>

                    </p>
                </div>

                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.danger-alert','data' => []]); ?>
<?php $component->withName('danger-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>
                <?php if (isset($component)) { $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4 = $component; } ?>
<?php $component = $__env->getContainer()->make(Illuminate\View\AnonymousComponent::class, ['view' => 'components.success-alert','data' => []]); ?>
<?php $component->withName('success-alert'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
<?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4)): ?>
<?php $component = $__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4; ?>
<?php unset($__componentOriginalc254754b9d5db91d5165876f9d051922ca0066f4); ?>
<?php endif; ?>

                <!-- Navigation Buttons -->
                <div class="mb-4">
                    <a href="<?php echo e(route('admin.flight-bookings.index')); ?>" class="btn btn-secondary">
                        <i class="fas fa-arrow-left mr-2"></i>Back to Flight Bookings
                    </a>

                    <?php if($booking->status === 'unread'): ?>
                        <form method="POST" action="<?php echo e(route('admin.flight-bookings.update-status', $booking)); ?>" class="d-inline ml-2">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="status" value="read">
                            <button type="submit" class="btn btn-primary">
                                <i class="fas fa-envelope-open mr-2"></i>Mark as Read
                            </button>
                        </form>
                    <?php endif; ?>

                    <?php if($booking->status !== 'replied'): ?>
                        <form method="POST" action="<?php echo e(route('admin.flight-bookings.update-status', $booking)); ?>" class="d-inline ml-2">
                            <?php echo csrf_field(); ?>
                            <?php echo method_field('PATCH'); ?>
                            <input type="hidden" name="status" value="replied">
                            <button type="submit" class="btn btn-success">
                                <i class="fas fa-reply mr-2"></i>Mark as Replied
                            </button>
                        </form>
                    <?php endif; ?>

                    <form method="POST" action="<?php echo e(route('admin.flight-bookings.destroy', $booking)); ?>" class="d-inline ml-2">
                        <?php echo csrf_field(); ?>
                        <?php echo method_field('DELETE'); ?>
                        <button type="submit" class="btn btn-danger"
                                onclick="return confirm('Are you sure you want to delete this flight booking? This action cannot be undone.')">
                            <i class="fas fa-trash mr-2"></i>Delete Booking
                        </button>
                    </form>
                </div>

                <!-- Status Badge -->
                <div class="mb-4">
                    <?php if($booking->status === 'unread'): ?>
                        <span class="badge badge-warning badge-lg">
                            <i class="fas fa-envelope mr-1"></i>Unread - New Booking
                        </span>
                    <?php elseif($booking->status === 'read'): ?>
                        <span class="badge badge-info badge-lg">
                            <i class="fas fa-envelope-open mr-1"></i>Read - Under Review
                        </span>
                    <?php elseif($booking->status === 'replied'): ?>
                        <span class="badge badge-success badge-lg">
                            <i class="fas fa-reply mr-1"></i>Replied - Processed
                        </span>
                    <?php elseif($booking->status === 'archived'): ?>
                        <span class="badge badge-secondary badge-lg">
                            <i class="fas fa-archive mr-1"></i>Archived
                        </span>
                    <?php endif; ?>
                </div>

                <!-- Main Content Row -->
                <div class="row">
                    <!-- Passenger Information -->
                    <div class="col-md-6 mb-4">
                        <div class="card h-100">
                            <div class="card-header bg-primary text-white">
                                <h5 class="mb-0">
                                    <i class="fas fa-user mr-2"></i>Passenger Information
                                </h5>
                            </div>
                            <div class="card-body">
                                <div class="row mb-3">
                                    <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Name:</div>
                                    <div class="col-sm-8 text-<?php echo e($text); ?>"><?php echo e($booking->fname); ?></div>
                                </div>
                                <div class="row mb-3">
                                    <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Email:</div>
                                    <div class="col-sm-8">
                                        <a href="mailto:<?php echo e($booking->email); ?>" class="text-primary"><?php echo e($booking->email); ?></a>
                                    </div>
                                </div>
                                <div class="row mb-3">
                                    <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Phone:</div>
                                    <div class="col-sm-8">
                                        <a href="tel:<?php echo e($booking->phone); ?>" class="text-primary"><?php echo e($booking->phone); ?></a>
                                    </div>
                                </div>
                                <?php if($booking->passengers): ?>
                                    <div class="row mb-3">
                                        <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Passengers:</div>
                                        <div class="col-sm-8 text-<?php echo e($text); ?>"><?php echo e($booking->passengers); ?></div>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>

                    <!-- Military Information -->
                    <div class="col-md-6 mb-4">
                        <div class="card h-100">
                            <div class="card-header bg-success text-white">
                                <h5 class="mb-0">
                                    <i class="fas fa-medal mr-2"></i>Military Information
                                </h5>
                            </div>
                            <div class="card-body">
                                <?php if($booking->rank): ?>
                                    <div class="row mb-3">
                                        <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Rank:</div>
                                        <div class="col-sm-8">
                                            <span class="badge badge-secondary"><?php echo e($booking->rank); ?></span>
                                        </div>
                                    </div>
                                <?php endif; ?>
                                <?php if($booking->service_branch): ?>
                                    <div class="row mb-3">
                                        <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Branch:</div>
                                        <div class="col-sm-8 text-<?php echo e($text); ?>"><?php echo e($booking->service_branch); ?></div>
                                    </div>
                                <?php endif; ?>
                                <?php if($booking->unit): ?>
                                    <div class="row mb-3">
                                        <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Unit:</div>
                                        <div class="col-sm-8 text-<?php echo e($text); ?>"><?php echo e($booking->unit); ?></div>
                                    </div>
                                <?php endif; ?>
                                <?php if($booking->military_status): ?>
                                    <div class="row mb-3">
                                        <div class="col-sm-4 font-weight-bold text-<?php echo e($text); ?>">Status:</div>
                                        <div class="col-sm-8 text-<?php echo e($text); ?>"><?php echo e($booking->military_status); ?></div>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Flight Details -->
                <div class="row">
                    <div class="col-md-12 mb-4">
                        <div class="card">
                            <div class="card-header bg-info text-white">
                                <h5 class="mb-0">
                                    <i class="fas fa-plane mr-2"></i>Flight Details
                                </h5>
                            </div>
                            <div class="card-body">
                                <div class="row">
                                    <?php if($booking->departure_city): ?>
                                        <div class="col-md-3 mb-3">
                                            <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Departure City:</div>
                                            <span class="badge badge-info badge-lg"><?php echo e($booking->departure_city); ?></span>
                                        </div>
                                    <?php endif; ?>
                                    <?php if($booking->destination_city): ?>
                                        <div class="col-md-3 mb-3">
                                            <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Destination City:</div>
                                            <span class="badge badge-success badge-lg"><?php echo e($booking->destination_city); ?></span>
                                        </div>
                                    <?php endif; ?>
                                    <?php if($booking->departure_date): ?>
                                        <div class="col-md-3 mb-3">
                                            <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Departure Date:</div>
                                            <div class="text-<?php echo e($text); ?>">
                                                <i class="fas fa-calendar mr-1"></i>
                                                <?php echo e(date('M d, Y', strtotime($booking->departure_date))); ?>

                                            </div>
                                        </div>
                                    <?php endif; ?>
                                    <?php if($booking->return_date): ?>
                                        <div class="col-md-3 mb-3">
                                            <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Return Date:</div>
                                            <div class="text-<?php echo e($text); ?>">
                                                <i class="fas fa-calendar mr-1"></i>
                                                <?php echo e(date('M d, Y', strtotime($booking->return_date))); ?>

                                            </div>
                                        </div>
                                    <?php endif; ?>
                                </div>

                                <?php if($booking->trip_type): ?>
                                    <div class="row mt-3">
                                        <div class="col-md-6">
                                            <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Trip Type:</div>
                                            <span class="badge badge-primary"><?php echo e(ucfirst($booking->trip_type)); ?></span>
                                        </div>
                                        <?php if($booking->payment_preference): ?>
                                            <div class="col-md-6">
                                                <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Payment Preference:</div>
                                                <span class="badge badge-warning"><?php echo e(ucfirst($booking->payment_preference)); ?></span>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Message/Special Requests -->
                <?php if($booking->message): ?>
                    <div class="row">
                        <div class="col-md-12 mb-4">
                            <div class="card">
                                <div class="card-header bg-warning text-dark">
                                    <h5 class="mb-0">
                                        <i class="fas fa-comment mr-2"></i>Special Requests / Additional Information
                                    </h5>
                                </div>
                                <div class="card-body">
                                    <div class="text-<?php echo e($text); ?>" style="white-space: pre-wrap;"><?php echo e($booking->message); ?></div>
                                </div>
                            </div>
                        </div>
                    </div>
                <?php endif; ?>

                <!-- Submission Details -->
                <div class="row">
                    <div class="col-md-12 mb-4">
                        <div class="card">
                            <div class="card-header bg-secondary text-white">
                                <h5 class="mb-0">
                                    <i class="fas fa-clock mr-2"></i>Submission Details
                                </h5>
                            </div>
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-4 mb-3">
                                        <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Submitted:</div>
                                        <div class="text-<?php echo e($text); ?>">
                                            <i class="fas fa-calendar-plus mr-1"></i>
                                            <?php echo e($booking->created_at->format('M d, Y g:i A')); ?>

                                        </div>
                                    </div>
                                    <div class="col-md-4 mb-3">
                                        <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Last Updated:</div>
                                        <div class="text-<?php echo e($text); ?>">
                                            <i class="fas fa-calendar-check mr-1"></i>
                                            <?php echo e($booking->updated_at->format('M d, Y g:i A')); ?>

                                        </div>
                                    </div>
                                    <div class="col-md-4 mb-3">
                                        <div class="font-weight-bold text-<?php echo e($text); ?> mb-1">Booking ID:</div>
                                        <div class="text-<?php echo e($text); ?>">
                                            <i class="fas fa-id-badge mr-1"></i>
                                            FB-<?php echo e(str_pad($booking->id, 6, '0', STR_PAD_LEFT)); ?>

                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>

                <!-- Action Buttons at Bottom -->
                <div class="text-center mb-4">
                    <a href="<?php echo e(route('admin.flight-bookings.index')); ?>" class="btn btn-secondary btn-lg">
                        <i class="fas fa-arrow-left mr-2"></i>Back to Flight Bookings
                    </a>
                    <a href="mailto:<?php echo e($booking->email); ?>" class="btn btn-primary btn-lg ml-2">
                        <i class="fas fa-envelope mr-2"></i>Reply to Request
                    </a>
                </div>
            </div>
        </div>
    </div>

<?php if(session('success')): ?>
    <script>
        Swal.fire({
            icon: 'success',
            title: 'Success!',
            text: '<?php echo e(session('success')); ?>',
            confirmButtonColor: '#28a745'
        });
    </script>
<?php endif; ?>

<?php if(session('error')): ?>
    <script>
        Swal.fire({
            icon: 'error',
            title: 'Error!',
            text: '<?php echo e(session('error')); ?>',
            confirmButtonColor: '#dc3545'
        });
    </script>
<?php endif; ?>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/elitemaxpro/milita.elitemaxpro.click/resources/views/admin/flight-booking/show.blade.php ENDPATH**/ ?>