<?php $__env->startSection('content'); ?>
    <div
        class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
        <h1 class="h2">Ürünler</h1>
    </div>

    <div class="row">
        <form method="get" action="<?php echo e(route('products')); ?>">
            <div class="row">
                <div class="col-6">
                    <select class="form-select" name="project">
                        <?php if(!request('project')): ?>
                            <option selected>Proje Seç</option>
                        <?php else: ?>
                            <option>Proje Seç</option>
                        <?php endif; ?>
                        <?php $__currentLoopData = $projects; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $project): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if(request('project') == $project->id): ?>
                                <option value="<?php echo e($project->id); ?>" selected><?php echo e($project->project_name); ?></option>
                            <?php else: ?>
                                <option value="<?php echo e($project->id); ?>"><?php echo e($project->project_name); ?></option>
                            <?php endif; ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </select>
                </div>
                <div class="col-6">
                    <select class="form-select" name="image" id="imageFilter">
                        <?php if(!request('image')): ?>
                            <option selected value="0">Tüm Ürünler</option>
                        <?php else: ?>
                            <option value="0">Tüm Ürünler</option>
                        <?php endif; ?>
                        <?php if(request('image') == 1): ?>
                            <option value="1" selected>Resmi Olanlar</option>
                        <?php else: ?>
                            <option value="1">Resmi Olanlar</option>
                        <?php endif; ?>
                        <?php if(request('image') == 2): ?>
                            <option value="2" selected>Resmi Olmayanlar</option>
                        <?php else: ?>
                            <option value="2">Resmi Olmayanlar</option>
                        <?php endif; ?>
                    </select>
                </div>
            </div>
            <div class="col-4">
                <button type="submit" class="mt-4 btn btn-primary">Filtrele</button>
            </div>
        </form>
    </div>

    <div class="row mt-5">

        <table class="table table-hover">
            <tbody>
            <th>Ürün No</th>
            <th>Model</th>
            <th>SKU</th>
            <th>EAN</th>
            <th>Stok</th>
            </tbody>
            <?php $__currentLoopData = $products; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $product): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                <tr>
                    <td><?php echo e($product->product_id); ?></td>
                    <td><?php echo e($product->model); ?></td>
                    <td><?php echo e($product->sku); ?></td>
                    <td><?php echo e($product->ean); ?></td>
                    <td><?php echo e($product->quantity); ?></td>
                </tr>
            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
        </table>

        <div class="col-6 m-auto">
            <?php if($products): ?>
                <?php echo e($products->links()); ?>

            <?php endif; ?>
        </div>
    </div>

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

<?php $__env->startSection('js'); ?>
    <script>
        $( "#imageFilter" ).change(function() {
            var value = $( this ).val();
            var url = new URL(window.location.href);
            url.searchParams.set('image',value);
            window.location.href = url.href;
        });
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /Users/burak/PhpstormProjects/tudors/resources/views/products.blade.php ENDPATH**/ ?>