<?php $__env->startSection('content'); ?>
    <div class="common-content">
        <div class="page-content">
            <div class="page-heading">
                <div class="headings">
                    <h6><?php echo e($title); ?></h6>
                </div>
            </div>
           

              <?php if(count($dealers) > '0'): ?>
                     <a style="float:right;cursor: pointer;" href="<?php echo e(url('/vendorAddmanufacturesproducts')); ?>"><button
                        class="btn-adbtn btn-success " style="cursor: pointer;">
                        Add Manufacturer  Products</button></a>
            <?php endif; ?>
            
           
           
    
            <?php if((Auth::user()->user_type == '2')||(Auth::user()->user_type == '3')): ?>

                <?php if(count($dealers) > '0'){ ?>

                <?php if(count($product_lists) > 0) {?>
                <div class="tableBox wraper">
                    <table id="example" class="table table-striped table-bordered" style="width:100%">
                        <thead>
                            <tr>
                                <th>Id</th>
                                <th>Product Name</th>
                                <th>Product Code</th>
                                <th> Date</th>
                                <th>Manufacturer</th>
                                <th>Status</th>
                                <th>Action</th>
                            </tr>
                        </thead>
                        <tbody>
                            <!--<tr>
                                <form action="<?php echo e(url('vendors/products')); ?>" method="get" id='product-search-form'>
                                    <td>#</td>
                                    <td><input class="form-control product-search-field" type="text" name="product_name" value='<?php echo e($searchInputs["product_name"]); ?>'></td>
                                    <td><input class="form-control product-search-field" type="text" name="product_code" value='<?php echo e($searchInputs["product_code"]); ?>'></td>
                                    <td><input class="form-control product-search-field" type="date" name="product_created_date" value='<?php echo e($searchInputs["product_created_date"]); ?>'></td>
                                    <td>
                                        <select name="owner_id" id="owner_id" class="form-control">
                                            <option value="">All</option>
                                            <?php $__currentLoopData = $dealers; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dealer): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <option value="<?php echo e($dealer->manufacture_id); ?>" <?php if($searchInputs["owner_id"]==$dealer->manufacture_id ): ?> selected <?php endif; ?>><?php echo e($dealer->name); ?></option>
                                             <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>



                                    </td>
                                    <td></td>
                                    
                                    <td colspan="2">
                                        <button type="submit" class="btn btn-primary">
                                            <span class="glyphicon glyphicon-search form-control-feedback"><i class="fas fa-search" style="color: #14a852;" aria-hidden="true"></i>Search</span>
                                        </button>
                                        <button type="reset" class="btn btn-primary" onclick="resetForm()">
                                            <span class="glyphicon glyphicon-search form-control-feedback"><i class="fa fa-refresh" style="color: #14a852;" aria-hidden="true"></i>Reset</span>
                                        </button>
                                    </td>
                                    <td style="display: none;"></td>
                                </form>
                            </tr>-->
                            <?php $__currentLoopData = $product_lists; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $products): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td><?php echo e($key + 1); ?></td>
                                    <td><?php echo e($products->product_name); ?></td>
                                    <td><?php echo e($products->product_code); ?></td>
                                   
                                    <td>
                                        <?php if(!empty($products->created_at)): ?>
                                            <?php echo e(date('d-m-Y', strtotime($products->added_date))); ?>

                                        <?php endif; ?>
                                    </td>
                                    <td><?php echo e(ucfirst($products->name)); ?></td>
                                    <td> <?php if($products->product_status  == '0'){ ?>
                                        Inactive
                                        <?php }elseif($products->product_status  == '1'){  ?>
                                        Active
                                        <?php }elseif($products->product_status  == '2'){  ?>
                                        Rejected
                                        <?php } ?>
                                    </td>
                                    <td>
                                       
                                        <a href="<?php echo e(url('vendors/viewvendorproducts')); ?>/<?php echo e($products->product_id); ?>"><button
                                            class="btn"><i class="fa fa-eye"></i></button></a>
                                    </td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                        <!-- <tfoot>
                                <tr>
                                    <th>Id</th>
                                    <th>Product Name</th>
                                    <th>Product Code</th>
                                    <th>Action</th>
                                </tr>
                            </tfoot> -->
                    </table>
                </div><!-- tableBox end -->
                <?php }else{ ?>
                <div class="wraper">
                    <div class="product-display">
                        <ul>
                            <li>
                                <div class="details">
                                    <div>
                                        <h6>
                                            No Data available
                                        </h6>
                                    
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
                <?php } ?>
                <?php }else{ ?>
                <div class="wraper">
                    <div class="product-display">
                        <ul>
                            <li>
                                <div class="details">
                                    <div>
                                        <h6>
                                            Please register with manufacturer to access the feature.
                                        </h6>
                                    </div>
                                </div>
                            </li>
                        </ul>
                    </div>
                </div>
                <?php } ?>
            <?php else: ?>
            <?php endif; ?>
        </div>
    <?php $__env->stopSection(); ?>
    <?php $__env->startSection('scripts'); ?>
        <script type="text/javascript" charset="utf8" src="https://cdn.datatables.net/1.10.23/js/jquery.dataTables.js"></script>
        <script>
            $(document).ready(function() {
                $('#example').DataTable();
            });
        </script>
        <script>
            // $('#product-search-form').submit(function() {
            //     if ($('.product-search-field').val() === '') {
            //         alert();
            //         return false;
            //     }
            // });
            function resetForm() {
                window.location = location.protocol + '//' + location.host + location.pathname;
            }
        </script>
    <?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.main', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/meddbot/public_html/resources/views/vendors/products.blade.php ENDPATH**/ ?>