<?php if (isset($component)) { $__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23 = $component; } ?>
<?php $component = $__env->getContainer()->make(App\View\Components\MasterLayout::class, []); ?>
<?php $component->withName('master-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php $component->withAttributes([]); ?>
    <div>
        <div class="row">
            <div class="col-lg-12">
                <div class="card">
                    <div class="card-body">
                            <div class="col-md-6 float-left">
                                <?php echo e(Form::open(['method' => 'GET'])); ?>

                                    <div class="row">
                                        <div class="form-group col-md-3">
                                            <?php echo e(Form::label('country_id', __('message.select_name', ['select' => __('message.country')]), ['class' => 'form-control-label'])); ?>

                                            <?php echo e(Form::select('country_id', $selectedCountry,request()->input('country_id'), [
                                                'class' => 'select2js form-group country',
                                                'data-placeholder' => __('message.select_name', ['select' => __('message.country')]),
                                                'data-ajax--url' => route('ajax-list', ['type' => 'country-list']),
                                                ])); ?>

                                        </div>
                                        <div class="form-group col-md-3">
                                            <?php echo e(Form::label('city_id', __('message.select_name', ['select' => __('message.city')]), ['class' => 'form-control-label'])); ?>

                                            <?php echo e(Form::select('city_id', $selectedCity, request()->input('city_id'), [
                                                'class' => 'select2js form-group city',
                                                'data-placeholder' => __('message.select_name', ['select' => __('message.city')]),
                                                'data-ajax--url' => route('ajax-list', ['type' => 'city-list']),
                                            ])); ?>

                                        </div>

                                        <div class="form-group col-md-4 mt-3">
                                            <button type="submit" class="btn btn-sm btn-warning text-white mt-3 pt-2 pb-2"><?php echo e(__('message.apply_filter')); ?></button>
                                            <a href="<?php echo e(route('draft-order')); ?>" class="btn btn-sm btn-success text-dark ml-2 mt-3 pt-2 pb-2"><?php echo e(__('message.reset')); ?></a>
                                        </div>
                                    </div>
                                <?php echo e(Form::close()); ?>

                            </div>

                        <div class="table-responsive mt-4">
                            <table id="basic-table" class="table mb-0  text-center" role="grid">
                                <thead>
                                    <tr>
                                        <th scope='col'><?php echo e(__('message.order_id')); ?></th>
                                        <th scope='col'><?php echo e(__('message.delivery_man')); ?></th>
                                        <th scope='col'><?php echo e(__('message.pickup_date')); ?></th>
                                        <th scope='col'><?php echo e(__('message.pickup_address')); ?></th>
                                        <th scope='col'><?php echo e(__('message.created_at')); ?></th>
                                        <th scope='col'><?php echo e(__('message.status')); ?></th>
                                        <th scope='col'><?php echo e(__('message.action')); ?></th>
                                    </tr>
                                </thead>
                                <tbody>
                                    <?php if( count($orders) > 0): ?>
                                        <?php $__currentLoopData = $orders; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php
                                                $status = 'primary';
                                                    $order_status = $value->status;
                                                switch ($order_status) {
                                                    case 'draft':
                                                    $status = 'light';
                                                    $status_name = __('message.draft');
                                                    break;

                                                }
                                            ?>
                                            <tr>
                                                <td><?php echo e(optional($value)->id ?? '-'); ?></td>
                                                <td><?php echo e(optional($value->delivery_man)->name ?? '-'); ?></td>
                                                <td><?php echo e(dateAgoFormate($value->pickup_datetime) ?? '-'); ?></td>
                                                <td>
                                                    <?php
                                                        $pickup_address = $value->pickup_point['address'];
                                                        echo (strlen($pickup_address)) ? '<span data-toggle="tooltip" data-html="true" data-placement="top" title="'.$pickup_address.'">'.substr($pickup_address, 0, 35).'...'.'</span>' : '-' ;
                                                    ?>
                                                </td>
                                                <td><?php echo e(dateAgoFormate($value->created_at) ?? '-'); ?></td>
                                                <td><span class="badge bg-<?php echo e($status); ?>"><?php echo e(__('message.'.$order_status)); ?></span></td>
                                                <td>
                                                    <?php if($value->status == 'draft'): ?>
                                                        <a class="mr-2" href="<?php echo e(route('order.edit',$value->id)); ?>" title="<?php echo e(__('message.update_form_title',['form' => __('message.users') ])); ?>"><i class="fas fa-edit text-primary"></i></a>
                                                    <?php else: ?>
                                                        <a class="mr-2" href="<?php echo e(route('order.show',$value->id)); ?>"><i class="fas fa-eye text-secondary"></i></a>
                                                        <a class="mr-2" href="<?php echo e(route('order-invoice',$value->id)); ?>"><i class="fa fa-download"></i></a>
                                                    <?php endif; ?>
                                                </td>
                                            </tr>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    <?php else: ?>
                                        <tr>
                                            <td colspan="9"><?php echo e(__('message.no_record_found')); ?></td>
                                        </tr>
                                    <?php endif; ?>
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <?php $__env->startSection('bottom_script'); ?>
        <script>
             $("#basic-table").DataTable({
                "dom":  '<"row align-items-center"<"col-md-2"><"col-md-6" B><"col-md-4"f>><"table-responsive my-3" rt><"d-flex" <"flex-grow-1" l><"p-2" i><"mt-4" p>><"clear">',
                "order": [[0, "desc"]]
            });
        </script>
    <?php $__env->stopSection(); ?>
 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23)): ?>
<?php $component = $__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23; ?>
<?php unset($__componentOriginalc6e081c8432fe1dd6b4e43af4871c93447ee9b23); ?>
<?php endif; ?>
<?php /**PATH /www/wwwroot/mxunzo.mimeld.com/resources/views/clientside/draftorder.blade.php ENDPATH**/ ?>