<div class="item_description">
    <h4><?php echo e(__('defaultTheme.product_reviews')); ?></h4>

    <?php
        $total_number_of_item_per_page = $reviews->perPage();
        $total_number_of_items = ($reviews->total() > 0) ? $reviews->total() : 0;
        $total_number_of_pages = $total_number_of_items / $total_number_of_item_per_page;
        $reminder = $total_number_of_items % $total_number_of_item_per_page;
        if ($reminder > 0) {
            $total_number_of_pages += 1;
        }
        $current_page = $reviews->currentPage();
        $previous_page = $reviews->currentPage() - 1;
        if($current_page == $reviews->lastPage()){
            $show_end = $total_number_of_items;
        }else{
            $show_end = $total_number_of_item_per_page * $current_page;
        }


        $show_start = 0;
        if($total_number_of_items > 0){
            $show_start = ($total_number_of_item_per_page * $previous_page) + 1;
        }


    ?>

    <?php if(count($reviews) > 0): ?>
        <?php $__currentLoopData = @$reviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>

        <div class="client_review media_style">
            <div class="single_product_img">
                <?php if($review->is_anonymous == 1 || @$review->customer->avatar == null): ?>
                <img src="<?php echo e(showImage('frontend/default/img/avatar.jpg')); ?>" alt="#" />
                <?php else: ?>
                <img src="<?php echo e(showImage(@$review->customer->avatar)); ?>" alt="#" />
                <?php endif; ?>
            </div>
            <div class="single_product_text">
                <div class="review_icon">
                    <i class="fas fa-star <?php echo e($review->rating >= 1?'':'text-gray'); ?>"></i>
                    <i class="fas fa-star <?php echo e($review->rating >= 2?'':'text-gray'); ?>"></i>
                    <i class="fas fa-star <?php echo e($review->rating >= 3?'':'text-gray'); ?>"></i>
                    <i class="fas fa-star <?php echo e($review->rating >= 4?'':'text-gray'); ?>"></i>
                    <i class="fas fa-star <?php echo e($review->rating == 5?'':'text-gray'); ?>"></i>
                </div>
                <h3><?php echo e($review->is_anonymous==1?'Unknown Name':@$review->customer->first_name.' '.@$review->customer->last_name); ?> <span><?php echo e(date('dS M, Y',strtotime($review->created_at))); ?></span></h3>
                <p>
                    <?php echo e($review->review); ?>

                </p>
                <div class="single_product_img">

                    <?php $__currentLoopData = $review->images; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $image): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <img class="review_img" src="<?php echo e(asset(asset_path($image->image))); ?>" alt="">
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </div>
            </div>


        </div>
        <?php if(@$review->reply): ?>
        <div class="replyDiv">
            <div class="row">
                <div class="col-lg-10 offset-lg-1">
                    <div class="client_review media_style">
                        <div class="single_product_img">

                            <img class="seller_avatar" src="<?php echo e(asset(asset_path(@$review->seller->photo?$review->seller->photo:'frontend/default/img/avatar.jpg'))); ?>" alt="" />
                        </div>
                        <div class="single_product_text seller_text_div">
                            <h3><?php echo e(@$review->seller->first_name); ?><span><?php echo e(date('dS M, Y',strtotime($review->reply->created_at))); ?></span></h3>
                            <p>
                                <?php echo e(@$review->reply->review); ?>

                            </p>

                        </div>


                    </div>
                </div>
            </div>
        </div>
        <?php endif; ?>
        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
    <?php else: ?>
        <p><?php echo e(__('defaultTheme.no_review_found')); ?></p>
    <?php endif; ?>

</div>

<?php if(count($reviews) > 0): ?>
<div class="col-lg-12">

    <div class="pagination_part">
        <nav aria-label="Page navigation example">
            <ul class="pagination">
                <li class="page-item"><a class="page-link" href="<?php echo e($reviews->previousPageUrl()); ?>"> <i class="ti-arrow-left"></i> </a></li>
                <?php for($i=1; $i <= $total_number_of_pages; $i++): ?>
                    <?php if(($reviews->currentPage() + 2) == $i): ?>
                        <li class="page-item"><a class="page-link" href="<?php echo e($reviews->url($i)); ?>"><?php echo e($i); ?></a></li>
                    <?php endif; ?>
                    <?php if(($reviews->currentPage() + 1) == $i): ?>
                        <li class="page-item"><a class="page-link" href="<?php echo e($reviews->url($i)); ?>"><?php echo e($i); ?></a></li>
                    <?php endif; ?>
                    <?php if($reviews->currentPage() == $i): ?>
                        <li class="page-item <?php if(request()->toRecievedList == $i || request()->toRecievedList == null): ?> active <?php endif; ?>"><a class="page-link" href="<?php echo e($reviews->url($i)); ?>"><?php echo e($i); ?></a></li>
                    <?php endif; ?>
                    <?php if(($reviews->currentPage() - 1) == $i): ?>
                        <li class="page-item"><a class="page-link" href="<?php echo e($reviews->url($i)); ?>"><?php echo e($i); ?></a></li>
                    <?php endif; ?>
                    <?php if(($reviews->currentPage() - 2) == $i): ?>
                        <li class="page-item"><a class="page-link" href="<?php echo e($reviews->url($i)); ?>"><?php echo e($i); ?></a></li>
                    <?php endif; ?>
                <?php endfor; ?>
                <li class="page-item"><a class="page-link" href="<?php echo e($reviews->nextPageUrl()); ?>"> <i class="ti-arrow-right"></i> </a></li>
            </ul>
        </nav>
    </div>
</div>

<?php endif; ?>
<?php /**PATH /home/penastud/public_html/mart/resources/views/frontend/default/partials/_product_review_with_paginate.blade.php ENDPATH**/ ?>