<table id="myTable" class="table table-bordered table-striped">
    <thead>
        <tr>
            <th><input type="checkbox" class="selectall">All</th>
            <th>S.No</th>
            <th>Vehicle Model</th>
            <th>Vehicle Name</th>
            <th>Vehicle Number</th>
            <th>Vehicle Type</th>
<!--            <th>State</th>-->
            <th>City</th>
            <th>Driver</th>
            <th>Status</th>
            <th>Action</th>
        </tr>
    </thead>
    <tbody>
        <?php 
       //echo '<pre>';print_r($vehicleListing);die();
        if (count($vehicleListing)>0) {
            $i = 1;
            foreach ($vehicleListing as $listing) {
                $vehicle_master_id = $listing['vehicle_master_id'];
                $driver_id         = $listing['user_id'];
                $mapping_id         = isset($listing['mapping_id'])?$listing['mapping_id']:0;
                $status=    ($listing['mapping_id'] == '' ? 'Unmaped' : 'maped');
                ?>
                <tr>
                    <td class="center"><label class="pos-rel">
                        <input type="checkbox" rel="<?php echo $listing['mapping_id']; ?>" name="checkbox-<?php echo $listing['mapping_id']?>" id="checkbox-<?php echo $listing['mapping_id']?>" class="ace list-checkbox check" />
                            <span class="lbl"></span> </label>
                    </td>
                    <td><?php echo $i; ?></td>
                    <td><?php echo $listing['model']; ?></td>
                    <td><?php echo $listing['vehicle_model_name']; ?></td>
                    <td><?php echo $listing['vehicle_no']; ?></td>
                    <td><?php echo $listing['vehicle_type_name']; ?></td>
<!--                    <td><?php //echo $listing['state_name']; ?></td>-->
                    <td><?php echo $listing['driver_city']; ?></td>
                    <!--<td class="edit-Mapped" id="edit-<?php echo $listing['user_id']; ?>" value="<?php echo ($listing['mapping_id'] == '' ? 'Un-Mapped' : 'Mapped'); ?>" ><?php echo $listing['driver_name']; ?></td>
                    <td class="map-maped" id="insert-<?php echo $listing['user_id']; ?>" value="<?php echo ($listing['mapping_id'] == '' ? 'Un-Mapped' : 'Mapped'); ?>">
                        <?php echo ($listing['mapping_id'] == '' ? 'Un-Mapped' : 'Mapped'); ?>
                        <input type="text" name="maped_status" value="<?php echo ($listing['mapping_id'] == '' ? 'Un-Mapped' : 'Mapped'); ?>" id="insert-<?php echo $listing['user_id']; ?>" >
                    </td>-->

                    <td><?php echo $listing['driver_name']; ?><br/><?php echo $listing['driver_mobile']; ?></td>
                    
                    <!--<td class="edit-maped" id="<?php echo $i; ?>"  value="<?php echo $status; ?>" >

                                <?php //if(isset($listing['user_id'])){ ?>

                                <span href="#" class="map_driver map_text pointer edit-<?php echo $i; ?>"><?php echo $listing['driver_name']; ?> </span>

                                <div class="col-sm-12 no-padding driver_map <?php if($mapping_id>0){?> display-none <?php }?> insert-<?php echo $i; ?>">

                                    <select class="form-control widthpersent100 driverlist" onchange="mappeddriver(this.value,<?php echo $mapping_id; ?>,<?php echo $vehicle_master_id; ?>);">

                                        <option value="0">--Select Driver ---</option> 
                                        <?php foreach ($vendorDriverListing as $value) { ?>
                                            <option value="<?php echo $value['user_id']; ?>" <?php if ($value['user_id'] == $driver_id) { ?> selected  <?php } ?>><?php echo $value['name']; ?> (<?php echo $value['email']; ?>,<?php echo isset($value['mobile']) ? $value['mobile'] : ''; ?>)</option>
                                        <?php } ?>
                                    </select>

                                </div>

                                <?php //}  ?>
                            </td>-->
                    <td class="map-maped" id="insert-<?php echo $listing['user_id']; ?>" value="<?php echo $status; ?>">
                        <?php echo $status; ?>
                        <input type="hidden" name="maped_status" value="<?php echo $status; ?>" id="insert-<?php echo $listing['user_id']; ?>" >
                    </td>

                    <td>
                    <div class="hidden-sm hidden-xs action-buttons">
                        <a class="red " href="javascript:void(0)" onclick="mapDriver('<?php echo $vehicle_master_id;?>','<?php echo $mapping_id;?>')"> <i class="ace-icon fa fa-edit bigger-130"></i> </a>
                                <a class="red" href="<?php echo $this->url('vehicle-details', ['action'=>'deleteVehicleMap', 'id'=>
                                $listing['vehicle_master_id']]); ?>" onclick="return confirm('are you sure you want to delete');">
                                    <i class="ace-icon fa fa-trash-o bigger-130"></i>
                                </a>
                    </div>
                    </td>
                </tr>
                <?php $i++;
            }
        } else { ?>
            <tr></tr>
<?php } ?>
    </tbody>
</table>
