 <?php $__env->startSection('content'); ?>
 <?php Fun::lang() ?>
 <div class="title-page">
   <div class="page-bar">
     <ul class="page-breadcrumb">
       <li><a href="#"><i class="fa fa-dashboard"></i> Dashboard</a></li>
       <li><a href="#">Reports</a></li>
       <li><a href="#">Report Construction</a></li>
       <li><a href="#">Report Assign Product To Warehouse</a></li>
     </ul>
   </div>
 </div>
 <div class="page">
   <div class="top-content">
     <div class="row">
       <div class="col-sm-12 col-xs-12">
         <div class="title-add">
           <div class="pull-left">
             <h3>Report Assign Product To Warehouse</h3>
           </div>
         </div>

       </div>
     </div>
   </div>
   <form action="<?php echo e(route('construction-report.AssignWarehouseReport')); ?>" method="POST">
     <?php echo csrf_field(); ?>
     <div class="form-search">
       <div class="row">
         <div class="col-xs-12 col-sm-4 col-md-4 ">
           <div class="form-group">
             <strong>Form Date</strong>
             <?php echo Form::text('start_date', null, array('placeholder' => 'Start Date','class' => 'form-control date_picker start_date','autocomplete' => 'off')); ?>

           </div>
         </div>
         <div class="col-xs-12 col-sm-4 col-md-4 ">
           <div class="form-group">
             <strong>To Date</strong>
             <?php echo Form::text('end_date', null, array('placeholder' => 'End Date','class' => 'form-control date_picker end_date','autocomplete' => 'off')); ?>

           </div>
         </div>
         <div class="col-xs-12 col-sm-4 col-md-4 ">
            <div class="form-group">
              <strong>BOQ</strong>
              <?php echo Form::select('boqs', $boqs, null, ['class' => 'form-control select2 boqs']); ?>

            </div>
          </div>
         <div class="col-xs-12 col-sm-4 col-md-4 ">
           <div class="form-group">
             <strong>Project</strong>
             <?php echo Form::select('projects', $projects, null, ['class' => 'form-control select2 projects']); ?>

           </div>
         </div>
         <div class="col-xs-12 col-sm-4 col-md-4 ">
           <div class="form-group">
             <strong>Supplier</strong>
             <?php echo Form::select('suppliers',$suppliers, null, ['class' => 'form-control select2 suppliers']); ?>

           </div>
         </div>
         <div class="col-xs-12 col-sm-4 col-md-4 ">
           <div class="form-group">
             <strong>Products</strong>
             <?php echo Form::select('products',  $products, null, ['class' => 'form-control select2 products']); ?>

           </div>
         </div>
         <div class="col-xs-12 col-sm-12 col-md-12 text-right">
           <button type="button" class="button_primary btn-sm search" onclick="searching()"><span class="fa fa-search"> Search</span></button>&nbsp
           <button type="submit" class="button_primary btn-sm search"><span class="fa fa-print"> Print</span></button>
         </div>
       </div>
     </div>
     <?php echo Form::close(); ?>

     <div class="box-body table-responsive">
       <table id="purchase-order-datatable" class="table table-striped table-bordered table-hover nowrap" width="100%">
         <thead>
           <tr>
            <th>No</th>
              <th>Date</th>
              <th>BOQ</th>
              <th>Project Name</th>
              <th>Supplier Name</th>
              <th>Supplier Phone</th>
              <th>Request By</th>
              <th>Product Name</th>
              <th>Category</th>
              <th>Sub Category</th>
              <th>Qty</th>
              <th>Qty add to warehouse</th>
              <th>Balance</th>
              <th>Unit Name</th>
           </tr>
         </thead>
         <tbody class="tbody"></tbody>
       </table>
     </div>
 </div>
 <?php $__env->stopSection(); ?> <?php $__env->startSection('js'); ?>
 <script type="text/javascript">
     $(document).ready(function() {
         $('#main-spinner').show();
           $('#purchase-order-datatable').DataTable({
             ordering: false,
             "scrollY":"600px",
            "scrollCollapse": true,
            "scrollX": true,
             "searching":false,
             "serverSide":true,
             lengthMenu: [[20, 30, 50, 100,200,500,1000], [20, 30, 50, 100,200,500,1000]],
             ajax: {
               url:"<?php echo e(route('construction-report.AssignWarehouseReport')); ?>",
               type:"GET",
               data:function(d){
                  d.start_date = $(".start_date").val();
                  d.end_date = $(".end_date").val();
                  d.boqs = $(".boqs").val();
                  d.projects = $(".projects").val();
                  d.suppliers = $(".suppliers").val();
                  d.products = $(".products").val();
               }
             },
             columns: [
                  {
                     data: 'DT_RowIndex'
                 },
                 {
                     data: 'date'
                 },
                 {
                     data: 'boq_title'
                 },
                 {
                     data: 'project_name'
                 },
                 {
                     data: 'supplier_name'
                 },
                 {
                     data: 'supplier_phone'
                 },
                 {
                     data: 'request_by',
                     width: '5px'
                 },
                 {
                    data:'product_name'
                 },
                 
                 {
                    data: 'category_name'
                 },
                 {
                     data: 'sub_category'
                 },
                 {
                     data: 'product_qty'
                 },
                {
                    data : 'qty_added_to_stock'
                },
                {
                    data : 'balance'
                },
                {
                     data: 'unit_name'
                 }
             ],

             "initComplete": function(settings, json) {
                 $('#main-spinner').hide();
             },
         });
     });
     function searching(){
      $('#purchase-order-datatable').DataTable().draw(true);
     }
 </script>
 <?php $__env->stopSection(); ?>
<?php echo $__env->make('adminlte::page', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>