

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

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

<style>
    .active_btn{
        background-color: #324173!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">Rim List</li>
          </ol>
        </div>



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

          <div class="col-lg-8">
            <h2 class="main-title">Rim 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('rim.create')); ?>" class="btn btn-success btn-icon-text mb-2 mb-md-0">
              <i class="btn-icon-prepend" data-feather="package"></i>
              Import Rim
            </a>
            <a href="/rim/activity" class="btn btn-primary">Activity</a>
            <a href="/usermanual/ImportBattery.pdf" class="btn btn-primary">User Manual</a>
          </div>

        </div>
        
        <br><br>
        
        
                 <div class="row">
  <div class="col-lg-12 margin-tb">
    
    <div class=" mb-3">
        
    <a data-id="store" href="javascript:void();" class="unassigned display-btn btn btn-primary btn-icon-text mb-2 mb-md-0 active_btn">
        Store Rims 
    </a>
        
    <a data-id="assigned" href="javascript:void();" class="assigned display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Assigned Rims
    </a>
    
    
    <a data-id="service" href="javascript:void();" class="service display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Service Rims 
    </a>
    
    <a data-id="scrap" href="javascript:void();" class="scrap display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Scrap Rims 
    </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 style="display:none;" 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>No</th>
                        <th>Rim ID</th>
                        <th>Brand</th>
                        <th>Size</th>
                        <th>Bolt Pattern</th>
                        <th>Wheel Offset</th>
                        <th>Center Bore</th>
                        <th>Spoke Design</th>
                        <th>Color/Finish</th>
                        <th>Installation Date</th>
                        <th>Vehicle ID</th>
                        <th>Rim Condition</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $rims->where('location_status', 'Vehicle'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $rim): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($rim->id); ?></td>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($rim->rim_id); ?></td>
                        <td><?php echo e($rim->brand); ?></td>
                        <td><?php echo e($rim->size); ?></td>
                        <td><?php echo e($rim->bolt_pattern); ?></td>
                        <td><?php echo e($rim->offset); ?></td>
                        <td><?php echo e($rim->center_bore); ?></td>
                        <td><?php echo e($rim->spoke_design); ?></td>
                        <td><?php echo e($rim->color_finish); ?></td>
                        <td><?php echo e($rim->installation_date); ?></td>
                        <td><?php echo e($rim->vehicle_id); ?></td>
                        <td><?php echo e($rim->rim_condition); ?></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div><!-- card-body -->
</div><!-- card -->
     </div>
     
     <div 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>No</th>
                        <th>Rim ID</th>
                        <th>Brand</th>
                        <th>Size</th>
                        <th>Bolt Pattern</th>
                        <th>Wheel Offset</th>
                        <th>Center Bore</th>
                        <th>Spoke Design</th>
                        <th>Color/Finish</th>
                        <th>Rim Condition</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $rims->where('location_status', 'Store'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $rim): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($rim->id); ?></td>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($rim->rim_id); ?></td>
                        <td><?php echo e($rim->brand); ?></td>
                        <td><?php echo e($rim->size); ?></td>
                        <td><?php echo e($rim->bolt_pattern); ?></td>
                        <td><?php echo e($rim->offset); ?></td>
                        <td><?php echo e($rim->center_bore); ?></td>
                        <td><?php echo e($rim->spoke_design); ?></td>
                        <td><?php echo e($rim->color_finish); ?></td>
                        <td><?php echo e($rim->rim_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;">
            <table id="tableGrid3" class="table table-hover">
                <thead class="text-center">
                    <tr>
                        <th>No</th>
                        <th>No</th>
                        <th>Rim ID</th>
                        <th>Brand</th>
                        <th>Size</th>
                        <th>Bolt Pattern</th>
                        <th>Wheel Offset</th>
                        <th>Center Bore</th>
                        <th>Spoke Design</th>
                        <th>Color/Finish</th>
                        <th>Rim Condition</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $rims->where('location_status', 'Service'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $rim): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($rim->id); ?></td>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($rim->rim_id); ?></td>
                        <td><?php echo e($rim->brand); ?></td>
                        <td><?php echo e($rim->size); ?></td>
                        <td><?php echo e($rim->bolt_pattern); ?></td>
                        <td><?php echo e($rim->offset); ?></td>
                        <td><?php echo e($rim->center_bore); ?></td>
                        <td><?php echo e($rim->spoke_design); ?></td>
                        <td><?php echo e($rim->color_finish); ?></td>
                        <td><?php echo e($rim->rim_condition); ?></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
    </div><!-- card-body -->
</div><!-- card -->
     </div>

          <div style="display:none;" id="scrap">
        <div class="card card-example">
    <div class="card-body" style="background-color: white;">
            <table id="tableGrid4" class="table table-hover">
                <thead class="text-center">
                    <tr>
                        <th>No</th>
                        <th>No</th>
                        <th>Rim ID</th>
                        <th>Brand</th>
                        <th>Size</th>
                        <th>Bolt Pattern</th>
                        <th>Wheel Offset</th>
                        <th>Center Bore</th>
                        <th>Spoke Design</th>
                        <th>Color/Finish</th>
                        <th>Rim Condition</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $rims->where('location_status', 'Scrap'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $rim): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($rim->id); ?></td>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($rim->rim_id); ?></td>
                        <td><?php echo e($rim->brand); ?></td>
                        <td><?php echo e($rim->size); ?></td>
                        <td><?php echo e($rim->bolt_pattern); ?></td>
                        <td><?php echo e($rim->offset); ?></td>
                        <td><?php echo e($rim->center_bore); ?></td>
                        <td><?php echo e($rim->spoke_design); ?></td>
                        <td><?php echo e($rim->color_finish); ?></td>
                        <td><?php echo e($rim->rim_condition); ?></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
    </div><!-- card-body -->
</div><!-- card -->
     </div>




        <br><br><br>

        

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


<script type="text/javascript">
$(document).ready(function() {
    $('.pagi-btn').click(function() {

  $('.gridjs .gridjs-tr th:first-child').hide();
  $('.gridjs .gridjs-tr td:first-child').hide();

      
     $('.gridjs .gridjs-tr').click(function() {
         var firstTd = $(this).find('td:first');
         var id= firstTd.text();
         window.location.href = '/rim/details/' + id;
     });

    }); 
    
   setTimeout(function(){
     
     $('.gridjs .gridjs-tr th:first-child').hide();
     $('.gridjs .gridjs-tr td:first-child').hide();

     $('.gridjs .gridjs-tr').click(function() {
        var firstTd = $(this).find('td:first');
        var id= firstTd.text();
        window.location.href = '/rim/details/' + id;
    });
    
      
  }, 200);

}); 
</script>

     
    <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/megamarket/public_html/tms/resources/views/rim/index.blade.php ENDPATH**/ ?>