
<?php $__env->startSection('title'); ?>
    <?php echo e(__('Customer 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(__('Details of') . ' ' . $user->first_name . ' ' . $user->last_name); ?>

                            </h2>

                            <div class="d-flex">
                                <a href="<?php echo e(route('admin.user.login', ['id' => $user->id, 'redirect_path' => 'user.booking.checkout'])); ?>"
                                    class="title-btn green-btn me-2" target="_blank"><i
                                        data-lucide="diamond-plus"></i><?php echo e(__('Book Now')); ?></a>
                                <a href="<?php echo e(route('admin.user.index')); ?>" class="title-btn"><i
                                        data-lucide="corner-down-left"></i><?php echo e(__('Back')); ?></a>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <div class="container-fluid">
            <div class="row justify-content-center">
                <div class="col-xxl-3 col-xl-6 col-lg-8 col-md-6 col-sm-12">
                    <div class="profile-card">
                        <div class="top">
                            <div class="avatar">
                                <div class="avatar-face">
                                    <?php if(null != $user->avatar): ?>
                                        <div class="avatar-face">
                                            <img class="avatar-img" src="<?php echo e(asset($user->avatar)); ?>"
                                                alt="<?php echo e($user->full_name); ?>" />
                                        </div>
                                    <?php else: ?>
                                        <div class="avatar-text"><?php echo e($user->first_name[0] . $user->last_name[0]); ?></div>
                                    <?php endif; ?>

                                    <?php if($user->portfolio != null): ?>
                                        <div class="port-badge"><img src="<?php echo e(asset($user->portfolio?->icon)); ?>" /></div>
                                    <?php endif; ?>
                                </div>
                            </div>
                            <div class="title-des">
                                <h4><?php echo e($user->first_name . ' ' . $user->last_name); ?></h4>
                                <p><?php echo e(ucwords($user->city)); ?><?php if($user->city != ''): ?>
                                        ,
                                    <?php endif; ?><?php echo e($user->country); ?></p>
                                <?php if($user->activities->count() > 0): ?>
                                    <?php
                                        $lastLogin = $user->activities->sortByDesc('created_at')->first();
                                        $lastLoginDateTime = optional($lastLogin)->created_at->format('d-m-Y H:i:s');
                                    ?>
                                    <p><?php echo e(__('Last Login:')); ?> <?php echo e($lastLoginDateTime); ?></p>
                                <?php else: ?>
                                    <p><?php echo e(__('This user has not logged in yet.')); ?></p>
                                <?php endif; ?>
                            </div>
                            <div class="btns">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('customer-login')): ?>
                                    <a href="<?php echo e(route('admin.user.login', $user->id)); ?>" target="_blank"
                                        class="site-btn-round green-btn" data-bs-toggle="tooltip" title=""
                                        data-bs-placement="top" data-bs-original-title="Login As User">
                                        <i data-lucide="user-plus"></i>
                                    </a>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('customer-basic-manage')): ?>
                                    <a href="#" class="site-btn-round red-btn" id="deleteModal" data-bs-toggle="modal"
                                        data-bs-target="#delete" title="Delete User"><i data-lucide="trash-2"></i></a>

                                    <!-- Modal for Popup Box -->
                                    <?php echo $__env->make('backend.user.include.__delete_popup', ['id' => $user->id], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                    <!-- Modal for Popup Box End-->
                                <?php endif; ?>
                            </div>
                        </div>

                        <!-- User Status Update -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('all-type-status')): ?>
                            <?php echo $__env->make('backend.user.include.__status_update', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php endif; ?>
                        <!-- User Status Update End-->

                    </div>
                </div>

                <div class="col-xxl-9 col-xl-12 col-lg-12 col-md-12 col-sm-12">

                    <div class="site-tab-bars">
                        <ul class="nav nav-pills" id="pills-tab" role="tablist">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['customer-basic-manage', 'customer-change-password'])): ?>
                                <li class="nav-item" role="presentation">
                                    <a href="<?php echo e(route('admin.user.edit', $user->id)); ?>"
                                        class="nav-link <?php echo e(!request()->has('tab') ? 'active' : ''); ?>"><i
                                            data-lucide="user"></i><?php echo e(__('Information')); ?></a>
                                </li>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('payment-history')): ?>
                                <li class="nav-item" role="presentation">
                                    <a href="<?php echo e(route('admin.user.edit', ['user' => $user->id, 'tab' => 'transactions'])); ?>"
                                        class="nav-link <?php echo e(request('tab') == 'transactions' ? 'active' : ''); ?>"><i
                                            data-lucide="cast"></i><?php echo e(__('Payment History')); ?></a>
                                </li>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('bookings-list')): ?>
                                <li class="nav-item" role="presentation">
                                    <a href="<?php echo e(route('admin.user.edit', ['user' => $user->id, 'tab' => 'bookings'])); ?>"
                                        class="nav-link <?php echo e(request('tab') == 'bookings' ? 'active' : ''); ?>"><i
                                            data-lucide="book-open-check"></i><?php echo e(__('Bookings')); ?></a>
                                </li>
                            <?php endif; ?>
                        </ul>
                    </div>

                    <div class="tab-content" id="pills-tabContent">
                        <!-- basic Info -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['customer-basic-manage', 'customer-change-password'])): ?>
                            <?php echo $__env->make('backend.user.include.__basic_info', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php endif; ?>

                        <!-- transaction -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('payment-history-list')): ?>
                            <?php echo $__env->make('backend.user.include.__transactions', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php endif; ?>

                        <!-- bookings -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('bookings-list')): ?>
                            <?php echo $__env->make('backend.user.include.__bookings', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php endif; ?>

                        <!-- ticket -->
                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->any(['support-ticket-list', 'support-ticket-action'])): ?>
                            <?php echo $__env->make('backend.user.include.__ticket', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- Modal for Send Email -->
    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('customer-mail-send')): ?>
        <?php echo $__env->make('backend.user.include.__mail_send', [
            'name' => $user->first_name . ' ' . $user->last_name,
            'id' => $user->id,
        ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php endif; ?>
    <!-- Modal for Send Email-->
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    <script>
        "use strict"

        $('#branch_id').select2();
        $('#country').select2();

        // Delete
        $('body').on('click', '#deleteModal', function() {
            var id = "<?php echo e($user->id); ?>";

            var url = '<?php echo e(route('admin.user.destroy', ':id')); ?>';
            url = url.replace(':id', id);
            $('#deleteForm').attr('action', url);
            $('#delete').modal('toggle')
        });
    </script>
<?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.mimeld.com/resources/views/backend/user/edit.blade.php ENDPATH**/ ?>