<?php 
//$arraySingle = call_user_func_array('array_merge', $vehicleList);
//$vehicle_type_FilterArray = array_column($arraySingle,'vehicle_type','vehicle_type_id');
//$this->vehicle_type = $vehicle_type_FilterArray;
//echo '<pre>';print_r($filter_Arr['vehicle_model']);die();
$vehicle_type = [];
$vendor_data= [];
$vehicle_model_data = [];
$vehicle_color_data = [];
$vehicle_name = [];
$rating_filter = [];
$fuel_type=[];
$amenities = [];
if(isset($filter_Arr) && !empty($filter_Arr['vehicle_type'])){
   $vehicle_type = $filter_Arr['vehicle_type'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['vendor_detail'])){
   $vendor_data = $filter_Arr['vendor_detail'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['vehicle_model'])){
   $vehicle_model_data = $filter_Arr['vehicle_model'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['vehicle_color'])){
   $vehicle_color_data = $filter_Arr['vehicle_color'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['vehicle_name_filter'])){
   $vehicle_name = $filter_Arr['vehicle_name_filter'];  
}
if(isset($filter_Arr) && !empty($filter_Arr['count_vehicle_type'])){
   $count_vehicle_type = $filter_Arr['count_vehicle_type'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['rating_filter'])){
   $rating_filter = $filter_Arr['rating_filter'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['fuel_type'])){
   $fuel_type = $filter_Arr['fuel_type'];   
}
if(isset($filter_Arr) && !empty($filter_Arr['amenities_filter'])){
   $amenities = $filter_Arr['amenities_filter'];   
}

?>
<div class="top-destinations-grids margintop0">
    <div class="top-destinations-bottom padding_margin0">
        <div class="td-grids">
            <div class="summary">
                <div class="left-div-form border_bottom pointer" data-toggle="collapse" data-parent="#accordion" href="#collapsefilter">
                    <h4>Filters by</h4>
                </div>
                <div id="collapsefilter" class="panel-collapse collapse in">
                    <div class="container-fluid left-div-form bg-white">
                        <div class="bcrm_toggle_cont" data-toggleid="6">
                            <div class="mobile-hide">                                
                            </div>
                            <div class="row form mobile-hide   bcrm_toggle_cont js_toggle_cont_except" data-toggleid="8">
                                <div class="col-md-12 col-sm-12 col-xs-12 by-car-name padding10px">
                                    <input type="text" name="vehicle_name" value="" id="vehicle-name" placeholder="Search" class="form-control filter-data bcrm_car_name_filter bcrm_watermark watermark" data-native="false">
                                </div> </div>
                            <div class="row">
                                <div class="col-md-12 col-sm-12 col-xs-12 simple-container">
                                    <div id="bcrm_location_all_container"><div class="container-fluid google-map hide-map">

                                        </div></div>
                                </div>
                            </div>

                            <?php if(count($vendor_data)>0){ ?>
                            <div><!-- /.checkbox filter start -->
                                <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="2">Suppliers
                                </div>
                            </div>

                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                               <?php foreach ($vendor_data as $key => $value) { ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $value[0]; ?>
                                                <input class="filter-data" type="checkbox" name="suplier-name" value="<?php echo str_replace(' ','',$value[0]); ?>" id="<?php echo str_replace(' ','',$value[0]); ?>">
                                                <span class="checkmark"></span>
                                            </label>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
<?php } ?>
                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Fuel options
                                    </div>
                                </div>

                                <?php foreach ($fuel_type as $fuelType =>$count) { ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $fuelType; ?> (<?php echo $count; ?>)
                                                <input class="filter-data" type="checkbox" name="fuel_type" value="<?php echo $fuelType; ?>" id="<?php echo $fuelType; ?>">
                                                <span class="checkmark"></span>
                                            </label>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                            
                <?php if(count($rating_filter)>0){ ?>
                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Rating
                                    </div>
                                </div>

                                <?php foreach($rating_filter  as $key=>$value){ ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $key; ?> Star (<?php echo $value; ?>)
                                                <input class="filter-data" type="checkbox" name="rating" value="<?php echo $key; ?>">
                                                <span class="checkmark"></span>
                                            </label>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                        <?php } ?>
                            
                            <?php if(count($vehicle_type)>0){ ?>
                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Vehicle Type
                                    </div>
                                </div> 
                                <?php 
                                foreach ($vehicle_type as $key => $vehType) {
                                        $vehicle_type = $key;
                                        $vehile_type_count = $vehType;
                                        $vehicle_name_Arr = $vehicle_name[$vehicle_type];
                                        //echo '<pre>';print_r($vehicle_name_Arr);die();
                                        //$vehicle_name_Arr = explode(',',$vehicleNameStr);                                        
                                    ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $vehicle_type; ?> (<?php echo $vehile_type_count ;?>)
                                                <input class="filter-data vehicle-type" type="checkbox" name="vehicle_type" value="<?php echo str_replace(' ','',$vehicle_type); ?>" id="<?php echo str_replace(' ','',$vehicle_type); ?>">
                                                <span class="checkmark"></span>                                               
                                            </label>
                                            
                                             <ul class="vehicle-name display-block">
                                                 <?php 
                                                 if(count($vehicle_name_Arr)>0){ 
                                                     foreach($vehicle_name_Arr as $vehicleName =>$vehiclecount){
                                                   ?>
                                                 <li>
                                                      <label class="booking-check"><?php echo $vehicleName; ?> (<?php echo $vehiclecount;?>)
                                                       <input class="filter-data" type="checkbox" name="vehicle_type" value="<?php echo str_replace(' ','',$vehicleName); ?>" id="<?php echo str_replace(' ','',$vehicleName); ?>">
                                                       <span class="checkmark"></span>
                                                      </label>
                                                 </li>
                                                 <?php }} ?>
                                              
                                             </ul> 
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                            <?php } ?> 
                            
                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Vehicle Model
                                    </div>
                                </div>
                                <?php foreach ($vehicle_model_data as $model => $modelcount) {                                                                           
                                    ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $model; ?> &nbsp; (<?php echo $modelcount;?>)
                                                <input class="filter-data" type="checkbox" name="vehicle_model" value="<?php echo str_replace(' ','',$model); ?>" id="<?php echo str_replace(' ','',$model); ?>">
                                                <span class="checkmark"></span>                                               
                                            </label>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                            
                            <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Vehicle Color
                                    </div>
                                </div>
                                <?php foreach ($vehicle_color_data as $color => $colorcount) {                                                                           
                                    ?>
                                    <div class="row supplier">
                                        <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                            <label class="booking-check"><?php echo $color; ?> &nbsp (<?php echo $colorcount; ?>)
                                                <input class="filter-data" type="checkbox" name="vehicle_model" value="<?php echo str_replace(' ','',$color); ?>" id="<?php echo str_replace(' ','',$color); ?>">
                                                <span class="checkmark"></span>                                               
                                            </label>
                                        </div>
                                    </div>
                                <?php } ?>
                            </div>
                            
                            

                           <!-- <div id="car-vendors-list" class="bcrm_toggle_cont" data-toggleid="2">
                                <div>
                                    <div class="col-md-12 col-sm-12 col-xs-12 tab sub-tab bcrm_toggle_btn open" data-toggleid="11">
                                        Vehicle Equipment
                                    </div>
                                </div>

                                <div class="row supplier">
                                    <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                        <label class="booking-check">Manual transmission
                                            <input class="filter-data" type="checkbox" name="vehicle_feature" value="manual_transmission">
                                            <span class="checkmark"></span>
                                        </label>
                                    </div>
                                </div>

                                <div class="row supplier">
                                    <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                        <label class="booking-check">Auto transmission
                                            <input class="filter-data" type="checkbox" name="vehicle_feature" value="auto_transmission">
                                            <span class="checkmark"></span>
                                        </label>
                                    </div>
                                </div>

                                <div class="row supplier">
                                    <div class="col-md-12 col-sm-6 col-xs-6 brand">
                                        <label class="booking-check">Air conditioning
                                            <input class="filter-data" type="checkbox" name="vehicle_feature" value="air_conditioning">
                                            <span class="checkmark"></span>
                                        </label>
                                    </div>
                                </div>
                            </div>-->
                            <!-- /.checkbox filter end -->
                        </div>
                    </div>
                </div>
            </div>
            <div class="clearfix"> </div>
        </div>
    </div>
</div>