<form action="">
    <div style="margin-bottom: 10px;" class="row">
        <div class="form-group col-md-3">
            <select name="branche_id" class="form-control select2List">
                <option value="">--- الفرع ---</option>
                <?php $__currentLoopData = $branches; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $branche): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option <?php if($branche->id == request('branche_id')): ?> selected <?php endif; ?> value="<?php echo e($branche->id); ?>">
                        <?php echo e($branche->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="form-group col-md-3">
            <?php
                if (request('client_id')) {
                    $per = App\Models\Client::where('id', request('client_id'))->first();
                }
            ?>
            <select data-url="<?php echo e(route('getClientsList')); ?>" name="client_id" id="clientsList"
                class="form-control select2AjaxRequest">
                <option value="">--- العميل ---</option>

                <?php if(isset($per) && !empty($per)): ?>
                    <option selected <?php echo e(isset($item->client_id) && $per->id == $item->client_id ? 'selected' : ''); ?>

                        value="<?php echo e($per->id); ?>">
                        <?php echo e($per->id . ' - ' . $per->name . ' - ' . $per->mobile . ' - ' . $per->model); ?>

                    </option>
                <?php endif; ?>
            </select>
        </div>
        <div class="form-group col-md-3">
            <select style="width: 100%" id="carListSelect2" name="car_id" data-url="<?php echo e(route('getClientCarsList')); ?>"
                class="form-control">
                <option value="">--- السيارة ---</option>
                <?php if(isset($car)): ?>
                    <option selected value="<?php echo e($car->car_id); ?>">
                        <?php echo e($car->car_number . '-' . $car->car_brand . '-' . $car->model); ?>

                    </option>
                <?php endif; ?>
            </select>
        </div>
        <div class="form-group col-md-3">
            <select class="form-control" name="type">
                <option value="">--- الكل ---</option>
                <?php $__currentLoopData = $typesList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $invotype): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option <?php echo e(request('type') == $invotype->id ? 'selected' : ''); ?> value="<?php echo e($invotype->id); ?>">
                        <?php echo e($invotype->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="form-group col-md-4">

            <select name="status" class="form-control">
                <option value="">--- الكل ---</option>
                <?php $__currentLoopData = $statusList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $s): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option <?php if($s->id == request('status')): ?> selected="selected" <?php endif; ?> value="<?php echo e($s->id); ?>">
                        <?php echo e($s->name); ?> </option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="col-md-4">
            <div class="form-group ">
                <input id="fromdate" placeholder="الفترة من" autocomplete="off" style="direction: rtl;"
                    name="start_date" value="<?php echo e(request()->start_date); ?>" type="text"
                    class="form-control datepicker">
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <input id="todate" placeholder="الفترة إلى" autocomplete="off" style="direction: rtl;"
                    name="end_date" value="<?php echo e(request()->end_date); ?>" type="text" class="form-control datepicker">
            </div>
        </div>
        <div class="form-group col-md-4">
            <select style="width: 100%" name="user_id" class="form-control select2List">
                <option value="">--- المسئول ---</option>
                <?php $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <option <?php echo e(request('user_id') == $user->id ? 'selected' : ''); ?> value="<?php echo e($user->id); ?>">
                        <?php echo e($user->name); ?></option>
                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
            </select>
        </div>
        <div class="col-md-4">
            <div class="form-group ">
                <input placeholder=" تاريخ الدخول" autocomplete="off" style="direction: rtl;" name="entery_at"
                    value="<?php echo e(request()->entery_at); ?>" type="text" class="form-control datepicker">
            </div>
        </div>
        <div class="col-md-4">
            <div class="form-group">
                <input placeholder="تاريخ الخروج" autocomplete="off" style="direction: rtl;" name="exit_at"
                    value="<?php echo e(request()->exit_at); ?>" type="text" class="form-control datepicker">
            </div>
        </div>
        <div class="col-md-12 mb-2">
            <button type="submit" class="btn btn-primary">بحث</button>
        </div>
    </div>
</form>
<?php $__env->startPush('js'); ?>
    <script>
        $('.datepicker').datepicker({
            autoclose: true,
            rtl: true,
            format: 'yyyy-mm-dd',
            language: "ar",
        });
        $('.select2List').select2();
        $('#carListSelect2').select2({
            placeholder: "إختر السيارة",
            ajax: {
                url: function() {
                    return $(this).attr('data-url');
                },
                dataType: 'json',
                data: function(params) {
                    return {
                        term: params.term,
                        client_id: $('#clientsList').val(),
                    };
                },
                processResults: function(response) {
                    return {
                        results: response
                    };
                },
                cache: true,
            }
        });
    </script>
<?php $__env->stopPush(); ?>
<?php /**PATH /home/mwarsha2023/public_html/test4.mwarsha.com/resources/views/_partial/orderfilter.blade.php ENDPATH**/ ?>