<?php $__env->startSection('content'); ?>
<?php if(session()->has('message')): ?>
<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
<div class="col-md-4 alert alert-success alert-dismissible" style="font-size:18px;font-weight:bold;width:400px;margin-left:15px">
                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
                <?php echo session('message'); ?>

              </div>
              </div> 
<?php endif; ?>

<div class="row">
        <!-- left column -->
        <div class="col-md-2"></div>
        <div class="col-md-8">
          <!-- general form elements -->
          <div class="box box-primary">
            <div class="box-header with-border">
              <h3 class="box-title">Recycler Report Create  </h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form   role="form" method="POST" action="<?php echo e(url('/recycler_report/create')); ?>">
                        <?php echo e(csrf_field()); ?>

              <div class="box-body">
                
                
                 <div class="form-group">
                <label> choose year </label>

                <select class="form-control select2"   style="width: 100%;" name="year_type" id="year_type" onchange="select_year()" required>
                  <option value="current"  > current year</option>
                  <option value="last"  > Last years</option>
                </select>
                
              </div>
                
              <div class="form-group col-md-6" >
                  <label for="exampleInputPassword1">Date from  </label>
                  <input type="date" id="recycler_report_from" name="from" class="form-control"  min="2024-01-01" placeholder="Date from " required>
                </div>



                <div class="form-group col-md-6">
                  <label for="exampleInputPassword1">Date to</label>
                  <input type="date" id="recycler_report_to" onchange="recycler_showCustomers_()" name="to" class="form-control"  min="2024-01-01" placeholder="Date to " required>
                </div>


              <div class="form-group">
                <label>Choose Customer - اختيار شركة التدوير </label>
                <select class="form-control select2"   onchange="showSuppliers_()" style="width: 100%;" name="customer_id" id="recycler_customer_id" required>
                  
                </select>
                </div>


                <div class="form-group">
                <label>Choose Supplier - اختيار المورد </label>
                <select class="form-control select2" multiple="multiple"  onchange="showWastes_()" style="width: 100%;" name="resycler_suppliers[]" id="resycler_supplier_id" required>
                <option  >choose suppliers </option>
                </select>
                </div>


                <div class="form-group">
                <label>Choose Wastes - اختيار الصنف </label>
                <select class="form-control select2" multiple="multiple"   style="width: 100%;" name="resycler_wastes[]" id="resycler_waste_id" required>
                <option  >choose waste </option>
                </select>
                </div>


              </div>
              <!-- /.box-body -->

              <div class="box-footer">
                <button type="submit" class="btn btn-warning">Create</button>
              </div>
            </form>

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

<script>

  
function select_year() {
  var year_type =document.getElementById("year_type").value;
  
  if ( year_type == "current" ){
    document.getElementById('recycler_report_from').min="2024-01-01";
    document.getElementById('recycler_report_from').max="";
    document.getElementById('recycler_report_to').min="2024-01-01";
    document.getElementById('recycler_report_to').max="";

  }else{

    document.getElementById('recycler_report_from').min="";
    document.getElementById('recycler_report_from').max="2024-01-01";
    document.getElementById('recycler_report_to').min="";
    document.getElementById('recycler_report_to').max="2024-01-01";
    
  }
}
</script>

<?php $__env->stopSection(); ?>
<?php echo $__env->make('layouts.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>