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

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <div class="main-content">
        <div class="page-title">
            <div class="container-fluid">
                <div class="row">
                    <div class="col">
                        <div class="title-content">
                            <h2 class="title"><?php echo e(__('Booking Details')); ?></h2>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row">
                <div class="col-xl-6">
                    <div class="site-card">
                        <div class="site-card-header">
                            <h4 class="title-small"><?php echo e(__('Booking Information')); ?></h4>
                        </div>
                        <div class="site-card-body">
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Space')); ?></div>
                                <div class="value"><?php echo e($booking->space->title ?? 'N/A'); ?></div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Location')); ?></div>
                                <div class="value"><?php echo e($booking->space->location->name ?? 'N/A'); ?></div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Booking ID')); ?></div>
                                <div class="value"><?php echo e($booking->booking_id); ?></div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Total Amount')); ?></div>
                                <div class="value">
                                    <div class="site-badge success"><?php echo e($currencySymbol . $booking->total_amount); ?></div>
                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Booking From')); ?></div>
                                <div class="value">
                                    <?php echo e($booking->booking_from->format('d M Y h:i A')); ?>

                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Booking To')); ?></div>
                                <div class="value">
                                    <?php echo e($booking->booking_to->format('d M Y h:i A')); ?>

                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Stock')); ?></div>
                                <div class="value">
                                    <?php echo e($booking->stock); ?>

                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Selected Facilities')); ?></div>
                                <div class="value">
                                    <?php echo e($facilities); ?>

                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Gateway')); ?></div>
                                <div class="value">
                                    <?php echo e($booking->gateway->name ?? 'N/A'); ?>

                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Payment Status')); ?></div>
                                <div class="value">
                                    <div class="<?php echo \Illuminate\Support\Arr::toCssClasses([
                                        'site-badge',
                                        'success' => $booking->is_paid,
                                        'danger' => !$booking->is_paid,
                                    ]); ?>">
                                        <?php echo e($booking->is_paid ? __('Paid') : __('Unpaid')); ?>

                                    </div>
                                </div>
                            </div>
                            <div class="profile-text-data">
                                <div class="attribute"><?php echo e(__('Status')); ?></div>
                                <div class="value">
                                    <?php switch($booking->status->value):
                                        case ('pending'): ?>
                                            <div class="site-badge pending"><?php echo e(__('Pending')); ?></div>
                                        <?php break; ?>

                                        <?php case ('booked'): ?>
                                            <div class="site-badge success"><?php echo e(__('Booked')); ?></div>
                                        <?php break; ?>

                                        <?php case ('cancelled'): ?>
                                            <div class="site-badge danger"><?php echo e(__('Cancelled')); ?></div>
                                        <?php break; ?>
                                        <?php case ('completed'): ?>
                                            <div class="site-badge primary"><?php echo e(__('Completed')); ?></div>
                                        <?php break; ?>
                                    <?php endswitch; ?>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <div class="col-xl-6">
                    <div class="site-card">
                        <div class="site-card-header">
                            <h4 class="title-small"><?php echo e(__('Billing Information')); ?></h4>
                        </div>
                        <div class="site-card-body">
                            <?php $__currentLoopData = $booking->billing_details; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <li class="profile-text-data">
                                    <div class="attribute"> <?php echo e(ucwords(str_replace('_', ' ', $key))); ?></div>
                                    <div class="value">
                                        <strong><?php echo e($value); ?></strong>
                                    </div>
                                </li>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </div>
                </div>
                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('booking-action')): ?>
                    <div class="col-xl-12">
                        <div class="site-card">
                            <div class="site-card-header">
                                <h4 class="title-small"><?php echo e(__('Booking Action')); ?></h4>
                            </div>
                            <div class="site-card-body">
                                <form action="<?php echo e(route('admin.bookings.action', $booking->id)); ?>" method="post">
                                    <?php echo csrf_field(); ?>
                                    <div class="row">
                                        <div class="col-xl-6">
                                            <div class="site-input-groups">
                                                <label class="box-input-label" for="">
                                                    <?php echo e(__('Payment Status:')); ?>

                                                </label>
                                                <select name="payment_status" class="form-select" id="">
                                                    <option value="1" <?php if($booking->is_paid): echo 'selected'; endif; ?>><?php echo e(__('Paid')); ?>

                                                    </option>
                                                    <option value="0" <?php if(!$booking->is_paid): echo 'selected'; endif; ?>><?php echo e(__('Unpaid')); ?>

                                                    </option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-xl-6">
                                            <?php
                                                $reflectionClass = new ReflectionClass(\App\Enums\BookingStatus::class);
                                                $statuses = $reflectionClass->getConstants();
                                            ?>
                                            <div class="site-input-groups">
                                                <label class="box-input-label" for="">
                                                    <?php echo e(__('Status:')); ?>

                                                </label>
                                                <select name="status" class="form-select" id="">
                                                    <?php $__currentLoopData = $statuses; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($value); ?>" <?php if($booking->status->value === $value->value): echo 'selected'; endif; ?>>
                                                            <?php echo e($key); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="action-btns">
                                        <button type="submit" class="site-btn-sm primary-btn me-2">
                                            <i data-lucide="refresh-ccw"></i>
                                            <?php echo e(__('Update')); ?>

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

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