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



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



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

          <div class="col-lg-8">
            <h2 class="main-title">Vehicle 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 href="/usermanual/AddVehicle.pdf" class="btn btn-primary">User Manual</a>
            <a type="button" href="<?php echo e(route('vehicle.create')); ?>" class="btn btn-primary btn-icon-text mb-2 mb-md-0">
              <i class="btn-icon-prepend" data-feather="package"></i>
              Add Vehicle
            </a>
          </div>

        </div>

        <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 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>Vehicle Id</th>
                        <th>No</th>
                        <th>Vehicle Id</th>
                        <th>Make</th>
                        <th>Model</th>
                        <th>Vehicle Type</th>
                        <th>Year</th>
                        <th>Registration Number</th>
                        <th>VIN Number</th>
                        
                        <!--<th>Documents</th>-->
                        <!--<th>QR Code</th>-->
                        <!--<th>Action</th>-->
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $vehicles; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $vehicle): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                     <tr data-url="/abc/<?php echo e($vehicle->id); ?>" class="<?php echo e($vehicle->id); ?>">
                        <td><?php echo e($vehicle->id); ?></td>

                        <td><?php echo e($key + 1); ?></td>
                        <td><?php echo e($vehicle->vehicle_id); ?></td>
                        <td>
                         <?php echo e($vehicle->make); ?>

                        </td>
                        <td><?php echo e($vehicle->model); ?></td>
                        <td><?php echo e($vehicle->vehicle_type); ?></td>
                        <td><?php echo e($vehicle->year); ?></td>
                        <td><?php echo e($vehicle->registration_number); ?></td>
                        <td><?php echo e($vehicle->vin_number); ?></td>
                        <!--<td>-->
                        <!--  <a href="vehicle/documents/<?php echo e($vehicle->id); ?>">Documents</a>-->
                            
                        <!--</td>-->
                        <!--<td>-->
                        <!--  <a href="vehicle/qr/download/<?php echo e($vehicle->id); ?>">Download</a>-->
                            
                        <!--</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="/vehicle/<?php echo e($vehicle->id); ?>/delete" class="deletebtnpopup"><span style="color: #506fd9;"><i style="font-size: 20px;" class="ri-delete-bin-6-line"></i></span></button>-->
                        <!--    <a style="padding: 0; background-color: transparent; background-repeat: no-repeat; border: none; cursor: pointer; overflow: hidden; outline: none;" href="/vehicles/<?php echo e($vehicle->id); ?>/edit" class="editbtn"><span style="color: #506fd9;"><i style="font-size: 20px;" class="ri-edit-box-line"></i></span></a>-->
                        <!--</td>-->
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>
        </div><!-- table-responsive -->
    </div><!-- card-body -->
</div><!-- card -->



        <br><br><br>

        

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

<script>
   
</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 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 = '/vehicles/image/' + 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 = '/vehicles/image/' + id;
    });
    
      
  }, 200);

}); 
</script>

   <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 E:\Download\Chrome\tms\resources\views/vehicle/index.blade.php ENDPATH**/ ?>