<div class="col-md-12">
	
    <section class="searchFilter mainBgColor">
		
			
		<?php if(get_field('category_on_filter','options')): ?>
			
			<div class="col-md-4 selectWrapper">
				<div class="select">
					<i class="fa <?php the_field('room_category_icon','options'); ?> fa-lg brandColor"></i>
					
					<?php 
						$multiple = "";
					 	if(get_field('multiple','options')){		
							$multiple = "multiple";
						} 
					?>
					
					<div class="um_filter">	
					<select class="selectpicker um_category_filter" <?php echo $multiple; ?> data-um_title="room_categories" data-width="100%" title="<?php _e('Room Categories','um_lang'); ?>">
															
						<?php 
							$taxonomyName = "room_categories";
							$terms = get_terms($taxonomyName, array('parent' => 0));
							if($terms):?> 
								
								<option class="um_all"> <?php _e('All Room Categories','um_lang');  ?></option>
								<!-- <option data-divider="true"></option> -->
								
							<?php foreach($terms as $term): ?>
							
							  
								  <option class="<?php echo $term->slug; ?>"> <?php echo $term->name;?></option>
								
								   	<?php 
								   	
								   		$term_children = get_term_children($term->term_id,$taxonomyName);
								  		$has_children = false;
								
									    foreach($term_children as $term_child_id) :
									    
								    ?>
								      
								       	 	<?php $term_child = get_term_by('id',$term_child_id,$taxonomyName); ?>
								            <option class="<?php echo $term_child->slug; ?>" > <?php echo ' &nbsp; &raquo; &nbsp; '.$term_child->name; ?> </option>
											<?php if($term_child){
													$has_children = true;
											}?>
									
										<?php endforeach; ?>
									
								<!-- 	<?php if($has_children): ?>
										<option data-divider="true"></option>
									<?php endif; ?>
								-->
							<?php endforeach;?>
						<?php endif; ?>
					</select>
					</div>							
				</div>
			</div>
		<?php endif; ?>
		
		
		
		<?php $customFilters = get_field('custom_categories','options'); ?>
		<?php if($customFilters): ?>
			<?php $countClass = 1; ?>
			<?php foreach($customFilters as $filter): ?>
					<?php if($filter["name"] && (preg_replace('/\s+/', '', $filter["name"]) != '')): ?>
						<?php if($filter['show_on_filter']): ?>
								
								<?php 
									$taxonomyName = "um_".sanitize_text_field(remove_accents(preg_replace('/\s+/', '_', $filter["name"])));
									$terms = get_terms($taxonomyName, array('parent' => 0));
									if($terms):?> 
								
										<div class="col-md-4 selectWrapper">
											<div class="select">
												<i class="fa <?php echo $filter['icon']; ?> fa-lg brandColor"></i>
											
													<?php 
															$multiple = "";
														 	if($filter['multiple_select']){		
																$multiple = "multiple";
															} 
													?>
														<div class="um_filter">		
														<select class="selectpicker custom_filter <?php echo 'um_custom_filter_'.$countClass; ?>" <?php echo $multiple; ?> data-um_title="<?php echo $taxonomyName; ?>" data-width="100%" title="<?php echo $filter["name"]; ?>">
														
															<option class="um_all"> <?php _e('All','um_lang'); echo ' '.$filter["name"];  ?></option>
															<!-- <option data-divider="true"></option> -->
															<?php foreach($terms as $term): ?>
															
																	  <option class="<?php echo $term->slug; ?>"> <?php echo $term->name;?></option>
																	
																	   	<?php 
																	   		$term_children = get_term_children($term->term_id,$taxonomyName);
																	  		$has_children = false;
																	
																		    foreach($term_children as $term_child_id) :
																		    
																	    ?>
																	      
																	       	 	<?php $term_child = get_term_by('id',$term_child_id,$taxonomyName); ?>
																	            <option class="<?php echo $term_child->slug; ?>"> <?php echo ' &nbsp; &raquo; &nbsp; '.$term_child->name; ?> </option>
																				<?php if($term_child){
																						$has_children = true;
																				}?>
																		
																			<?php endforeach; ?>
																		
																		<!-- <?php if($has_children): ?>
																			<option data-divider="true"></option>
																			<?php endif; ?>
																		-->
																
															<?php endforeach;?>
													
													</select>
													</div>				
											
											</div>
										</div>
								
									<?php endif; ?>
																				
						<?php endif; ?>
					<?php endif; ?>				
					<?php $countClass++; ?>					
			<?php endforeach; ?>
		<?php endif; ?>
		
    </section>
    
    
</div>