<?php $__env->startSection('title', translate('Review List')); ?>

<?php $__env->startPush('css_or_js'); ?>

<?php $__env->stopPush(); ?>

<?php $__env->startSection('content'); ?>
    <div class="content container-fluid">
        <!-- Page Header -->
        <div class="page-header">
            <div class="row align-items-center">
                <div class="col-sm mb-2 mb-sm-0">
                    <h1 class="page-header-title"><?php echo e(\App\CentralLogics\translate('review')); ?> <?php echo e(\App\CentralLogics\translate('list')); ?> <span class="mx-1 text-primary"><?php echo e($reviews->total()); ?></span></h1>
                </div>
            </div>
        </div>
        <!-- End Page Header -->
        <div class="row gx-2 gx-lg-3">
            <div class="col-sm-12 col-lg-12 mb-3 mb-lg-2">
                <!-- Card -->
                <div class="card">
                    <!-- Header -->
                    <div class="card-header flex-between">
                        <h5 class="card-header-title"></h5>
                        <form action="<?php echo e(url()->current()); ?>" method="GET">
                            <div class="input-group">
                                <input id="datatableSearch_" type="search" name="search"
                                       class="form-control"
                                       placeholder="<?php echo e(translate('Search')); ?>" aria-label="Search"
                                       value="<?php echo e($search); ?>" required autocomplete="off">
                                <div class="input-group-append">
                                    <button type="submit" class="input-group-text"><i class="tio-search"></i>
                                    </button>
                                </div>
                            </div>
                        </form>
                    </div>
                    <!-- End Header -->

                    <!-- Table -->
                    <div class="table-responsive datatable-custom">
                        <table id="columnSearchDatatable"
                               class="table table-borderless table-thead-bordered table-nowrap table-align-middle card-table"
                               data-hs-datatables-options='{
                                 "order": [],
                                 "orderCellsTop": true
                               }'>
                            <thead class="thead-light">
                            <tr>
                                <th><?php echo e(\App\CentralLogics\translate('#')); ?></th>
                                <th style="width: 30%"><?php echo e(\App\CentralLogics\translate('deliveryman')); ?></th>
                                <th style="width: 25%"><?php echo e(\App\CentralLogics\translate('customer')); ?></th>
                                <th><?php echo e(\App\CentralLogics\translate('review')); ?></th>
                                <th><?php echo e(\App\CentralLogics\translate('rating')); ?></th>
                            </tr>
                            </thead>

                            <tbody>
                            <?php $__currentLoopData = $reviews; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key=>$review): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <tr>
                                        <td><?php echo e($reviews->firstitem()+$key); ?></td>
                                        <td>
                                        <span class="d-block font-size-sm text-body">
                                                <?php if($review->delivery_man): ?>
                                                <a href="<?php echo e(route('admin.delivery-man.preview',[$review['delivery_man_id']])); ?>">
                                                    <?php echo e($review->delivery_man->f_name.' '.$review->delivery_man->l_name); ?>

                                                </a>
                                                <?php else: ?>
                                                    <span class="badge-pill badge-soft-dark text-muted text-sm small">
                                                        <?php echo e(\App\CentralLogics\translate('DeliveryMan unavailable')); ?>

                                                    </span>
                                                <?php endif; ?>
                                        </span>
                                        </td>
                                        <td>
                                            <?php if(isset($review->customer)): ?>
                                                <a href="<?php echo e(route('admin.customer.view',[$review->user_id])); ?>">
                                                    <?php echo e($review->customer->f_name." ".$review->customer->l_name); ?>

                                                </a>
                                            <?php else: ?>
                                                <span class="badge-pill badge-soft-dark text-muted text-sm small">
                                                    <?php echo e(translate('Customer unavailable')); ?>

                                                </span>
                                            <?php endif; ?>
                                        </td>
                                        <td>
                                            <?php echo e($review->comment); ?>

                                        </td>
                                        <td>
                                            <label class="badge badge-soft-info">
                                                <?php echo e($review->rating); ?> <i class="tio-star"></i>
                                            </label>
                                        </td>
                                    </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            </tbody>
                        </table>
                        <hr>
                        <table>
                            <tfoot>
                            <?php echo $reviews->links(); ?>

                            </tfoot>
                        </table>
                    </div>
                    <!-- End Table -->
                </div>
                <!-- End Card -->
            </div>
        </div>
    </div>

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

<?php $__env->startPush('script_2'); ?>
    <script>
        $(document).on('ready', function () {
            // INITIALIZATION OF DATATABLES
            // =======================================================
            var datatable = $.HSCore.components.HSDatatables.init($('#columnSearchDatatable'));

            $('#column1_search').on('keyup', function () {
                datatable
                    .columns(1)
                    .search(this.value)
                    .draw();
            });

            $('#column2_search').on('keyup', function () {
                datatable
                    .columns(2)
                    .search(this.value)
                    .draw();
            });

            $('#column3_search').on('change', function () {
                datatable
                    .columns(3)
                    .search(this.value)
                    .draw();
            });

            $('#column4_search').on('keyup', function () {
                datatable
                    .columns(4)
                    .search(this.value)
                    .draw();
            });


            // INITIALIZATION OF SELECT2
            // =======================================================
            $('.js-select2-custom').each(function () {
                var select2 = $.HSCore.components.HSSelect2.init($(this));
            });
        });
    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('layouts.admin.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/v23cd0f9pc3c/public_html/cornermember/resources/views/admin-views/delivery-man/reviews-list.blade.php ENDPATH**/ ?>