<?php $__env->startSection('content'); ?>

<?php
 $tireItems=[];
 $tires=[];
?>

<style>
    .active_btn{
        background-color: #1c3fb7!important;
    }
</style>

<div class="main-mobile-header doc-mobile-header">
      <a id="menuLink" href="#" class="menu-link"><i class="ri-menu-line"></i></a>
    </div>

   

    



     <div class="main main-app p-3 p-lg-4">
     	

        <div class="mb-4">
          <ol class="breadcrumb fs-sm mb-1">
            <li class="breadcrumb-item"><a href="#">Dashboard</a></li>
            <li class="breadcrumb-item active" aria-current="page">Tyre List</li>
          </ol>
        </div>



      <div class="">
        <div class="row">

          <div class="col-lg-8">
            <h2 class="main-title">Tyre List</h2>
            
          </div>
          <div style="text-align: right;" class="col-lg-4 text-right">
           <!--  <button type="button" class="btn btn-primary">Add Employee</button> -->
            <!-- <a href="/form" class="btn btn-primary">Create Hotel</a> -->
            <a type="button" href="<?php echo e(route('tyre.create')); ?>" class="btn btn-primary btn-icon-text mb-2 mb-md-0">
              <i class="btn-icon-prepend" data-feather="package"></i>
              Add Tyre
            </a>
          </div>

        </div>
        
        <br><br>
        
        
                 <div class="row">
  <div class="col-lg-12 margin-tb">
    
    <div class=" mb-3">
      <a data-id="assigned" href="javascript:void();" class="assigned display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Assigned Tyres
    </a>
    <a data-id="store" href="javascript:void();" class="unassigned display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Store Tyres 
    </a>
    
    <a data-id="service" href="javascript:void();" class="service display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Service Tyres 
    </a>
    
    <a data-id="scrap" href="javascript:void();" class="scrap display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Scrap Tyres 
    </a>
    
    </div>
  </div>
</div>

<script>

$(document).ready(function() {
  $('.display-btn').click(function() {
    const data = $(this).data('id');
    console.log(data);
    // do something with attributeValue
    if(data== "assigned"){
        $('#assigned').show();
        $('#unassigned').hide();
        $('#service').hide();
        $('#scrap').hide();
        $('.assigned').addClass('active_btn');
        $('.unassigned').removeClass('active_btn');
        $('.service').removeClass('active_btn');
        $('.scrap').removeClass('active_btn');
        
    }
    else if(data== "store"){
        $('#unassigned').show();
        $('#assigned').hide();
        $('#service').hide();
        $('#scrap').hide();
        $('.unassigned').addClass('active_btn');
        $('.assigned').removeClass('active_btn');
        $('.service').removeClass('active_btn');
        $('.scrap').removeClass('active_btn');
    }
    else if(data== "service"){
        $('#service').show();
        $('#unassigned').hide();
        $('#assigned').hide();
        $('#scrap').hide();
        $('.unassigned').removeClass('active_btn');
        $('.assigned').removeClass('active_btn');
        $('.service').addClass('active_btn');
        $('.scrap').removeClass('active_btn');
    }
    else if(data== "scrap"){
        $('#service').hide();
        $('#unassigned').hide();
        $('#assigned').hide();
        $('#scrap').show();
        $('.unassigned').removeClass('active_btn');
        $('.assigned').removeClass('active_btn');
        $('.scrap').addClass('active_btn');
        $('.service').removeClass('active_btn');
    }
    
  });
});

   
 </script>


        <hr class="main-separator">        
    


<!--         <h5 id="section9" class="main-subtitle">Basic Example</h5>
 -->        <!-- <p>In this examples, we load the data from an existing HTML table.</p> -->


     <div id="assigned">
        <div class="card card-example">
    <div class="card-body" style="background-color: white;">
        <div class="table-responsive">
            <table id="tableGrid1" class="table table-hover">
                <thead class="text-center">
                    <tr>
                        <th>No</th>
                        <th>Brand</th>
                        <th>Size</th>
                        <th>Pressure</th>
                        <th>Temperature</th>
                        <th>Tread Depth</th>
                        <th>Position</th>
                        <th>Installation Date</th>
                        <th>Manufacture Date</th>
                        <th>Condition</th>
                        <!--<th>Action</th>-->
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $tyre; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $tire): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key + 1); ?></td>
                        <td><a style="color: none; text-decoration: none;" href="/tyre/details/<?php echo e($tire->id); ?>"><?php echo e($tire->brand); ?></a></td>
                        <td><?php echo e($tire->size); ?></td>
                        <td><?php echo e($tire->pressure); ?></td>
                        <td><?php echo e($tire->temperature); ?></td>
                        <td><?php echo e($tire->tread_depth); ?></td>
                        <td><?php echo e($tire->position); ?></td>
                        <td><?php echo e($tire->installation_date); ?></td>
                        <td><?php echo e($tire->manufacture_date); ?></td>
                        <td><?php echo e($tire->condition); ?></td>
                        <!--<td>-->
                            <!-- Add action buttons for delete and edit -->
                        <!--    <button style="padding: 0; background-color: transparent; background-repeat: no-repeat; border: none; cursor: pointer; overflow: hidden; outline: none;" value="/tire/<?php echo e($tire->id); ?>/delete" class="deletebtnpopup"><span style="color: #506fd9;"><i style="font-size: 20px;" class="ri-delete-bin-6-line"></i></span></button>-->
                        <!--    <button style="padding: 0; background-color: transparent; background-repeat: no-repeat; border: none; cursor: pointer; overflow: hidden; outline: none;" value="/tire/<?php echo e($tire->id); ?>/edit" class="editbtn"><span style="color: #506fd9;"><i style="font-size: 20px;" class="ri-edit-box-line"></i></span></button>-->
                        <!--</td>-->
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div><!-- card-body -->
</div><!-- card -->
     </div>
     
     <div style="display:none;" id="unassigned">
        <div class="card card-example">
    <div class="card-body" style="background-color: white;">
        <div class="table-responsive">
            <table id="tableGrid2" class="table table-hover">
                <thead class="text-center">
                    <tr>
                        <th>No</th>
                        <th>Brand</th>
                        <th>Manufacture Date</th>
                        <th>Condition</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $tireItems; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $tire): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key + 1); ?></td>
                        <td><?php echo e($tire->brand); ?></td>
                        <td><?php echo e($tire->manufacture_date); ?></td>
                        <td><?php echo e($tire->condition); ?></td>
                        
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div><!-- card-body -->
</div><!-- card -->
     </div>
     
          <div style="display:none;" id="service">
        <div class="card card-example">
    <div class="card-body" style="background-color: white;">
        <div class="table-responsive">
            <table id="tableGrid3" class="table table-hover">
                <thead class="text-center">
                    <tr>
                        <th>No</th>
                        <th>Tire ID</th>
                        <th>Brand</th>
                        <th>Model</th>
                        <th>Size</th>
                        <th>Current Mileage</th>
                        <th>Tire Condition</th>
                        <th>Inflation Pressure</th>
                        <th>Temperature</th>
                        <th>Load Rating</th>
                        <th>Speed Rating</th>
                        <th>Status</th>
                        <th>Identity</th>
                        <th>Load Pressure Information</th>
                        <th>Indicated Exterior</th>
                        <th>Type of Construction</th>
                        <th>Tyre Sections Width (mm)</th>
                        <th>Section Height to Section Width Ratio</th>
                        <th>Rim Diameter (inches)</th>
                        <th>Load Capacity Index</th>
                        <th>Speed Rating</th>
                        <th>Tyre Type</th>
                        <th>Remarks</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $tires; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $tire): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key + 1); ?></td>
                        <td><?php echo e($tire->tire_id); ?></td>
                        <td><?php echo e($tire->brand); ?></td>
                        <td><?php echo e($tire->model); ?></td>
                        <td><?php echo e($tire->size); ?></td>
                        
                        <td><?php echo e($tire->current_mileage); ?></td>
                        <td><?php echo e($tire->tire_condition); ?></td>
                        <td><?php echo e($tire->inflation_pressure); ?></td>
                        <td><?php echo e($tire->temperature); ?></td>
                        <td><?php echo e($tire->load_rating); ?></td>
                        <td><?php echo e($tire->speed_rating); ?></td>
                       
                        <td><?php echo e($tire->status); ?></td>
                        
                        <td><?php echo e($tire->identity); ?></td>
                        <td><?php echo e($tire->load_pressure_information); ?></td>
                        <td><?php echo e($tire->indicated_exterior); ?></td>
                        <td><?php echo e($tire->type_of_construction); ?></td>
                        <td><?php echo e($tire->tyre_sections_width_mm); ?></td>
                        <td><?php echo e($tire->section_height_to_section_width_ratio); ?></td>
                        <td><?php echo e($tire->rim_diameter_inches); ?></td>
                        <td><?php echo e($tire->load_capacity_index); ?></td>
                        <td><?php echo e($tire->speed_rating); ?></td>
                        <td><?php echo e($tire->tyre_type); ?></td>
                        <td><?php echo e($tire->remarks); ?></td>
                        
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div><!-- card-body -->
</div><!-- card -->
     </div>




        <br><br><br>

        

      </div><!-- container -->

     
    <style>
    tbody tr:hover {background-color: #F5F5F5;}
    .card-example>.card-body::before {
    content: ""
    }
    </style>

    <script type="text/javascript">
      $("#tableGrid1").Grid({
        className: {
          table: 'table table-bordered mb-0'
        },
        search: true
      });
    </script>
     
     <style>
    tbody tr:hover {background-color: #F5F5F5;}
    .card-example>.card-body::before {
    content: ""
    }
    .gridjs-head{
      display: flex;
    }
    .gridjs-search{
      width: 50%;
    }
    .filter{
      margin-left: auto;
      width: 200px;
    }
    </style>

   <script>
$(document).ready(function() {
  setTimeout(function(){
    $('.active_status .gridjs-head').append('<div class="filter mb-2"><div class=" sel"><select id="fliterdrop" class="form-select"  onchange="getval(this);"><option value="Active" selected>Active</option><option value="Inactive">Inactive</option></select></div></div>');
    $('.inactive_status .gridjs-head').append('<div class="filter mb-2"><div class=" sel"><select id="fliterdrop2" class="form-select"  onchange="getval(this);"><option value="Active">Active</option><option value="Inactive" selected>Inactive</option></select></div></div>');
  }, 200);
});
function getval(sel){
  var value = sel.value;
  console.log(value);
  $('.active_status .gridjs-head .filter').html('');
  $('.active_status .gridjs-head .filter').append('<div class=" sel"><select id="fliterdrop" class="form-select"  onchange="getval(this);"><option value="Active" selected>Active</option><option value="Inactive">Inactive</option></select></div>');
  $('.inactive_status .gridjs-head .filter').html('');
  $('.inactive_status .gridjs-head .filter').append('<div class=" sel"><select id="fliterdrop2" class="form-select"  onchange="getval(this);"><option value="Active">Active</option><option value="Inactive" selected>Inactive</option></select></div>');
    if (value=='Active') {
    $('.active_status').show();
    $('.inactive_status').hide();
    }
    else if (value=='Inactive') {
    $('.inactive_status').show();
    $('.active_status').hide();
    }
    // console.log($("#fliterdrop").val);
    // $(".filter").html("");
}
// $('.filter').change(function() {
//   console.log("here is my on change");
//     var value = $(this).val();
//     if (value=='Active') {
//     $('.active_status').show();
//     $('.inactive_status').hide();
//     }
//     else if (value=='Inactive') {
//     $('.inactive_status').show();
//     $('.active_status').hide();
//     }
// });
</script>


    <script type="text/javascript">

      $("#tableGrid1").Grid({
  className: {
    table: 'table table-bordered mb-0'
  },
  search: true
});

 //       $('#filter').change(function() {
 //   console.log('Button clicked!');
 //   var value = $(this).val();
 //   alert(value)

 // });


    </script>


<?php $__env->stopSection(); ?>
<?php echo $__env->make('layout.master', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/u842563099/domains/codesquarry.online/public_html/tms/resources/views/tyre/index.blade.php ENDPATH**/ ?>