<?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">Out Packing</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">Out Packing</li>
            </ol>
          </div>
        </div>
      </div>
    </div>
   
    <section class="content">
      <div class="container-fluid">
      <div class="card">
        <div class="card-body">

          <div class="row">
            <div class="col-md-4">
                <div class="form-group">
                    <form method="post" id="customerpackingdataget" action="/inventorytoday2">
                        <?php echo e(csrf_field()); ?>

                        <input type="text" class="form-control invoiceidtext" name="id" id="id" placeholder="Invoice ID + Press Enter Key" required autofocus>
                    </form>
                </div>
            </div>
          </div> <br><br><br><hr><br>
          <form method="post" action="/packbulkprint">
        <?php echo e(csrf_field()); ?>

          <div class="row">
            <div class="col-md-12">

                <table id="example1" data-page-length='50' class="table table-bordered" style="width:100%; font-size:12px;">
                    <thead>
                        <tr>
                            <th><input type="checkbox" id="selectall"/></th>
                            <th>Id</th>
                            <th>Delivery Service</th>
                            <th>Name</th>
                            <th>COD</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                    <?php $__currentLoopData = $item; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $data): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <tr>
                            <td><input type="checkbox" class="singlechkbox" name="checkids[]" value="<?php echo e($data->id); ?>"/></td>
                            <td><?php echo e($data->id); ?></td>
                            <td><?php echo e($data->deliveryse->deliveryname); ?></td>
                            <td><?php echo e($data->name); ?></td>
                            <td><?php if($data->paymentmethod=="paid"): ?>0.00 <?php else: ?><?php echo e($data->cod); ?><?php endif; ?></td>
                            <td class="text-center">                            
                                <a data-id="<?php echo e($data->id); ?>" class="btn btn-primary btn-xs" href="viwedetails/<?php echo e($data->id); ?>">View</a>
                            </td>
                            
                        </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?> 
                    </tbody>
                    <tfoot>
                        <tr>
                            <th><input type="checkbox" id="selectall"/></th>
                            <th>Id</th>
                            <th>Delivery Service</th>
                            <th>Name</th>
                            <th>COD</th>
                            <th>Action</th>
                        </tr>
                    </tfoot>
                </table>
                
            </div>
          </div> <br>
          <div class="row">
            <div class="col-md-4">
                <div class="form-group">
                    <label>Select Delivery Service</label>
                    <select class="form-control" name="delivery" id="delivery" style="width: 100%;" required>
                        <option value="" selected="selected" disabled>Select</option>
                            <?php $__currentLoopData = $delise; $__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-2" style="padding-top:30px;">
            
            <button type="submit" formtarget="_blank" name="invoice" value="invoice" class="btn btn-dark btn-block">Genarate Invoices</button>
            
            </div>
            <!-- <div class="col-md-2" style="padding-top:32px;"><button type="submit" name="dropex" class="btn btn-block btn-dark" value="dropex">Send to Dropex</button></div> -->
            </div> <br><br><br><br><br><br><br><br><br><br>
          </form>
          <div class="row">
          <div class="col-md-9"></div>
            <!-- <div class="col-md-3"><input type="button" value="Send To Dispatch Summary" class="btn btn-primary btn-block" id="myButton" /></div> -->

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




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

<script>
$(function () {
    $("#example1").DataTable({
      "responsive": true, "lengthChange": true, "autoWidth": false
    }).buttons().container().appendTo('#example1_wrapper .col-md-6:eq(0)');
  });
</script>
<script type="text/javascript">
jQuery(function($) {
    $('body').on('click', '#selectall', function() {
        $('.singlechkbox').prop('checked', this.checked);
    });
 
    $('body').on('click', '.singlechkbox', function() {
        if($('.singlechkbox').length == $('.singlechkbox:checked').length) {
            $('#selectall').prop('checked', true);
        } else {
            $("#selectall").prop('checked', false);
        }
 
    });
});

</script>


<script>
//  $('input[name=id]').change(function() { 
//     $("#customerpackingdataget").submit();
//  });

$('.invoiceidtext').bind("enterKey",function(e){
  $("#customerpackingdataget").submit();
});


</script>

<script>
<?php if(session('success')): ?>
        // swal("Success!","<?php echo e(session('success')); ?>","success");
        toastr.success('Your work has been successfully!')
// Swal.fire({
  
//   type: 'success',
//   title: 'Your work has been saved',
//   text: "<?php echo e(session('success')); ?>",
//   showConfirmButton: false,
//   timer: 1500
// });


<?php endif; ?>
<?php if(session('error')): ?>
    swal({
            title: "Error!",
            text: "<?php echo e(session('error')); ?>",
            icon: "error",
            button: "OK",
        });
<?php endif; ?>

</script>
