<?php $__env->startSection('content'); ?>
    <div class="row mb-35 g-4">
        <div class="col-md-9">
            <div class="page-title text-md-start">
                <h4><?php echo e($page_title ?? ''); ?></h4>
            </div>
        </div>
        <div
            class="col-md-3 text-md-end text-center d-flex justify-content-md-end justify-content-center flex-row align-items-center flex-wrap gap-4">
            <a href="<?php echo e(route('activities.list')); ?>" class="eg-btn btn--primary back-btn"> <img
                    src="<?php echo e(asset('backend/images/icons/back.svg')); ?>" alt="<?php echo e(translate('Go Back')); ?>">
                <?php echo e(translate('Go Back')); ?></a>
        </div>
    </div>
    <div class="row">
        <div class="col-12">
            <div class="table-wrapper">
                <table class="eg-table table customer-table">
                    <thead>
                        <tr>
                            <th><?php echo e(translate('S.N')); ?></th>
                            <th><?php echo e(translate('Customer')); ?></th>
                            <th><?php echo e(translate('Email / Phone')); ?></th>
                            <th><?php echo e(translate('Rate')); ?></th>
                            <th><?php echo e(translate('Review')); ?></th>
                            <th><?php echo e(translate('Status')); ?></th>
                            <th><?php echo e(translate('Date')); ?></th>
                            <th><?php echo e(translate('Reply')); ?></th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($activitiesReviews->count() > 0): ?>
                            <?php $__currentLoopData = $activitiesReviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $productReview): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td data-label="S.N">
                                        <?php echo e(($activitiesReviews->currentpage() - 1) * $activitiesReviews->perpage() + $key + 1); ?>

                                    </td>
                                    <td data-label="Customer" class="text-start"><a
                                            href="<?php echo e(route('customer.view', $productReview->users->id)); ?>"><?php echo e($productReview->users->fname . ' ' . $productReview->users->lname); ?><br><span
                                                class="text-purple"><?php echo e('@' . $productReview->users->username); ?></span></a>
                                    </td>
                                    <td data-label="Email / Phone"> <a
                                            href="mailto:<?php echo e($productReview->users->email); ?>"><?php echo e($productReview->users->email); ?></a>
                                        <br><a href="tel:<?php echo e($productReview->users->phone); ?>"
                                            class="phone"><?php echo e($productReview->users->phone); ?></a></td>
                                    <td data-label="Rate">
                                        <ul class="rating-star">
                                            <?php switch($productReview->rate):
                                                case (1): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (1.5): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-half"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (2): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (2.5): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-half"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (3): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (3.5): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-half"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (4): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star"></i></li>
                                                <?php break; ?>

                                                <?php case (4.5): ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-half"></i></li>
                                                <?php break; ?>

                                                <?php default: ?>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                                    <li><i class="bi bi-star-fill"></i></li>
                                            <?php endswitch; ?>
                                        </ul>
                                    </td>
                                    <td data-label="Review"><?php echo e($productReview->review); ?></td>
                              
                                    <td data-label="Status">
                                        <div class="form-check form-switch">
                                            <input class="form-check-input flexSwitchCheckStatus" type="checkbox"
                                                data-activations-status="<?php echo e($productReview->status); ?>"
                                                data-id="<?php echo e($productReview->id); ?>" data-type="activitiesReview"
                                                id="flexSwitchCheckStatus<?php echo e($productReview->id); ?>"
                                                <?php echo e($productReview->status == 1 ? 'checked' : ''); ?>>
                                        </div>
                                    </td>

                                    <td data-label="Date">
                                        <p class="mb-0"><?php echo e(date('d.m.Y', strtotime($productReview->created_at))); ?></p>
                                        <span
                                            class="time"><?php echo e(date('h.i A', strtotime($productReview->created_at))); ?></span>
                                    </td>
                                    <td data-label="Reply">
                                        <?php if($productReview->replies->count() > 0): ?>
                                            <button type="button" class="eg-btn account--btn"><i
                                                    class="bi bi-hand-thumbs-up"></i></button>
                                        <?php else: ?>
                                            <button type="button" data-review_id="<?php echo e($productReview->id); ?>"
                                                data-product_id="<?php echo e($productReview->product_id); ?>"
                                                class="staticBackdropReview eg-btn add--btn" data-bs-toggle="modal"
                                                data-bs-target="#staticBackdropReview"><i
                                                    class="bi bi-reply-all"></i></button>
                                        <?php endif; ?>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php else: ?>
                            <tr>
                                <td colspan="10" data-label="Not Found">
                                    <h4><?php echo e(translate('No Data Found')); ?></h4>
                                </td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
    <?php echo $__env->make('backend.activities.modal', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?>
    <?php $__env->startPush('footer'); ?>
        <div class="d-flex justify-content-center custom-pagination">
            <?php echo $activitiesReviews->links(); ?>

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

<?php echo $__env->make('backend.layouts.master', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH C:\laragon\www\triprex-app\resources\views/backend/activities/reviews.blade.php ENDPATH**/ ?>