<?php $__env->startSection('title'); ?>
    <?php echo e(__('Dashboard')); ?>

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="td-dashboard-content-box-intro">
        <h2><?php echo e(__('Welcome')); ?>, <?php echo e($user->full_name); ?>.</h2>
        <div class="row g-4">
            <div class="col-sm-6 col-xl-3">
                <div class="td-dashboard-content-box-intro-card"
                    data-background="<?php echo e(asset('frontend/default/img/dashboard/dashbaord-card-bg-3.png')); ?>">
                    <span><?php echo e(__('Total Bookings')); ?></span>
                    <h3><?php echo e($total_bookings); ?></h3>
                </div>
            </div>
            <div class="col-sm-6 col-xl-3">
                <div class="td-dashboard-content-box-intro-card"
                    data-background="<?php echo e(asset('frontend/default/img/dashboard/dashbaord-card-bg-1.png')); ?>">
                    <span><?php echo e(__('Total Spend')); ?></span>
                    <h3><?php echo e($currencySymbol . $total_spend); ?></h3>
                </div>
            </div>
            <div class="col-sm-6 col-xl-3">
                <div class="td-dashboard-content-box-intro-card"
                    data-background="<?php echo e(asset('frontend/default/img/dashboard/dashbaord-card-bg-2.png')); ?>">
                    <span><?php echo e(__('Total Payments')); ?></span>
                    <h3><?php echo e($total_payments); ?></h3>
                </div>
            </div>
        </div>
    </div>
    <div class="td-dashboard-content-box-bookings">
        <div class="td-dashboard-content-box-bookings-title">
            <h3><?php echo e(__('My Booking List')); ?></h3>
        </div>

        <div class="td-dashboard-content-box-bookings-table table-responsive">
            <table class="table align-middle custom-table-width">
                <thead>
                    <tr>
                        <th scope="col" class="text-start"><?php echo e(__('Image')); ?></th>
                        <th scope="col" class="text-start"><?php echo e(__('Title')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('Location')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('From')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('To')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('Amount')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('Payment Status')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('Status')); ?></th>
                        <th scope="col" class="text-center"><?php echo e(__('Action')); ?></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $bookings; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $booking): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td class="text-start">
                                <img class="avatar" src="<?php echo e(asset(@$booking->space->banner_image)); ?>" alt="">
                            </td>
                            <td class="text-center">
                                <a
                                    href="<?php echo e(route('service.details', encrypt($booking->space_id))); ?>"><?php echo e($booking->space?->title); ?></a>
                            </td>
                            <td class="text-center"><?php echo e($booking->space?->location?->name); ?></td>
                            <td class="text-center"><?php echo e($booking->booking_from->format('d M Y h:i A')); ?></td>
                            <td class="text-center"><?php echo e($booking->booking_to->format('d M Y h:i A')); ?></td>
                            <td class="amount text-center">
                                <?php echo e($currencySymbol . $booking->total_amount); ?>

                            </td>
                            <td class="status text-end">
                                <button
                                    class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                                        'success' => $booking->is_paid,
                                        'ongoing' => !$booking->is_paid,
                                    ]); ?>"><?php echo e($booking->is_paid ? __('Paid') : __('Unpaid')); ?></button>
                            </td>
                            <td class="status text-end">
                                <button class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                                    'success' => in_array($booking->status, [App\Enums\BookingStatus::Booked, App\Enums\BookingStatus::Completed]),
                                    'ongoing' => !in_array($booking->status, [App\Enums\BookingStatus::Booked, App\Enums\BookingStatus::Completed]),
                                ]); ?>"><?php echo e(ucfirst($booking->status->value)); ?></button>
                            </td>
                            <td class="status text-end">
                                <div class="action-btns">
                                    <?php if(!$booking->is_paid && $booking->status !== App\Enums\BookingStatus::Cancelled): ?>
                                        <a href="<?php echo e(route('user.booking.booked', $booking->booking_id)); ?>" target="_blank"
                                            class="print-btn" aria-label="<?php echo e(__('Pay Now')); ?>" data-bs-toggle="tooltip"
                                            data-bs-placement="top" data-bs-original-title="<?php echo e(__('Pay Now')); ?>">
                                            <i class="fa-solid fa-paper-plane"></i>
                                        </a>
                                    <?php endif; ?>
                                    <a href="<?php echo e(route('user.booking.invoice', $booking->booking_id)); ?>" class="print-btn"
                                        aria-label="<?php echo e(__('Download Invoice')); ?>" data-bs-toggle="tooltip"
                                        data-bs-placement="top" data-bs-original-title="<?php echo e(__('Download Invoice')); ?>">
                                        <i class="fa-solid fa-print"></i>
                                    </a>
                                </div>
                            </td>
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
        <?php echo e($bookings->links('frontend::include.__pagination')); ?>

    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('frontend::layouts.user', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /www/wwwroot/mxawfis.mimeld.com/app/Providers/../../resources/views/frontend/spaceify/user/dashboard.blade.php ENDPATH**/ ?>