<div class="container-fluid mt-3 mb-3 bg-white">
    <div class="row">
        <div class="col-sm-12">
            <ul class="breadcrumb">
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Welcome">Home</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Transport">Transport</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Transport/add_new_vehicle">Add New Vehicle</a></li>
                <li class="breadcrumb-item"><a href="<?php echo base_url();?>Transport/vehicles">Vehicles</a></li>
            </ul>  
        </div>
        
        <div class="col-sm-12">
            <ul class="nav nav-tabs tab-item-1">
                <li class="nav-item">
                    <a class="nav-link active" href="#">Vehicles</a>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="<?php echo base_url();?>Transport/add_new_vehicle">Add New Vehicle</a>
                </li>
            </ul>
            
            
            <div class="table-responsive">
                <table class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Vehicle Number</th>
                            <th>Vehicle Model</th>
                            <th>Componey Name</th>
                            <th>No of Seats</th>
                            <th>Driver Name</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php
                        $table='transport_vehicle';
                        $count=0;
                        $get_all_vehicles=$this->TransportModel->get_data($table);
                        if($get_all_vehicles){
                            foreach($get_all_vehicles as $vehicles){
                                $count=$count + 1;
                        ?>                                
                        <tr>
                            <td><?php echo $count;?></td>
                            <td><?php echo $vehicles['vehicle_number'];?></td>
                            <td><?php echo $vehicles['vehicle_model'];?></td>
                            <td><?php echo $vehicles['vehicle_componey'];?></td>
                            <td><?php echo $vehicles['number_of_seats'];?></td>
                            <td>
                                <?php
                                $veh_drivers_table='vehicle_driver';
                                $driver_on_duty=$this->TransportModel->get_item_data($vehicles['driver_on_duty'],$veh_drivers_table);
                                if($driver_on_duty){
                                    foreach($driver_on_duty as $driver){
                                        echo $driver['driver_name'];
                                    }
                                }
                                ?>
                            </td>
                            <td>
                                
                                <form method="post" action="<?php echo base_url();?>Transport/add_new_vehicle">
                                <button class="btn btn-sm btn-warning mt-1" name="edit" value="<?php echo $vehicles['id'];?>" type="submit">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-pencil-square" viewBox="0 0 16 16">
                                        <path d="M15.502 1.94a.5.5 0 0 1 0 .706L14.459 3.69l-2-2L13.502.646a.5.5 0 0 1 .707 0l1.293 1.293zm-1.75 2.456-2-2L4.939 9.21a.5.5 0 0 0-.121.196l-.805 2.414a.25.25 0 0 0 .316.316l2.414-.805a.5.5 0 0 0 .196-.12l6.813-6.814z"/>
                                        <path fill-rule="evenodd" d="M1 13.5A1.5 1.5 0 0 0 2.5 15h11a1.5 1.5 0 0 0 1.5-1.5v-6a.5.5 0 0 0-1 0v6a.5.5 0 0 1-.5.5h-11a.5.5 0 0 1-.5-.5v-11a.5.5 0 0 1 .5-.5H9a.5.5 0 0 0 0-1H2.5A1.5 1.5 0 0 0 1 2.5v11z"/>
                                    </svg>
                                </button>
                                </form>
                                <button class="btn btn-sm btn-info mt-1">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-eye-fill" viewBox="0 0 16 16">
                                        <path d="M10.5 8a2.5 2.5 0 1 1-5 0 2.5 2.5 0 0 1 5 0z"/>
                                        <path d="M0 8s3-5.5 8-5.5S16 8 16 8s-3 5.5-8 5.5S0 8 0 8zm8 3.5a3.5 3.5 0 1 0 0-7 3.5 3.5 0 0 0 0 7z"/>
                                    </svg>
                                </button>
                                <button class="btn btn-sm btn-danger mt-1">
                                    <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-trash2-fill" viewBox="0 0 16 16">
                                        <path d="M2.037 3.225A.703.703 0 0 1 2 3c0-1.105 2.686-2 6-2s6 .895 6 2a.702.702 0 0 1-.037.225l-1.684 10.104A2 2 0 0 1 10.305 15H5.694a2 2 0 0 1-1.973-1.671L2.037 3.225zm9.89-.69C10.966 2.214 9.578 2 8 2c-1.58 0-2.968.215-3.926.534-.477.16-.795.327-.975.466.18.14.498.307.975.466C5.032 3.786 6.42 4 8 4s2.967-.215 3.926-.534c.477-.16.795-.327.975-.466-.18-.14-.498-.307-.975-.466z"/>
                                    </svg>
                                </button>
                                
                            </td>
                        </tr>
                        <?php
                            }
                        }
                        ?>

                    </tbody>
                </table>
            </div>
        </div>
        <div class="col-sm-12 pt-3 pb-3">
            <?php $this->load->view('erp/transport/quick-links');?>
        </div>
        
    </div>
</div>