<?php
$bosa_restaurant_inn_blog_chef_one_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_one','' );
$bosa_restaurant_inn_blog_chef_two_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_two','' );       
$bosa_restaurant_inn_blog_chef_three_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_three','' );
$bosa_restaurant_inn_blog_chef_four_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_four','' );
$bosa_restaurant_inn_blog_chef_five_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_five','' );
$bosa_restaurant_inn_blog_chef_six_ID = get_theme_mod( 'bosa_restaurant_inn_blog_chef_six','' );

$bosa_restaurant_inn_chef_array = array();
$bosa_restaurant_inn_has_chef = false;
if ( !empty( get_theme_mod( 'bosa_restaurant_inn_chef_title', '' ) ) || !empty( get_theme_mod( 'bosa_restaurant_inn_chef_info_one', '' ) )|| !empty( get_theme_mod( 'bosa_restaurant_inn_chef_info_two', '' ) ) ) { 
	$bosa_restaurant_inn_has_chef = true;
}
if( !empty( $bosa_restaurant_inn_blog_chef_one_ID ) ){
	$bosa_restaurant_inn_blog_chef_one  = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_one_ID,'bosa-restaurant-inn-420-300');
 	if ( is_array(  $bosa_restaurant_inn_blog_chef_one ) ){
 		$bosa_restaurant_inn_has_chef = true;
   	 	$bosa_restaurant_inn_blog_chef_one = $bosa_restaurant_inn_blog_chef_one[0];
   	 	$bosa_restaurant_inn_chef_array['image_one'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_one,
		);	
  	}
}
if( !empty( $bosa_restaurant_inn_blog_chef_two_ID ) ){
	$bosa_restaurant_inn_blog_chef_two = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_two_ID,'bosa-restaurant-inn-420-300');
	if ( is_array(  $bosa_restaurant_inn_blog_chef_two ) ){
		$bosa_restaurant_inn_has_chef = true;	
        $bosa_restaurant_inn_blog_chef_two = $bosa_restaurant_inn_blog_chef_two[0];
        $bosa_restaurant_inn_chef_array['image_two'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_two,
		);	
  	}
}
if( !empty( $bosa_restaurant_inn_blog_chef_three_ID ) ){	
	$bosa_restaurant_inn_blog_chef_three = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_three_ID,'bosa-restaurant-inn-420-300');
	if ( is_array(  $bosa_restaurant_inn_blog_chef_three ) ){
		$bosa_restaurant_inn_has_chef = true;
      	$bosa_restaurant_inn_blog_chef_three = $bosa_restaurant_inn_blog_chef_three[0];
      	$bosa_restaurant_inn_chef_array['image_three'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_three,
		);	
  	}
}
if( !empty( $bosa_restaurant_inn_blog_chef_four_ID ) ){	
	$bosa_restaurant_inn_blog_chef_four = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_four_ID,'bosa-restaurant-inn-420-300');
	if ( is_array(  $bosa_restaurant_inn_blog_chef_four ) ){
		$bosa_restaurant_inn_has_chef = true;
      	$bosa_restaurant_inn_blog_chef_four = $bosa_restaurant_inn_blog_chef_four[0];
      	$bosa_restaurant_inn_chef_array['image_four'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_four,
		);	
  	}
}
if( !empty( $bosa_restaurant_inn_blog_chef_five_ID ) ){	
	$bosa_restaurant_inn_blog_chef_five = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_five_ID,'bosa-restaurant-inn-420-300');
	if ( is_array(  $bosa_restaurant_inn_blog_chef_five ) ){
		$bosa_restaurant_inn_has_chef = true;
      	$bosa_restaurant_inn_blog_chef_five = $bosa_restaurant_inn_blog_chef_five[0];
      	$bosa_restaurant_inn_chef_array['image_five'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_five,
		);	
  	}
}
if( !empty( $bosa_restaurant_inn_blog_chef_six_ID ) ){	
	$bosa_restaurant_inn_blog_chef_six = wp_get_attachment_image_src( $bosa_restaurant_inn_blog_chef_six_ID,'bosa-restaurant-inn-420-300');
	if ( is_array(  $bosa_restaurant_inn_blog_chef_six ) ){
		$bosa_restaurant_inn_has_chef = true;
      	$bosa_restaurant_inn_blog_chef_six = $bosa_restaurant_inn_blog_chef_six[0];
      	$bosa_restaurant_inn_chef_array['image_six'] = array(
			'ID' => $bosa_restaurant_inn_blog_chef_six,
		);	
  	}
}

if( !get_theme_mod( 'bosa_restaurant_inn_disable_chefs_section', true ) && $bosa_restaurant_inn_has_chef ) { ?>
	<section class="section-chef-area">
		<?php if ( !empty( get_theme_mod( 'bosa_restaurant_inn_chef_title', '' ) ) || !empty( get_theme_mod( 'bosa_restaurant_inn_chef_info_one', '' ) )|| !empty( get_theme_mod( 'bosa_restaurant_inn_chef_info_two', '' ) ) ) { ?>
			<div class="chef-section-title-wrap">
				<h2 class="chef-title">
					<?php echo esc_html( get_theme_mod( 'bosa_restaurant_inn_chef_title', '' ) ); ?>
				</h2>
				<p class="info-section">
					<?php echo esc_html( get_theme_mod('bosa_restaurant_inn_chef_info_one') ); ?>
				</p>
				<p class="info-section">
					<?php echo esc_html( get_theme_mod('bosa_restaurant_inn_chef_info_two') ); ?>
				</p>
			</div>
		<?php } ?>
		<div class="chef-content-wrap">
			<div class="row justify-content-center chef-row">
				<?php foreach( $bosa_restaurant_inn_chef_array as $bosa_restaurant_inn_each_chef ){ ?>
					<div class="col-sm-6 col-md-4 chef-column">
						<figure class= "featured-image">
							<img src="<?php echo esc_url( $bosa_restaurant_inn_each_chef['ID'] ); ?>">
						</figure>
					</div>
				<?php } ?>
			</div>	
		</div>	
	</section>
<?php }