

<?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">Battery List</li>
          </ol>
        </div>



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

          <div class="col-lg-8">
            <h2 class="main-title">Battery 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('battery.create')); ?>" class="btn btn-primary btn-icon-text mb-2 mb-md-0">
              <i class="btn-icon-prepend" data-feather="package"></i>
              Add Battery
            </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 Battery
    </a>
    <a data-id="store" href="javascript:void();" class="unassigned display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Store Battery 
    </a>
    
    <a data-id="service" href="javascript:void();" class="service display-btn btn btn-primary btn-icon-text mb-2 mb-md-0">
        Service Battery 
    </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();
        $('.assigned').addClass('active_btn');
        $('.unassigned').removeClass('active_btn');
        $('.service').removeClass('active_btn');
        
    }
    else if(data== "store"){
        $('#unassigned').show();
        $('#assigned').hide();
        $('#service').hide();
        $('.unassigned').addClass('active_btn');
        $('.assigned').removeClass('active_btn');
        $('.service').removeClass('active_btn');
    }
    else if(data== "service"){
        $('#service').show();
        $('#unassigned').hide();
        $('#assigned').hide();
        $('.unassigned').removeClass('active_btn');
        $('.assigned').removeClass('active_btn');
        $('.service').addClass('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>Battery ID</th>
                        <th>Brand</th>
                        <th>Model</th>
                        <th>Voltage</th>
                        <th>CCA</th>
                        <th>Reserve Capacity</th>
                        <th>Purchase Date</th>
                        <th>Purchase Cost</th>
                        <th>Installation Date</th>
                        <th>Vehicle ID</th>
                        <th>Current Vehicle</th>
                        <th>Mileage at Installation</th>
                        <th>Battery Condition</th>
                        <th>Warranty Provider</th>
                        <th>Warranty Start Date</th>
                        <th>Warranty End Date</th>
                        <th>Notes/Comments</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $batteries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $battery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key+1); ?></td>
                        <td><a style="color: none; text-decoration: none;" href="/battery/details/<?php echo e($battery->id); ?>"><?php echo e($battery->battery_id); ?></a>
                        </td>
                        <td><?php echo e($battery->brand); ?></td>
                        <td><?php echo e($battery->model); ?></td>
                        <td><?php echo e($battery->voltage); ?></td>
                        <td><?php echo e($battery->cca); ?></td>
                        <td><?php echo e($battery->reserve_capacity); ?></td>
                        <td><?php echo e($battery->purchase_date); ?></td>
                        <td><?php echo e($battery->purchase_cost); ?></td>
                        <td><?php echo e($battery->installation_date); ?></td>
                        <td><?php echo e($battery->vehicle_id); ?></td>
                        <td><?php echo e($battery->current_vehicle); ?></td>
                        <td><?php echo e($battery->mileage_at_installation); ?></td>
                        <td><?php echo e($battery->battery_condition); ?></td>
                        <td><?php echo e($battery->warranty_provider); ?></td>
                        <td><?php echo e($battery->warranty_start_date); ?></td>
                        <td><?php echo e($battery->warranty_end_date); ?></td>
                        <td><?php echo e($battery->notes_comments); ?></td>
                        <td><?php echo e($battery->status); ?></td>
                        <td>
                            <button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="/battery/<?php echo e($battery->id); ?>/delete" class="deletebtnpopup">
                                <span style="color:#506fd9;">
                                    <i style="font-size: 20px;" class="ri-delete-bin-6-line"></i>
                                </span>
                            </button>
                            <!-- Add edit button if needed -->
                            <!--<button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="<?php echo e($battery->id); ?>" 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>Battery ID</th>
                        <th>Brand</th>
                        <th>Model</th>
                        <th>Voltage</th>
                        <th>CCA</th>
                        <th>Reserve Capacity</th>
                        <th>Purchase Date</th>
                        <th>Purchase Cost</th>
                        <th>Installation Date</th>
                        <th>Vehicle ID</th>
                        <th>Current Vehicle</th>
                        <th>Mileage at Installation</th>
                        <th>Battery Condition</th>
                        <th>Warranty Provider</th>
                        <th>Warranty Start Date</th>
                        <th>Warranty End Date</th>
                        <th>Notes/Comments</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $batteries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $battery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($battery->battery_id); ?></td>
                        <td><?php echo e($battery->brand); ?></td>
                        <td><?php echo e($battery->model); ?></td>
                        <td><?php echo e($battery->voltage); ?></td>
                        <td><?php echo e($battery->cca); ?></td>
                        <td><?php echo e($battery->reserve_capacity); ?></td>
                        <td><?php echo e($battery->purchase_date); ?></td>
                        <td><?php echo e($battery->purchase_cost); ?></td>
                        <td><?php echo e($battery->installation_date); ?></td>
                        <td><?php echo e($battery->vehicle_id); ?></td>
                        <td><?php echo e($battery->current_vehicle); ?></td>
                        <td><?php echo e($battery->mileage_at_installation); ?></td>
                        <td><?php echo e($battery->battery_condition); ?></td>
                        <td><?php echo e($battery->warranty_provider); ?></td>
                        <td><?php echo e($battery->warranty_start_date); ?></td>
                        <td><?php echo e($battery->warranty_end_date); ?></td>
                        <td><?php echo e($battery->notes_comments); ?></td>
                        <td><?php echo e($battery->status); ?></td>
                        <td>
                            <button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="/battery/<?php echo e($battery->id); ?>/delete" class="deletebtnpopup">
                                <span style="color:#506fd9;">
                                    <i style="font-size: 20px;" class="ri-delete-bin-6-line"></i>
                                </span>
                            </button>
                            <!-- Add edit button if needed -->
                            <!--<button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="<?php echo e($battery->id); ?>" 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="service">
        <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>Battery ID</th>
                        <th>Brand</th>
                        <th>Model</th>
                        <th>Voltage</th>
                        <th>CCA</th>
                        <th>Reserve Capacity</th>
                        <th>Purchase Date</th>
                        <th>Purchase Cost</th>
                        <th>Installation Date</th>
                        <th>Vehicle ID</th>
                        <th>Current Vehicle</th>
                        <th>Mileage at Installation</th>
                        <th>Battery Condition</th>
                        <th>Warranty Provider</th>
                        <th>Warranty Start Date</th>
                        <th>Warranty End Date</th>
                        <th>Notes/Comments</th>
                        <th>Status</th>
                        <th>Action</th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $batteries; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $battery): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        <td><?php echo e($key+1); ?></td>
                        <td><?php echo e($battery->battery_id); ?></td>
                        <td><?php echo e($battery->brand); ?></td>
                        <td><?php echo e($battery->model); ?></td>
                        <td><?php echo e($battery->voltage); ?></td>
                        <td><?php echo e($battery->cca); ?></td>
                        <td><?php echo e($battery->reserve_capacity); ?></td>
                        <td><?php echo e($battery->purchase_date); ?></td>
                        <td><?php echo e($battery->purchase_cost); ?></td>
                        <td><?php echo e($battery->installation_date); ?></td>
                        <td><?php echo e($battery->vehicle_id); ?></td>
                        <td><?php echo e($battery->current_vehicle); ?></td>
                        <td><?php echo e($battery->mileage_at_installation); ?></td>
                        <td><?php echo e($battery->battery_condition); ?></td>
                        <td><?php echo e($battery->warranty_provider); ?></td>
                        <td><?php echo e($battery->warranty_start_date); ?></td>
                        <td><?php echo e($battery->warranty_end_date); ?></td>
                        <td><?php echo e($battery->notes_comments); ?></td>
                        <td><?php echo e($battery->status); ?></td>
                        <td>
                            <button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="/battery/<?php echo e($battery->id); ?>/delete" class="deletebtnpopup">
                                <span style="color:#506fd9;">
                                    <i style="font-size: 20px;" class="ri-delete-bin-6-line"></i>
                                </span>
                            </button>
                            <!-- Add edit button if needed -->
                            <!--<button style="padding:0;background-color: transparent;  background-repeat: no-repeat;  border: none;    cursor: pointer;    overflow: hidden;    outline: none;"
                                value="<?php echo e($battery->id); ?>" 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>




        <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/battery/index.blade.php ENDPATH**/ ?>