<?php echo $__env->make('dashboard.include.header', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>;

  
  <div class="content-wrapper">
    <div class="content-header">
      <div class="container-fluid">
        <div class="row mb-2">
          <div class="col-sm-6">
            <h1 class="m-0">All Orders</h1>
          </div>
          <div class="col-sm-6">
            <ol class="breadcrumb float-sm-right">
              <li class="breadcrumb-item"><a href="/home">Home</a></li>
              <li class="breadcrumb-item active">All Orders</li>
            </ol>
          </div>
        </div>
      </div>
    </div>
   
    <section class="content">
      <div class="container-fluid">

      <div class="card">
        <div class="card-body">
        <form action="/allordersserach" method="post" enctype="multipart/form-data">
          <?php echo e(csrf_field()); ?>

          <div class="row">
            <div class="col-md-3">
                <div class="form-group">
                <label>Date Range</label>
                <div class="input-group">
                    <div class="input-group-prepend">
                    <span class="input-group-text">
                        <i class="far fa-calendar-alt"></i>
                    </span>
                    </div>
                    <input type="text" class="form-control float-right" value="<?php echo e($drange); ?>" id="reservation" name="daterange">
                </div>
                </div>
            </div>
            <div class="col-md-3">
            <div class="form-group">
                  <label>Delivery Partner</label>
                  <select class="select2" multiple="multiple" name="DeliveryPartner[]" data-placeholder="Delivery Partner" style="width: 100%;">
                            <?php $__currentLoopData = $del; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            
                            <option value="<?php echo e($data->id); ?>" ><?php echo e($data->deliveryname); ?></option>
                           
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                <label>Order Source</label>
                  <select class="select2" multiple="multiple" name="OrderSource[]" data-placeholder="Order Source" style="width: 100%;">
                 
                        <option value="Facebook Leads">Facebook Leads</option>
                        <option value="Facebook Message">Facebook Message</option>                            
                        <option value="Whatsapp">Whatsapp</option>                            
                        <option value="Call Order">Call Order</option>                            
                        <option value="Store Pickup">Store Pickup</option>          
                            
                  </select>
                </div>
            </div>
            <div class="col-md-3">
                <div class="form-group">
                <label>Payment Mode</label>
                  <select class="select2" multiple="multiple" name="PaymentMode[]" data-placeholder="Payment Mode" style="width: 100%;">
                    <option value="cash">Cash on delivery</option>
                    <option value="paid">Paid</option>
                  </select>
                </div>
            </div>
          </div>

          <div class="row">
            <div class="col-md-3">
            <div class="form-group">
                <label>Order Status</label>
                  <select class="select2" multiple="multiple" name="OrderStatus[]" data-placeholder="Order Status" style="width: 100%;">
                        <option value="1">Pending</option>
                        <option value="2" >1st Attempt</option>
                        <option value="3" >2nd Attempt</option>
                        <option value="4" >3rd Attempt</option>
                        <option value="5" >Colombo Confirm</option>
                        <option value="6">Out Confirm </option>
                        <option value="7" >Return Order</option>
                        <option value="8" >Dispatched Orders</option>
                        <option value="9" >Money Recived</option>
                        <option value="10">Cancel</option>
                        <option value="12" >Colombo Print</option>
                        <option value="11">Out Print</option>
                        <option value="13" >Packing Out</option>
                        <option value="17">He will call</option>
                        <option value="16">Phone off</option>
                  </select>
                </div>
            </div>
            <div class="col-md-3">
            <div class="form-group">
                <label>Delivery Rider</label>
                  <select class="select2" multiple="multiple" name="DeliveryRider[]" data-placeholder="DeliveryRider" style="width: 100%;">
                            <?php $__currentLoopData = $delise; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?php if($data->type=="Delivery_Guy"): ?>
                            <option value="<?php echo e($data->id); ?>"><?php echo e($data->name); ?></option>
                            <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                  </select>
                </div>
            </div>
            <div class="col-md-3">
            <div class="form-group">
                <label>Branch</label>
                  <select class="select2" multiple="multiple" name="Branch[]" data-placeholder="Branch" style="width: 100%;">
                    <option value="Battaramulla">Battaramulla</option>
                    <option value="Borella">Borella</option>
                  </select>
                </div>
            </div>
            <div class="col-md-3">
            <div class="form-group">
                  <label>Phone Number</label>
                  <input type="text" placeholder="Phone Number"  value="" id="phone" name="phone" class="form-control">
              </div>
            </div>
          </div><br>
          <div class="row">
            <div class="col-md-2">
              <button type="submit" class="btn btn-primary btn-block">Search</button>
            </div>
          </div>

          </form>

         </div>
      </div>





      <div class="card">
        <div class="card-body">
          <div class="row">
            <div class="col-md-12">
                <table id="example12" class="table table-bordered" style="width:100%; font-size:13px;">
                    <thead>
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th>Address</th>
                            <th>Phone</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php $__currentLoopData = $item; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><?php echo e($data->id); ?></td>
                            <td><?php echo e($data->name); ?></td>
                            <td><?php echo e($data->address); ?></td>
                            <td><?php echo e($data->phone); ?></td>
                            <td class="text-center">   
                            <?php if($data->status =='0'): ?>   
                              <span class="badge badge-warning">Check Order</span>
                              <?php elseif($data->status =='1'): ?>   
                              <span class="badge badge-info">Pending</span>
                              <?php elseif($data->status =='2'): ?>               
                              <span class="badge badge-warning" >1st Attempt</span>
                              <?php elseif($data->status =='3'): ?>                
                              <span class="badge badge-warning">2nd Attempt</span>
                              <?php elseif($data->status =='4'): ?>               
                              <span class="badge badge-warning">3rd Attempt</span>
                              <?php elseif($data->status =='5'): ?>            
                              <span class="badge badge-primary">Colombo Confirm Delivery</span>                  
                              <?php elseif($data->status =='6'): ?>                
                              <span class="badge badge-primary">Today Confirm Delivery</span>
                              <?php elseif($data->status =='7'): ?>                
                              <span class="badge badge-info">Return Order</span>
                              <?php elseif($data->status =='8'): ?>                
                              <span class="badge badge-info">Complete Order</span>
                              <?php elseif($data->status =='9'): ?>                
                              <span class="badge badge-success">Paid Order</span>
                              <?php elseif($data->status =='10'): ?>                
                              <span class="badge badge-danger">Cancel Order</span>
                              <?php elseif($data->status =='11'): ?>                
                              <span class="badge badge-primary">Print Today Order</span>
                              <?php elseif($data->status =='12'): ?>                
                              <span class="badge badge-primary">Colombo Print Order</span>
                              <?php elseif($data->status =='13'): ?>                
                              <span class="badge badge-primary">Inventory Today Order</span>
                              <?php elseif($data->status =='14'): ?>                
                              <span class="badge badge-primary">Inventory Colombo Order</span>
                              <?php elseif($data->status =='15'): ?>                
                              <span class="badge badge-primary">Today Excel Complete Order</span>
                              <?php elseif($data->status =='16'): ?>                
                              <span class="badge badge-primary">Phone Off</span>
                              <?php elseif($data->status =='17'): ?>                
                              <span class="badge badge-primary">He will call</span>
                              <?php endif; ?>                      
                                
                            </td>
                            <td class="text-center">   
                              <?php if($data->status == 0 OR $data->status == 1 OR $data->status == 2 OR  $data->status == 3  OR $data->status == 4 OR  $data->status == 5  OR $data->status == 6): ?>
                              <a data-id="<?php echo e($data->id); ?>" class="btn btn-primary btn-xs" href="viewallorders/<?php echo e($data->id); ?>">View</a>
                              <?php else: ?>
                              <a data-id="<?php echo e($data->id); ?>" class="btn btn-primary btn-xs" href="viwedetailsconfirm/<?php echo e($data->id); ?>">View</a>
                              <?php endif; ?>                         
                                
                            </td>
                            
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> 
                    </tbody>
                    <tfoot>
                        <tr>
                            <th>Id</th>
                            <th>Name</th>
                            <th>Address</th>
                            <th>Phone</th>
                            <th>Status</th>
                            <th>Action</th>
                        </tr>
                    </tfoot>
                </table>
            </div>
          </div>
          </div>
        </div>

      </div>
    </section>
  </div>
 



  <?php echo $__env->make('dashboard.include.footer', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>;

<script>
$(document).ready(function() {
    $('#example12').DataTable();
} );
</script>
  <script>
    $('#reservation').daterangepicker({
        locale: {
            format: 'YYYY/MM/DD'
        }
    });

  $(document).ready(function() {
        $('#ingredients').multiselect();
    });


     $('.select2').select2()

  </script>