<?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">Orders Status Summary</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">Orders Status Summary</li>
            </ol>
          </div>
        </div>
      </div>
    </div>
   
    <section class="content">
      <div class="container-fluid">

      <div class="card">
        <div class="card-body">
        <form class="form-horizontal" method="POST" action="/ordersstatusfilter">
          <?php echo e(csrf_field()); ?>

          <div class="row">

          <div class="col-md-5">
                <div class="form-group">
                    <label>Product Name</label>
                    <select class="form-control select2" name="product_d" id="product_d" style="width: 100%;" required>
                        <option value="" selected="selected" disabled>Select</option>
                        <?php $__currentLoopData = $product; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $productdata): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <option value="<?php echo e($productdata->id); ?>" <?php if($del==$productdata->id): ?> selected <?php endif; ?> ><?php echo e($productdata->name); ?></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="form-control" name="source" id="source">
                          <option value="Facebook Leads" <?php if($sou=="Facebook Leads"): ?> selected <?php endif; ?> >Facebook Leads</option>
                          <option value="Facebook Message" <?php if($sou=="Facebook Message"): ?> selected <?php endif; ?> >Facebook Message</option>                            
                          <option value="Whatsapp" <?php if($sou=="Whatsapp"): ?> selected <?php endif; ?> >Whatsapp</option>                            
                          <option value="Call Order" <?php if($sou=="Call Order"): ?> selected <?php endif; ?> >Call Order</option>                            
                          <option value="Store Pickup" <?php if($sou=="Store Pickup"): ?> selected <?php endif; ?> >Store Pickup</option>                            
                          <option value="Web Order" <?php if($sou=="Web Order"): ?> selected <?php endif; ?> >Web Order</option>                            
                      </select>
                  </div>
              </div>
              <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" id="reservation" value="<?php echo e($ldate); ?>" name="daterange">
                  </div>
                  </div>
              </div>
              <div class="col-md-1" style="padding-top:30px;">
                <button type="submit" class="btn btn-primary btn-block">Filter</button>
            </div>


          </div>
          </form>
        </div>
      </div>




      <div class="card">
        <div class="card-body">
          <div class="row">
            <div class="col-md-12">
                <table id="example12" data-page-length='50' class="table table-bordered" style="width:100%; font-size:13px;">
                    <thead>
                        <tr>
                            <th>Product Name</th>
                            <th>Order Source</th>
                            <th>Status</th>
                            <th>Count</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php if($del=="null"): ?>
  
                            <?php else: ?>
                            <?php $__currentLoopData = $dataor; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                              <td><?php echo e($data->name); ?></td>
                              <td><?php echo e($data->ordersource); ?></td>
                              <td>
                               <?php if($data->status =='0'): ?>   
                                Check Order
                                <?php elseif($data->status =='1'): ?>   
                                Pending
                                <?php elseif($data->status =='2'): ?>               
                                1st Attempt
                                <?php elseif($data->status =='3'): ?>                
                                2nd Attempt
                                <?php elseif($data->status =='4'): ?>               
                                3rd Attempt
                                <?php elseif($data->status =='5'): ?>            
                               Colombo Confirm           
                                <?php elseif($data->status =='6'): ?>                
                               Out Confirm
                                <?php elseif($data->status =='7'): ?>                
                                Return Order
                                <?php elseif($data->status =='8'): ?>                
                                Dispatched Order
                                <?php elseif($data->status =='9'): ?>                
                                Money Received Order
                                <?php elseif($data->status =='10'): ?>                
                                Cancel Order
                                <?php elseif($data->status =='11'): ?>                
                               Out Assigned
                                <?php elseif($data->status =='12'): ?>                
                               Colombo Assigned
                                <?php elseif($data->status =='13'): ?>                
                               Out Pick
                                <?php elseif($data->status =='14'): ?>                
                               Colombo Pick
                                <?php elseif($data->status =='15'): ?>                
                               Packed
                                <?php elseif($data->status =='16'): ?>                
                               Phone Off
                                <?php elseif($data->status =='17'): ?>                
                               He will call
                                <?php elseif($data->status =='18'): ?>                
                               Delivered
                                <?php elseif($data->status =='19'): ?>                
                               Dropex Confirm
                                <?php elseif($data->status =='20'): ?>                
                               Dropex Dispatched
                                <?php elseif($data->status =='26'): ?>                
                               Hold
                                <?php elseif($data->status =='27'): ?>                
                               Reject
                                <?php elseif($data->status =='28'): ?>                
                                Banned Customer
                                <?php elseif($data->status =='29'): ?>                
                                Incomplete Order
                                <?php elseif($data->status =='30'): ?>                
                                Reschedule Order
                                <?php elseif($data->status =='31'): ?>                
                                WebStore Dispatched
                                <?php endif; ?>
                              
                              
                              </td>
                              <td><?php echo e($data->count); ?></td>
                              </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                            <?php endif; ?>     

                        
                    </tbody>

                </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({
        "responsive": true, "lengthChange": true, "autoWidth": false,"order": [[ 1, "DESC" ]],
      // "buttons": ["copy", "csv", "excel", "pdf", "print"]
      "buttons": [ {extend: 'copy',footer: true,exportOptions: {columns: [0,1,2,3]}},   
      {extend: 'csv',footer: true,exportOptions: {columns: [0,1,2,3]}},
      {extend: 'excel',footer: true,exportOptions: {columns: [0,1,2,3]}},
      {extend: 'pdf',footer: true,exportOptions: {columns: [0,1,2,3]}},
      {extend: 'print',footer: true,exportOptions: {columns: [0,1,2,3]}},      
    ]  
    }).buttons().container().appendTo('#example12_wrapper .col-md-6:eq(0)');
} );


    $('#reservation').daterangepicker({
        locale: {
            format: 'YYYY/MM/DD'
        }
    });

    $('.select2').select2()
</script>