

<?php $__env->startSection('content'); ?>




<div class="card mb-4">
    <div class="card-header">
        <div class="d-flex">
            <div class="mr-auto p-2 align-self-center"><h4>All Orders</h4></div>
        </div>    

        <div class="border-top pt-3">
            <div class="row">
                <div class="col-lg-4 col-sm-4">
                    <form class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
                        <div class="input-group">
                            <input type="text"  id="searchgrp"   oninput="searOrder()" class="form-control bg-light border-0 small" placeholder="Search by Order Number" aria-label="Search" aria-describedby="basic-addon2">
                            <div class="input-group-append">
                            <button class="btn btn-info" type="button">
                                <i class="fas fa-search fa-sm"></i>
                            </button>
                            </div>
                        </div>
                    </form>
                </div>
                <div class="col-lg-4 col-sm-4">
                    <form class="d-none d-sm-inline-block form-inline mr-auto ml-md-3 my-2 my-md-0 mw-100 navbar-search">
                        <div class="input-group">
                            <input type="text"  id="searchmobile"   oninput="searchMobile()" class="form-control bg-light border-0 small" placeholder="Search by Name or Mobile " aria-label="Search" aria-describedby="basic-addon2">
                            <div class="input-group-append">
                            <button class="btn btn-info" type="button">
                                <i class="fas fa-search fa-sm"></i>
                            </button>
                            </div>
                        </div>
                    </form>
                    <div id="hint_tbl">
                    </div> 
                </div>
                <div class="col-lg-4 col-sm-4">
                    <div class="form-group w-30">
                        <select id="selectgrp" class="form-control <?php $__errorArgs = ['status_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>  <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" id="cbStatus" name="status_id" onchange="clicks()">
                            <?php
                                echo App\Http\Controllers\StatusController::StatusListForCombo(0);
                            ?>
                        </select>   
                        <?php $__errorArgs = ['status_id'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?><div class="invalid-feedback"><?php echo e($message); ?></div><?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                </div>

                <div class="col-lg-4 col-sm-4">             
                
                </div>           
            </div>
        </div>
    </div>
    <div class="card-body">
        <div class="table-responsive" >
            <table class="table table-hover" id="search_tbl">
                <thead>
                    <tr>
                        <!--th>SLNO.</th-->
                        <th>Order No.</th>
                        <th>Customer</th>
                        <th>Status</th>
                        <th>Rack</th>
                        <th>Godown</th>
                        <th>Narration</th>                     
                        <th colspan="">Actions</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $Results; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $Result): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($Result->id); ?></td>
                        <td><?php echo e($Result->user->name); ?></td>
                        <td><?php echo e($Result->status->title); ?></td>
                        <?php if($Result->rack): ?>
                            <td><?php echo e($Result->rack->title); ?></td>
                        <?php else: ?>
                            <td>Not Selected</td>
                        <?php endif; ?>
                        <?php if($Result->rack): ?>
                            <td><?php echo e($Result->rack->godown->title); ?></td>
                        <?php else: ?>
                            <td>Not Selected</td>
                        <?php endif; ?>
                       <td><?php echo e($Result->narration); ?></td>
                        <td style="width: 150px;"><a href="<?php echo e(route('orderlistview',$Result->id)); ?>" class="btn btn-info"><i class="fa fa-edit"></i> View</a></td>   
                         <td>
                            <?php if($Result->status_id>='6'): ?>
                                <a href="<?php echo e(route('InvoicePrint',$Result->id)); ?>"><button type="button" class="btn btn-secondary">Inovice</i></button></a>
                            <?php endif; ?>
                         </td>                    
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div>
    </div>
    <div class="card-footer">
        <div class="d-flex justify-content-end font-weight-bold"><h5>Total:  <?php echo e($Results->Count()); ?></h5></div>        
    </div>
</div>

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

<script>
function searOrder(){
     
 var items = document.getElementById("searchgrp").value;
    $.ajax({
      url: '<?php echo e(route('searchGroups')); ?>',
      method: "get",
      data: {_token: '<?php echo e(csrf_token()); ?>',searchitems:items },
                              success: function (response){   
                                           
                                document.getElementById('search_tbl').innerHTML=response; 
                              
                                      }
                      });   
} 

function searchMobile(){
    hint_tbl.style.display ="block";
    var items = document.getElementById("searchmobile").value;
    
    $.ajax({
          url: '<?php echo e(route('searchMobile')); ?>',
          method: "get",
          data: {_token: '<?php echo e(csrf_token()); ?>',searchitems:items },
                                  success: function (response){   
                                               
                                    document.getElementById('hint_tbl').innerHTML=response; 
                                  
                                          }
                          });   
    }


function clicks() {
    var items = document.getElementById("selectgrp").value;    
    
    $.ajax({
      url: '<?php echo e(route('selectGroups')); ?>',
      method: "get",
      data: {_token: '<?php echo e(csrf_token()); ?>',searchitems:items },
                              success: function (response){   

                                document.getElementById('search_tbl').innerHTML=response; 
                              
                                      }
                      });  

}


function userclick(ID){
    hint_tbl.style.display ="none";
    $.ajax({
          url: '<?php echo e(route('searchByID')); ?>',
          method: "get",
          data: {_token: '<?php echo e(csrf_token()); ?>',user_id:ID },
                                  success: function (response){   
                                             
                                    document.getElementById('search_tbl').innerHTML=response; 
                                          }
                          });
                             
    }
</script>
<?php echo $__env->make('layouts.adminapp', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/exouzia1/public_html/tailor/resources/views/OrderList/index.blade.php ENDPATH**/ ?>