
<?php $__env->startSection('title', 'Manage Passenger'); ?>
<?php $__env->startSection('content'); ?>
<div class="page-inner mt-5 pt-5">
    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header project-details-card-header py-2 d-flex align-items-center justify-content-between">
                    <div>
                        <h4 class="project-details-card-header-title mb-0">Passenger List</h4>
                    </div>
                    <div>
                        <a href="<?php echo e(route('passenger.create')); ?>" class="btn btn-primary btn-sm" title="Add">
                            <span class="btn-label">
                                <i class='bx bx-plus'></i>
                            </span>
                            Add Passenger
                        </a>
                        <button class="btn btn-black btn-sm" title="Go Back" onclick="history.back();">
                            <span class="btn-label">
                                <i class="fas fa-reply"></i>
                            </span>
                            Go Back
                        </button>
                    </div>
                </div>
                <div class="card-body">
                    <div class="table-responsive">
                        <div id="add-row_wrapper" class="dataTables_wrapper container-fluid dt-bootstrap4">
                            <div class="row">
                                <div class="col-sm-12">
                                    <table id="add-row" class="display table table-striped table-hover basic-datatables" role="grid" aria-describedby="add-row_info">
                                        <thead>
                                        <tr>
                                            <th>Sl</th>
                                            <th>Passenger Name</th>
                                            <th>Mobile</th>
                                            <th>Email</th>
                                            <th>DOB</th>
                                            <th>Passport</th>
                                            <th>Nationality</th>
                                            <th class="text-end">Action</th>
                                        </tr>
                                        </thead>

                                        <tbody>
                                            <?php $__empty_1 = true; $__currentLoopData = $passengers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $index => $passenger): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                            <tr>
                                                <td><?php echo e($index + 1); ?></td>

                                                <td>
                                                    <?php echo e($passenger->title); ?>

                                                    <?php echo e($passenger->first_name); ?> <br>
                                                    <?php echo e($passenger->last_name); ?>

                                                </td>

                                                <td><?php echo e($passenger->mobile_no); ?></td>
                                                <td><?php echo e($passenger->email); ?></td>
                                                <td><?php echo e($passenger->date_of_birth?->format('d F Y') ?? '-'); ?></td>
                                                <td>
                                                    <?php echo e($passenger->passport); ?> <br> <?php echo e($passenger->passport_expiry?->format('d F Y') ?? '-'); ?>

                                                </td>
                                                <td><?php echo e($passenger->nationality->name ?? '-'); ?></td>

                                                <td>
                                                    <div class="btn-list d-flex justify-content-center gap-1">
                                                        <a href="<?php echo e(route('passenger.edit', $passenger->id)); ?>" class="btn btn-primary btn-sm" title="Edit">
                                                            <i class="far fa-edit"></i>
                                                        </a>

                                                        <form action="<?php echo e(route('passenger.delete', $passenger->id)); ?>" method="POST">
                                                            <?php echo csrf_field(); ?>
                                                            <?php echo method_field('delete'); ?>
                                                            <button type="submit" class="btn btn-danger btn-sm delete_sweet_alert" title="Delete">
                                                                <i class="far fa-trash-alt"></i>
                                                            </button>
                                                        </form>
                                                    </div>
                                                </td>
                                            </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                            <tr>
                                                <td colspan="7" class="text-center text-muted">
                                                    No records found
                                                </td>
                                            </tr>
                                            <?php endif; ?>
                                        </tbody>

                                    </table>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php if(session('success')): ?>
<script>
Swal.fire({
    icon: 'success',
    title: 'Success',
    text: "<?php echo e(session('success')); ?>",
    timer: 2000,
    showConfirmButton: false
});
</script>
<?php endif; ?>
<?php echo $__env->make('backend.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH D:\xampp\htdocs\view-trip-update2\resources\views/backend/passenger/index.blade.php ENDPATH**/ ?>