<?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">Create Tracking Report  </h3>
            </div>
            <!-- /.box-header -->
            <!-- form start -->
            <form   role="form" method="POST" action="<?php echo e(url('/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">
                <label>Choose Transporters - جهة النقل </label>
                <select class="form-control select2"   style="width: 100%;" name="transporter_id" id="transporter_id" required>
                  <?php foreach( $transporters as $transporter ): ?> 
                  <option value="<?php echo e($transporter->id); ?>"  ><?php echo e($transporter->waste_transporter); ?></option>
                  <?php endforeach; ?>
                </select>
                </div>


                <div class="form-group col-md-6" id="currentfrom" >
                  <label for="exampleInputPassword1">Date from </label>
                  <input type="date" id="tracking_from" name="from" class="form-control"  placeholder="Date from "  min="2024-01-01" required>
                </div>



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


              <div class="form-group">
                <label>Choose Supplier - اسم المورد</label>
                <select class="form-control select2" onchange="showClasses_(this.value)" style="width: 100%;" name="supplier_id" id="supplier_id" required>
                <option  >choose Supplier </option>
                  
                </select>
                </div>

                <div class="form-group">
                <label>Choose Classes - فـئة المخلف </label>
                <select class="form-control select2"  onchange="showGroups(this.value)" style="width: 100%;" name="class_id" id="class_id" required>
                <option  >choose Class </option>
                </select>
                </div>

                <div class="form-group">
                <label>Choose Group - المجموعة </label>
                <select class="form-control select2"  onchange="showClassification(this.value)" style="width: 100%;" name="group_id" id="group_id" required>
                <option  >choose Group </option>
                </select>
                </div>

                <div class="form-group">
                <label>Choose Classifications - التصنيف</label>
                <select class="form-control select2"  onchange="showCustomers(this.value)"  style="width: 100%;" name="classification_id" id="classification_id" required>
                <option  >choose Classifications </option>
                </select>
                </div>


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


              


                <div class="form-group">
                <label>LOGO  </label>
                <select class="form-control select2"   style="width: 100%;" name="logo" id="logo" required>
                  
                  <option value="yes"  > With Logo</option>
                  <option value="no"  >  Without Logo</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('tracking_from').min="2024-01-01";
    document.getElementById('tracking_from').max="";
    document.getElementById('tracking_to').min="2024-01-01";
    document.getElementById('tracking_to').max="";

  }else{

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


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